Repository navigation
fix(agents): a Claude Code turn whose background subagents the CLI stopped fails - #783
Closed
victorlee-scale wants to merge 1 commit into
Closed
victorlee-scale wants to merge 1 commit into
victorlee-scale wants to merge 1 commit into
Conversation
…opped fails In print mode the CLI waits only so long after its last turn for background subagents, then stops those still running, says so on stderr alone, and exits 0. The bridge took the earlier result as the turn's answer, so a run that lost its subagents' work was recorded as a success. The bridge now fails such a turn with the subagents' descriptions. Subagents that finished or failed, ones the agent stopped itself with TaskStop, and background tasks other than subagents (task_type local_agent) don't count. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In print mode the Claude Code CLI waits only
CLAUDE_CODE_PRINT_BG_WAIT_CEILING_MS(10 minutes by default) after its last turn for background subagents. It then stops those still running, says so only on stderr, and exits 0. The bridge took the earlierresultas the turn's answer, so a run whose subagents' work was lost was recorded as a success and graded (FD-5844).The bridge now fails such a turn with
claude CLI stopped background subagents before they finished: <descriptions>, reported as acli_error. Only subagents (task_type: local_agent) count. A subagent that completed or failed, or that the agent stopped itself withTaskStop, doesn't, and neither do background shell commands, workflows or remote agents. Healthy turns are unchanged, and the wait ceiling itself is left as it is.Validation: the new unit tests use event shapes from a capture of the pinned CLI (2.1.322), and the stopped-subagent test fails without the change.
tst/unit/agents/claude_codepasses (279 passed, 30 skipped). Not run against a live image.🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge; no actionable issues were found.Summary
The bridge now fails turns that leave unfinished background subagents instead of accepting the CLI's successful exit.
No actionable issues found.
Reviews (1) · Last reviewed commit: "fix(agents): a Claude Code turn whose ba..." · Reviewed by Greptile