Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): resumed Claude subagents keep their own model and effort label #14272

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

What Changed

When a finished Claude subagent is revived with SendMessage, its row in the agents list now keeps the subagent's model instead of switching to the parent session's model. Subagent rows also stop showing the session's effort level; effort appears only when the Agent call sets it explicitly.

Why

Reviving a finished subagent makes the SDK register the same task again, with the SendMessage call as its launching tool. That call names no model or effort, so the adapter fell back to the session's selection and the row showed the parent's model while the subagent kept running on its own. Subagents that received a message while still running were unaffected, because no new task_started arrives for them.

Effort had a second problem: when the Agent call set no effort, the row showed the session's effort. An agent definition can set its own effort, and the SDK reports no per-subagent effort on any stream message, so the row could show medium for a subagent running on high. The contract describes the field as "effort when known", so the adapter now reports effort only when the launch input sets it, and keeps the known value across a resume.

Scope is the Claude adapter's task_started handling. Model refinement from subagent snapshots and the client reducers are unchanged.

Closes #14842

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Summary by CodeRabbit

  • Bug Fixes
    • Task status now reflects explicitly selected effort settings, rather than incorrectly reporting the session’s effort when none was specified for the task.
    • Resumed agents retain the model and effort selected when they were originally launched, keeping task details consistent across the session.
    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    2. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Approved at eb08085

      Macroscope's review found this PR approvable — This is a small, well-tested Claude adapter bug fix that corrects resumed subagent metadata without changing the underlying model or effort used by the runtime. The production impact is limited to task labeling and state retention, with no new capability, schema change, or deployment impact.

      Notes:

      • Diff unchanged. Approvability was decided on eligibility alone.
      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    3. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      Review in Change Stack →

      Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

      No actionable comments were generated in the recent review. 🎉

      ℹ️ Recent review info
      ⚙️ Run configuration

      Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml

      Review profile: CHILL

      Plan: Advanced

      Run ID: d394f9f1-7c6c-4c25-acdc-d45966ddf9a5

      📥 Commits

      Reviewing files that changed from the base of the PR and between d2c9281b8112dc3b2991642c4bdb985e4b08b9bb and eb08085f1d5f55219c151f8352f42a841ff787f9.

      📒 Files selected for processing (2)
      • apps/server/src/provider/Layers/ClaudeAdapter.test.ts
      • apps/server/src/provider/Layers/ClaudeAdapter.ts

      Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.


      📝 Walkthrough

      Walkthrough

      Claude task registration now selects the model from launch input, recorded task state, or session state. It uses explicit or previously recorded task effort, not session effort. Tests cover omitted launch values and resumed-agent model and effort retention.

      Changes

      Claude agent registration

      Layer / File(s)Summary
      Task model, effort, and resume behavior
      apps/server/src/provider/Layers/ClaudeAdapter.ts, apps/server/src/provider/Layers/ClaudeAdapter.test.ts
      Task registration falls back to the recorded task model and effort when launch values are absent. Session effort is no longer stored, and existing run handles are reused. Tests cover omitted launch values and resumed-agent event values.

      Priority: ⬇️ Low

      Estimated code review effort: 2 (Simple) | ~12 minutes

      Change: Bug fix

      Suggested reviewers: t3dotgg

      Merge Risk: ⚪ Minimal · up to eb080

      No actionable merge-blocking issue was identified in Claude subagent metadata registration or resume behavior. The change is mergeable after normal checks.

      Security Architecture Review

      Security architecture risk: 🔵 Low · up to eb080

      Resumed tasks now retain their own displayed settings instead of inheriting session settings. No new privilege path was found, but behavior during overlapping lifecycle events is not fully established.

      Retained concerns No architecture-level concerns identified.

      Security review details

      Security Blast Radius

      • inferred — The examined change affects task metadata and lifecycle-event output within the existing provider path; it does not establish an additional execution or privilege path.

      Trust Boundaries and Controls

      • observed — Task ownership continues to come from the in-flight launching tool’s agent attribution. Retained model, effort, and run handles do not replace that attribution.
      🚥 Pre-merge checks | ✅ 4 | ❌ 1

      ❌ Failed checks (1 warning)

      Check nameStatusExplanationResolution
      Description check⚠️ WarningThe description explains the problem, intended behavior, implementation scope, and linked issue. It does not follow the required template headings and does not provide focused verification steps or ob…Add the required Problem, Change, Scope and approval, and Verification sections. Include the specific tests run, their observed results, and anything not checked. Link the triaged issue with approval evidence, or explain why this focused fi…
      ✅ Passed checks (4 passed)
      Check nameStatusExplanation
      Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
      Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
      Title check✅ PassedThe title clearly and concisely describes the main change: resumed Claude subagents retain their own model and effort label.
      Full details: Description check

      Explanation

      The description explains the problem, intended behavior, implementation scope, and linked issue. It does not follow the required template headings and does not provide focused verification steps or observed test results. It also does not clearly document maintainer approval or why the change qualifies as an obvious bug fix.

      Resolution

      Add the required Problem, Change, Scope and approval, and Verification sections. Include the specific tests run, their observed results, and anything not checked. Link the triaged issue with approval evidence, or explain why this focused fix does not require prior approval.

      • Fix all pre-merge checks with AI
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create a new PR

      Comment `@coderabbitai help` to get the list of available commands.
    4. juliusmarminge added labelsmacroscope-review

    5. Thanks for working on this. We merged the orchestrator V2 rewrite in #2829, and we are closing this PR as part of that transition.

      This change touches ClaudeAdapter.ts, which the V2 merge removed. Claude execution now runs through ClaudeAdapterV2.

      Sorry for the extra work this creates. If the change is still needed on V2, please rebuild it on current main, verify it there, and open a new PR linking back here. We're closing the current implementation without assuming the underlying request is resolved.

    6. juliusmarminge closed this

Sign in to join this conversation.