Uh oh!
There was an error while loading. Please reload this page.
fix(claude): report subagent model and effort - #7287
Conversation
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — ClaudeAdapter now changes existing subagent event semantics and adds asynchronous SDK hook, buffering, and late-correction behavior that reaches persisted activity and the Agents panel. The scope is tested and does not alter model routing, but the cross-event production lifecycle changes warrant human review. You can add or adjust custom eligibility rules. Learn more. |
…del-attribution # Conflicts: # apps/server/src/provider/Layers/ClaudeAdapter.ts
lnieuwenhuis
commented
Aug 26, 2026
Merged current Two notes for reviewers:
|
SamGu-NRX
commented
Aug 27, 2026
Independent reproduction, plus one data point on Prevalence. I compared the label on every The 79%→14% gap is the part I found interesting: refinement does most of the work, so the residual is concentrated in children that never stream an assistant snapshot the parent sees. One possible addition. That would give a launch-time value between an explicit Worth noting the built-in defaults are version-sensitive: on the SDK-bundled 2.1.170 Composition. I have a separate fix for a different bug in this file, the parent context meter counting subagent tokens (#5942, PR #8453). I applied your branch and mine together on today's |
…l-attribution # Conflicts: # apps/server/src/provider/Layers/ClaudeAdapter.test.ts
Problem
Claude file-defined subagents were seeded with the parent session's model and effort. The Agents panel therefore showed the parent settings for every subagent, and authoritative model snapshots that arrived late never reached the client.
Fix
task.startedSubagentStartandSubagentStophooksVerification
pnpm exec vp test run apps/server/src/provider/Layers/ClaudeAdapter.test.ts(74 passed)pnpm exec vp test run packages/client-runtime/src/state/subagentRuntime.test.ts(48 passed)pnpm exec vp run --filter t3 typecheckFixes#7281
Model: GPT-5.6 Sol
Harness: Codex in T3 Code
Note
Medium Risk
Changes runtime
task.*event payloads (model/effort may be undefined where they were previously inherited), which can affect UI and consumers that assumed parent session values.Overview
Fixes misattributed subagent identity in
ClaudeAdapter: file-defined agents no longer inherit the parent session’s model or effort ontask.startedwhen the Agent tool omits overrides.Seeding and reconciliation now use only explicit Agent tool
model/effort, buffered pre-start assistant snapshots, and SDKSubagentStart/SubagentStophooks (effort.level). Pending state is merged as model+effort refinements (cap 256) instead of model-only buffers. Late snapshots or hook updates emittask.updatedso the Agents panel can correct identity after a task completes.Tests cover non-inheritance, ordering (snapshot before/after
task_started), explicit overrides, late corrections, and eviction of unmatched pending snapshots.Reviewed by Cursor Bugbot for commit 1aeabb1. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix subagent model and effort reporting in
ClaudeAdapterinvokeSubagentEffortHooktest utility that retrieves and invokes the configuredSubagentStart/SubagentStopcallback with synthetic hook input containing session, agent, effort, and stop fieldsundefinedwhen none are availabletask.updatedcorrection after terminal events, and for eviction of the pending subagent snapshot buffer at 257 unmatched entriesundefinedunless an explicit override, snapshot, or hook supplies themMacroscope summarized 1aeabb1.