fix(claude): reject waits on native subagent commands #25015
ClosedZheruel(GitHub profile, opens in a new tab)wants to merge 4 commits into
main fromrefs/pull/25015/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:S
github-actions[bot](GitHub profile, opens in a new tab) removed labelssize:S
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
juliusmarminge closed this
Sign in to join this conversation.
No actionable comments were generated in the recent review.
9866391f-bbab-4234-8c5e-e8232ea62907Reviewing files that changed from the base of the PR and between 2ed92618e60f5ee6ecc694eb834c28105a502d09 and 166789315a3d1dd2630e8830af757bd3e5355e91.
apps/server/src/mcp/toolkits/orchestrator/tools.tsapps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.tsapps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.tsIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
Walkthrough
The Claude adapter now tracks subagent task ownership across task events and roster updates. It excludes subagent-owned tasks from awaited-task marking. The tool description and adapter instructions clarify how native subagent background work behaves.
Changes: Subagent task ownership
apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.tsapps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.tsapps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts,apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts,apps/server/src/mcp/toolkits/orchestrator/tools.tsEstimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix · Severity of issue fixed: Medium
Suggested labels:
bugfixSuggested reviewers:
juliusmarminge,t3dotgg,macroscopeappMerge Risk:
Minimal · up to
16678The change is mergeable after normal checks. The supplied evidence does not identify an actionable failure in native-subagent background waits.
Pre-merge checks:
4
#24956requirest3_background_waitto avoid accepting tasks owned by a foreground native subagent and to warn the subagent before it returns.ClaudeAdapterV2.tstracks subagent ownership fro…#24956. The adapter changes preserve ownership needed to enforce the foreground-subagent wait guard. The tool-description change documents the guard. The added tests veri…Full details: Linked Issues check
Explanation
Issue
#24956requirest3_background_waitto avoid accepting tasks owned by a foreground native subagent and to warn the subagent before it returns.ClaudeAdapterV2.tstracks subagent ownership fromowned_by_subagentandparent_task_id, retains that ownership across task-list refreshes and Bash timeout transitions, removes owned tasks from the awaited set, and returns them as unmatched. The injected Claude instructions and thet3_background_waitdescription direct native subagents to finish commands before returning and to usedelegate_taskfor work that must outlive the turn. Regression tests cover the unmatched result, ownership retention, and awaited-mark clearing.Full details: Out of Scope Changes check
Explanation
The changes stay within issue
#24956. The adapter changes preserve ownership needed to enforce the foreground-subagent wait guard. The tool-description change documents the guard. The added tests verify the guard and its ownership edge cases. No unrelated product behavior or unrelated files appear in the reviewed changes.Finishing Touches
🧪 Generate unit tests (beta)
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment `@coderabbitai help` to get the list of available commands.