fix(web): label nested agent models from spawn/response #7199
main fromrefs/pull/7199/head·opened View on GitHubProblem#
Depth-2 Agent-tool spawns were labeled with the parent session model (fable-5) even when every response was served by the child's frontmatter model (gpt-5.6-sol). task_started copied session.model whenever the spawn omitted a model, and that invented id rode on every later task.* linkage row.
Fix#
Persist only a model the spawn or SDK actually named. Nested children stay unlabeled until the first assistant / message_start serving model arrives; later task.* rows carry that id. formatSubagentModelLabel is unchanged. A later payload without a model never clears a known one.
Fixes #6026
Model: grok-4 Harness: T3 Code
Note
Medium Risk Changes task lifecycle model attribution in ClaudeAdapter, which affects UI labels for nested agents; behavior is covered by new adapter and client-runtime tests.
Overview Fixes #6026: nested Agent-tool tasks were shown with the parent session model when the spawn omitted an explicit model.
ClaudeAdapter now seeds task.* model only from the Agent launch input, the SDK task_started row, or later assistant / message_start serving ids—via explicitTaskModel (ignores "inherit") and rememberTaskAgentServingModel. It no longer copies session.model on task_started. Effort still inherits from the session when the launch omits it.
Tests assert unlabeled starts until a serving model arrives, depth-2 nesting never uses the session default, and the client-runtime fold keeps model unset until a payload names one without clearing a known model later.
Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 1ae6af1b348553ae7262c3fcb5c910c5c3d35803. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).Note
Fix nested agent task model attribution to use child model instead of session default#
- Nested Agent tool tasks started without an explicit model no longer inherit the session's default model;
payload.modelremainsundefineduntil an SDKmessage_startor assistant message names one. - Adds
explicitTaskModel,servingModelFromSdkMessage, andrememberTaskAgentServingModelhelpers in ClaudeAdapter.ts to centralize model extraction and attribution logic. - Model refinement from SDK stream frames now updates the owning nested task consistently, replacing bespoke inline trimming logic.
- Behavioral Change: tasks previously labeled with the session default model at start will now show
undefineduntil the serving model is confirmed from SDK traffic.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
Approvability#
Verdict: Approved 1ae6af1
Bug fix for incorrect model labeling in nested agent tasks (#6026). Changes are limited to UI display strings - not runtime behavior. Well-tested with ~210 lines of new test coverage, clear intent, and obvious resolution.
You can customize Macroscope's approvability policy. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
Note
🤖 GPT-6 Astra (preview) responding on behalf of Theo
This was closed as part of an automated cleanup pass. If you believe it was closed in error, reply here and we will get it reopened.
Closing as superseded by merged #7583. Main now keeps a child's serving model even when its first response arrives before
task_started, then uses it instead of the parent model. The linked persistent-label report is closed. Leaving a label blank until the first response is a separate display preference.t3dotgg(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID:
1124db64-0ab5-4f7f-86cf-ccb6b7c0d0f2You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.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.
❤️ Share