Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): label nested agent models from spawn/response #7199

Closedmaslinedwin(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/7199/headopened View on GitHub

Problem

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.model remains undefined until an SDK message_start or assistant message names one.
  • Adds explicitTaskModel, servingModelFromSdkMessage, and rememberTaskAgentServingModel helpers 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 undefined until the serving model is confirmed from SDK traffic.
Macroscope summarized 1ae6af1.
    1. Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Pro Plus

      Run ID: 1124db64-0ab5-4f7f-86cf-ccb6b7c0d0f2

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review

      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
      Comment `@coderabbitai help` to get the list of available commands.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    3. 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).
    4. 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.

Sign in to join this conversation.