Skip to content

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

Closed
DiegoJohnsonL wants to merge 1 commit into
pingdotgg:mainfrom
d3labs-dev:fix/claude-subagent-effort-label
Closed

DiegoJohnsonL wants to merge 1 commit into
pingdotgg:mainfrom
d3labs-dev:fix/claude-subagent-effort-label

Conversation

@DiegoJohnsonL

@DiegoJohnsonL DiegoJohnsonL commented Sep 24, 2026 •

Copy link
Copy Markdown

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 · xhigh After: opus-5-5 · low
Before: prober subagent labeled xhigh After: 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.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Sep 24, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

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.

@DiegoJohnsonL
DiegoJohnsonL force-pushed the fix/claude-subagent-effort-label branch from 1c4d1c1 to e066bb0 Compare September 24, 2026 01:11
@DiegoJohnsonL DiegoJohnsonL changed the title fix(server): 🐛 subagent effort label shows the level it actually runs at fix(claude): show the effort a subagent actually runs at Sep 24, 2026
A subagent whose agent definition sets its own effort was labeled with
the thread's effort. task_started carries no effort, so the adapter
seeded the label from the session selection and never corrected it.

The SDK reports a subagent's applied effort only on hooks fired inside
it. Register PreToolUse and SubagentStop hooks and refine the task's
effort from them, the way assistant snapshots already refine its model.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@DiegoJohnsonL
DiegoJohnsonL force-pushed the fix/claude-subagent-effort-label branch from e066bb0 to 347e092 Compare September 24, 2026 01:19
@DiegoJohnsonL DiegoJohnsonL changed the title fix(claude): show the effort a subagent actually runs at fix(claude): 🐛 show the effort a subagent actually runs at Sep 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant