fix(server): finished Claude subagents leave no running rows - #13730
Conversation
The Claude adapter copied each task_progress description ("Running
<step>") into the subagent's child thread as a reasoning item titled
"Subagent progress". The row was settled to completed when the run
ended, but its text still read "Running ...", so a finished subagent
thread kept a row that looked like a step in progress. It also repeated
work the child already shows as its own tool calls and thinking.
Progress stays on the parent's subagent card (subagent.progress), where
clients already show it. The child thread now holds only the subagent's
own work.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a focused Claude subagent projection fix that removes a misleading duplicate progress row from child threads while preserving parent progress and the child’s actual work history. The production change is isolated, non-schema-affecting, and covered by lifecycle replay assertions. You can add or adjust custom eligibility rules. Learn more. |
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: unavailable · PR result: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
c48e8a9
into
t3code/codex-turn-mapping
A finished Claude subagent thread ("Completed in 8.0s") still showed "Running Look for math.ts in expected locations and repo" as if a step were in progress. That row is not a stuck tool call. It is the
task_progresssummary from the first run, which the adapter copied into the child thread as a reasoning item titled "Subagent progress".What I found
In the live DB snapshot and provider log for the "Review src/math.ts" subagent (task
ace7749263e8a24e3), the item istask:ace7749263e8a24e3:progress:task_progress.description:"Running Look for math.ts in expected locations and repo".completed, set at the first run'stask_notification. Every other child item in that thread is also terminal: the tool calls arecompleted/failedand the root turn iscompleted.What changed
ClaudeAdapterV2no longer writes the progress summary into the child thread. It stays on the parent's subagent (subagent.progress), which the subagent card and tooltip already show (web and mobile). The child thread now holds only the subagent's own prompts, tool calls, thinking, and answers. Other providers never emitted this item.Verification
claude_background_subagent_lifecyclereplay fixture: added an assertion that every child item in both subagents' threads is terminal and that no child reasoning item other than the subagent's own thinking is present. Agent B's recordedtask_progress("Running Wait 90 seconds then print B_DONE") stays on its parent subagent. The assertion fails before the adapter change (ontask:af44d5c14aa3ce867:progress) and passes after it.subagentreplay fixture (Claude): it asserted that the child held exactly one progress reasoning item, and its expected child item types listedreasoningonly because of that item. It now asserts that the child does not repeat the progress text.subagent.progressis still asserted on the parent.FoundationPersistence.test.ts: the recovery test's seeded streaming child item was labelled as the adapter's progress item. It is now a plain streaming thinking item, and the behavior under test (recovery settles a live child item) is unchanged.apps/server:vp test run src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts src/orchestration-v2/FoundationPersistence.test.ts src/orchestration-v2/testkit/OrchestratorReplayFixtures.integration.test.ts src/orchestration-v2/testkit/ClaudeReplayFixtures.integration.test.ts: all pass.vp exec tsc --noEmit -p .: no errors or warnings.vp linton the touched files shows only the existing unusedlayerwarning from the base branch.vp run knip:checkis clean.Model: Claude Opus 5.5 (Claude Code)
🤖 Generated with Claude Code