Skip to content

fix(pm-dispatch): launch-failure note says a session 'may still be live' even when its cleanup succeeded — and the cleanup-success path has no test #10632

Closed

Description

@dezren39

Finding

Merged PR #4350 made dispatch clean up orphaned OpenCode sessions after a failed launch: handleLaunchFailure cancels the queue task, DELETEs the created session, then posts a note on the issue. The note is composed after the cleanup outcome is known, but both of its session wordings lead with the same hedge:

  • cleanup succeeded: OpenCode session <id> may still be live; session cleanup succeeded.
  • cleanup failed: OpenCode session <id> may still be live; session cleanup failed: <error>

When the DELETE succeeded, "may still be live" is simply wrong — the session was deleted by the handler itself moments earlier. An operator reading the note on the issue cannot tell from its first clause whether a live session needs hunting down, which is exactly the orphan-session ambiguity #3009 (closed by #4350) existed to remove. The cleanup-success branch is also the one branch of the new code with no test: the test suite's deleteSession stub always throws, so only the cleanup-failure wording is pinned.

Evidence

Why it matters

The issue note is the operator's record of whether a failed dispatch left a live OpenCode session behind. A note that claims a deleted session "may still be live" sends operators hunting for orphans that do not exist, and trains readers to ignore the warning in the failure case where it is real. It also leaves the one untested branch of the #4350 cleanup path free to drift.

Acceptance criteria

  • When session cleanup succeeds, the issue note states the session was deleted (or otherwise drops the "may still be live" claim for that branch); the "may still be live" wording remains only where cleanup failed or no deletion callback was available.
  • A test covers the cleanup-success path: deleteSession resolves, and the note's session wording is asserted (and the cancel-before-delete-before-note ordering still holds).
  • Existing launch-failure tests keep passing (bun test test/launch_failure.test.ts).

Shadow verdict (PoC)

Stage A window already closed (summary on #2313) — no shadow verdict recorded.

Activity

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/triageQueue packet kind: verify, reproduce, and route this item
    priority/lowNice to have; do when convenient
    app/pm-stackpm-stack (Pad/Grist) in developing-today/code
    on Nov 16, 2026
  2. developing-today commented on Nov 16, 2026

    @developing-today
    Contributor
  3. dezren39 commented on Nov 16, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    Agent: pr-diff-review-b
    State: filed
    Repo: developing-today/code
    Source PR: #4350 (MERGED, commit 076822d, merge dff881b, ancestor-verified on main, compare behind=0) — closes #3009 (CLOSED, verified)
    Finding: PR #4350's handleLaunchFailure composes the issue note after session cleanup runs, but the cleanup-success branch still reads "OpenCode session may still be live; session cleanup succeeded." (pm-stack/dispatch/src/launch_failure.ts:127 on main) — a deleted session reported as possibly live. The cleanup-success branch is also untested: test/launch_failure.test.ts's deleteSession stub always throws, so only the cleanup-failure wording is pinned.
    Verified against main: 91df855 (raw-file read of launch_failure.ts :102/:127-128 and launch_failure.test.ts deleteSession stub/assertions; dedupe: gh search "may still be live" returned only closed #3009; "launch failure session cleanup note" returned nothing)
    Evidence: hidden_files/pr-review-b-2026-11-16-0118-code/issue-launch-failure-note-body.md + pr-4350.diff + pr-4350.json

    kind/bug,task/triage,status/needs-triage,source/pr-diff-review,priority/low,queue/queued,app/pm-stack

  4. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed on Nov 16, 2026
  5. dezren39 commented on Nov 16, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    Agent: repo-worker-code/code-j (openchamber-scheduled-lane)
    State: picked_up
    Task: 17423 (triage)
    Claim: 2026-11-16T07:51:03Z, lane code-j
    Verified so far: issue OPEN; PR #4350 MERGED; success-branch wording at pm-stack/dispatch/src/launch_failure.ts:127 and always-throws deleteSession stub in pm-stack/dispatch/test/launch_failure.test.ts confirmed on main 91df855. No competing PR or branch for this fix.
    Next: verify evidence, route small_fix follow-up, complete triage.

  6. 4 remaining items

  7. dezren39 commented on Nov 16, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    Agent: repo-worker-code/code-j (openchamber-scheduled-lane)
    State: picked_up
    Task: 17424 (small_fix, follow-up of triage 17423)
    Claim: 2026-11-16T07:54:04Z, lane code-j
    Next: worktree + branch, wording fix at launch_failure.ts:127, cleanup-success test, targeted bun tests, PR.

  8. dezren39 commented on Nov 16, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    Agent: repo-worker-code/code-j (openchamber-scheduled-lane)
    State: pr_opened
    Task: 17424 (small_fix)
    PR: #10634 (branch queue/17424-10632-launch-note-wording, commit 32d7129)
    Tests: bun test test/launch_failure.test.ts — 9 pass, 0 fail.
    Next: watch CI; merge under standing criteria when green.

  9. added a commit that references this issue on Nov 16, 2026
  10. dezren39 commented on Nov 16, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    Agent: repo-worker-code/code-j (openchamber-scheduled-lane)
    State: done
    Task: 17424 (small_fix)
    PR: #10634 MERGED (merge f2b4512, 2026-11-16T07:58:35Z)
    Tests: bun test test/launch_failure.test.ts — 9 pass, 0 fail. Checks on merge commit: only CodeRabbit neutral; mergeStateStatus CLEAN at merge time.
    Change: cleanup-success note now states the session was deleted; hedge kept for failure/no-callback branches and the pre-DELETE cancel reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/pm-stackpm-stack (Pad/Grist) in developing-today/codekind/bugSomething isn't working (prefixed form of the classic bug label)priority/lowNice to have; do when convenientsource/pr-diff-reviewFiled by the pr-diff-review jobstatus:donetask/triageQueue packet kind: verify, reproduce, and route this item

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions