Skip to content

fix(server): Claude subagents that end between turns no longer stay Running (promote #301) - #307

Closed
bk-agent-01 wants to merge 7 commits into
bkmainfrom
promote/claude-subagent-end-2026-10-11
Closed

bk-agent-01 wants to merge 7 commits into
bkmainfrom
promote/claude-subagent-end-2026-10-11

Conversation

@bk-agent-01

Copy link
Copy Markdown
Collaborator

What this promotes

This promotes only PR #301 to bkmain (production bkt3). It does not merge stage. The branch is cut from origin/bkmain and merges the #301 branch tip. The MCP work that also sits on that branch is already on bkmain through #306, so this diff adds only the 4 fix commits and 6 files.

The fix (from #301)

  1. A Claude subagent that ends between turns completes its card at once. This also applies to a nested subagent and to a thread with a held queue. Before the fix, the card could show Working for a day after the subagent finished.
  2. A provider continuation run starts past a held queue. Held user runs keep waiting, so Claude's own replies from self-started turns are no longer lost.

The root cause, the evidence and the review answers are in #301.

How I tested

  • CI on fix(server): Claude subagents that end between turns no longer stay Running #301: all checks green on 1be3edc6c and on 3d2877292, the branch merged with the newer stage. One Grok replay test timed out once and passed on a rerun.
  • Deployed to stage as c2d40cf8a at 19:04 UTC. Stage now runs f8fc0595c, which contains it.
  • Manual test on stage by the requester: pending. Do not merge before that test.

Merge impact

A merge restarts t3-nextbkt3 (bkt3 production) and ends the live sessions there. It needs the requester's explicit go.

🤖 Generated with Claude Code

bk-agent-01 and others added 7 commits October 11, 2026 09:52
…s Running

A background subagent's task_notification that arrives while the root turn is
idle only went to the wake buffer, so its card completed when a continuation
run drained it. A nested subagent's end never offers a continuation, and a
held queue can keep the continuation from ever starting; on stage a reviewer
subagent showed Running for a day after it finished.

Between turns, a running registered subagent's end now completes its card at
once through the turn that settled last, as its progress already does. The
frame still waits in the wake buffer, so the wake label and continuation
offer are unchanged; the drain skips the card update it already made, and the
undrained end keeps pinning the session until then.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Stop holds every queued run, and each later queued run copied that hold. A
continuation that ProviderContinuationService queues for output the Claude CLI
already produced (it started a turn by itself) was held with them, so it never
ran: the adapter kept that output, and every later wake on the thread, in its
buffer. On stage this lost three agent replies and a subagent's completion.

An adapter continuation (createdBy agent, creationSource provider) no longer
copies the hold, and the queue starts the first queued run that is not held.
Held user runs keep waiting for the user, in their order.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…inuations

A second end that arrives behind a buffered resume must wait for the drain
that re-opens the card, or the card stays Running. The queue helper's comment
now says that a Codex continuation is a real prompt and also starts past a
held queue.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added size:L vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Oct 11, 2026
@bk-agent-01

Copy link
Copy Markdown
Collaborator Author

PR #312 promoted all of stage to bkmain (merge cb9eb33). That promotion includes #301, so the change in this PR is now live on bkt3. This PR is no longer needed. I left it open for its owning session to close.

Requested by Tushar Bhardwaj. Sent by the "Custom Group Running Sessions Toggle" session.

@bk-agent-01

Copy link
Copy Markdown
Collaborator Author

Closed at Tushar's request. PR #312 (merge cb9eb33) shipped #301 to bkmain. Every file this PR changes is now identical on bkmain.

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

Labels

size:L vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant