Skip to content

An implement session that ends with background helpers still running leaves its commits pushed but no PR, failing with 'no PR found' #2231

Closed

Description

@JacobStephens2

This was generated by AI during triage.

Problem

An implement session can finish its change and push its commits, yet never open the pull request, when the session ends while its own background helpers are still running. The Ticket run then fails at Pull request readiness with only no PR found. The work survives on the Issue branch, but the Ticket fails, and in a Spec run that leaves the Spec incomplete.

Observed (2026-11-14, wire-report Spec #43, Ticket #73, Lima, thirdshift 0.32.0, claude · opus)

From the Spec's Command log:

16:20:35 #73: implement: session started
17:20:40 #73: implement: commit
17:20:43 #73: implement: skill thirdshift-code-review
17:21:17 #73: implement: Agent Standards review of issue-73
17:21:28 #73: implement: Agent Spec review of issue-73
17:22:19 #73: implement: SubagentHandback
17:32:25 #73: Background tasks still running 10m after the last turn (subagent "Spec review of issue-73"); stopping them. Set CLAUDE_CODE_PRINT_BG_WAIT_CEILING_MS=0 to wait indefinitely.
17:32:26 #73: implement: session ended after 71m 51s: 0 turns, $2.74 at API prices
17:32:26 #73: implement: no review reports were left; carrying on
17:32:29 #73: security-review: session started
17:33:13 #73: security-review: session ended after 45s
17:33:14 #73: pushing issue-73
17:33:21 #73: Stopped at: Pull request readiness
17:33:21 #73: no PR found

So the session:

  1. committed the change;
  2. started the thirdshift-code-review skill's two background subagents;
  3. received one handback and then ended its turn, with the other subagent still running.

Claude Code's -p mode waits at most 10 minutes for background tasks after the last turn, then stops them. The session therefore ended before its remaining steps, which included creating the PR with thirdshift-pr (the implement prompt asks the session to push and create it). thirdshift pushed issue-73, which holds the commit, and then failed to find a PR.

This is the same family as #2171: a Claude session that ends a turn while waiting on background work instead of finishing in the foreground.

Agent Brief

Category: bug
Summary: an implement session that pushed commits but opened no PR shouldn't fail the Ticket with a bare no PR found, and implement sessions on Claude Code shouldn't lose their final steps to the background-task wait ceiling.

Current behavior:

  • If the implement session ends without creating the PR, readiness fails with no PR found (from the pull request's actionability check). This happens even when the Issue branch carries the session's commits and the Security review passed.
  • Nothing tells the session not to end its turn while subagents are running. The 10-minute ceiling (CLAUDE_CODE_PRINT_BG_WAIT_CEILING_MS) kills the helpers silently from thirdshift's point of view.

Desired behavior:

  1. Recover the missing PR. After the implement session, and after the Security review if one runs: when the Issue branch has commits ahead of its Base branch but no open PR exists for it, thirdshift opens the PR itself as the session would have, against the Run's Base branch (the Spec branch for a Spec's Ticket), with the usual body and Built with line. It logs a line naming the recovery, then continues to readiness, CI and Self-merge as normal. If the branch has no commits ahead, the existing failure stands, with a clearer cause such as "the implement session made no commits and opened no pull request".
  2. Say why when the ceiling fires. When the Claude harness reports "Background tasks still running … stopping them", the Command log and Run notification say the session's background work was stopped at the ceiling. If the Ticket then fails, the failure cause names it rather than only no PR found.
  3. Prevent the stall. The implement prompt, or the thirdshift-code-review skill when it runs inside a thirdshift session, makes the session wait for its review subagents in the foreground before ending its turn. Alternatively, thirdshift sets the Claude harness's background wait ceiling so that a running review is not killed partway. Choose whichever fits the harness layer. The goal is that a session's own review cannot outlive the session.

Acceptance criteria:

  • With fakes, an implement session that pushes commits and creates no PR leads to thirdshift opening the PR and the Ticket run continuing to merge. The log names the recovery.
  • An implement session that makes no commits and opens no PR still fails, with a cause that says so, not a bare no PR found.
  • A Claude session whose output includes the background-tasks-stopped line has that fact in the Command log and, on failure, in the cause.
  • The prompt, skill or harness change is covered by the existing prompt or harness tests, and generated prompts are regenerated (UPDATE_PROMPTS=1 cargo test prompts_page).
  • The guide's description of Pull request readiness mentions the recovery.

Out of scope:

Activity

  1. added
    bug
    ready-for-agent
    in-progress
    and removed
    ready-for-agent
    on Nov 14, 2026
  2. added a commit that references this issue on Nov 15, 2026
  3. removed
    in-progress
    on Nov 15, 2026
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions