Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(claude): 🐛 show the effort a subagent actually runs at #13333

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

Why

A Claude subagent whose agent definition sets its own effort is labeled with the thread's effort instead. From a thread at Extra High, a prober agent defined with effort: low shows opus-5-5 · xhigh in the Agents panel, while its transcript records "effort":"low" on every turn.

task_started carries no effort, so the Claude adapter seeds the label from the Agent tool's effort input or the session's effort. Subagent assistant snapshots later correct the model part of the label, but nothing corrects the effort.

Fix

The SDK reports a subagent's applied effort only on hooks fired inside it. Their input carries agent_id, which equals the subagent's task_id, and effort.level. The adapter now registers PreToolUse and SubagentStop hooks that write that level onto the task. Later task.* rows carry it, the same way snapshots correct model. The hook returns {}, so permissions and tool execution are unchanged. SubagentStart carries no effort, so it is not used.

Verification

  • A live probe on Agent SDK 0.3.276 and Claude Code 2.1.281, with the session at high and a subagent defined at low, confirmed the hook fields. The subagent's PreToolUse and SubagentStop reported agent_id equal to the task_id and effort.level: "low".
  • New: ClaudeAdapter.test.ts, "a hook fired inside a subagent refines its seeded effort". All 141 tests in ClaudeAdapter.test.ts pass. Server typecheck, scoped lint, and formatting are clean.
  • Real web client, base d4cd7d5c33 and this branch: same project, Claude Opus 5.5 at Extra High, and the same prompt spawning the prober agent. The subagent transcript records "effort":"low" in both runs. The corrected label survives a server restart and page reload.
Before: opus-5-5 · xhighAfter: opus-5-5 · low
Before: prober subagent labeled xhighAfter: prober subagent labeled low

Made by Claude Opus 5.5 (1M context) in Claude Code.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Subagent progress updates now reflect the effort level reported during execution. When a subagent’s effort differs from the session’s initial setting, its subsequent progress event shows the updated level, providing a more accurate view of how the task is proceeding.
    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    2. Approvability

      Verdict: Approved at 1c4d1c1

      Macroscope's review found this PR approvable — This is a narrowly scoped server bug fix that corrects subagent effort labels using SDK hook data without changing execution, permissions, defaults, schemas, or workflows. A focused adapter test covers the refinement from the seeded effort to the reported effort.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).

Sign in to join this conversation.