Skip to content

Plan PRs can auto-close their ticket's issue via closing keywords in PR body prose #1567

Description

@suleimansh

Found live during the #1327 10-wide fan-out verification (2026-08-17).

What happened: the pinned plan agent for 2026-07-25_queue-button-doesnt-work wrote in its PR body (#1560): "…then comment on and close #1164." GitHub parses close #1164 in a PR body as a closing keyword, so when the plan PR merged, GitHub auto-closed #1164 even though only the plan — which explicitly says the implementation remains — had landed. Knock-on damage: the next tickets/ sync (#1566) saw the closed issue and removed the ticket and its fresh plan from the repo; both had to be restored by hand and #1164 reopened.

Why it will recur: plans naturally end with "…then close #NNNN" as their final step. Any such phrase in a PR body is a live trigger; the failure needs no one to do anything wrong at review time, because the body reads perfectly sensibly to a human.

Fix directions (either or both):

  1. Prompt-side: the pinned plan prompt (and the detached-session closure instruction) tells agents to avoid GitHub closing-keyword phrases (close/fixes/resolves #N) in PR titles/bodies unless the PR genuinely completes the issue — e.g. write "then close issue 1164 (manually)" or "then the issue can be closed".
  2. Framework-side: the PR-opening path for plan-only runs could lint the generated body and rewrite #N closing phrases into non-keyword forms (e.g. wrapping the issue ref in backticks defeats the parser).

Direction 1 is prompt surface (maintainer's call per convention); direction 2 is mechanical and testable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions