Explicit subagent model pin is lost when a background agent is woken or resumed — agent continues on the session model
A background subagent launched with an explicit model pin (for example model: "sonnet" on the Agent tool) runs the pinned model on its initial turn. But any continuation — either a task-notification wake when its own background work finishes, or a SendMessage resume — re-resolves the model to the session model instead of the pin. On a session whose main loop runs claude-fable-5, the pinned agent silently continues on Fable.
Verified with a controlled probe on v2.1.201 (July 6, 2026): the same agent transcript shows claude-sonnet-5 on the launch turn and claude-fable-5 on the woken turn. In one earlier incident (July 4), 8 of 8 sonnet-pinned background agents flipped this way in a single night (~470 unintended Fable turns).
CLAUDE_CODE_SUBAGENT_MODEL cannot mitigate this without also overriding all explicit per-launch pins, since a hard value there takes precedence over them (docs: sub-agents → model selection).
Expected: a model pin holds for the agent's whole lifetime, including wakes and resumes.
Impact: silent frontier-model consumption against subscription limits, contrary to explicit configuration. Deterministic repro steps and transcript excerpts available on request.
Environment: Claude Code v2.1.201, macOS (also observed on Linux), Max subscription, main loop on claude-fable-5[1m].
3 Comments
This looks like a model-authority continuity bug, not only a routing preference.
For an explicitly pinned background agent, I would expect the model decision to be represented as durable authority for that delegated run:
The fail-closed cases matter as much as the happy path:
That gives a concrete regression boundary: delegated work can continue only when the effective model still matches the model authority the user granted for that agent or workflow stage.
Boundary: architecture and regression-test feedback only; no claim about running Claude Code, implementation correctness, Anthropic alignment, adoption, integration, customer interest, official alignment, or Neura usage.
Reproduced on v2.1.206 (macOS, darwin/arm64), with one detail that may widen the scope: the pin was dropped by a parent-session resume while the background agent was still mid-task, with no SendMessage and no wake-from-child-completion involved.
Setup: session main model
claude-fable-5, background subagent launched via the Agent tool withmodel: "opus"(subagent_type: "general-purpose",run_in_background: true).Observed, from the task's transcript JSONL (ordered
"model"stamps on assistant messages):The flip aligns exactly with a
SessionStart:resumeevent in the parent session; the agent itself was never messaged. It continued executing the same task, silently, on the session model until we noticed and killed it.Two implications consistent with this report:
grep -o '"model":"[^"]*"' <task output file> | sort | uniq -crun after the resume.Workaround we've adopted: treat every pinned background agent as suspect after any session resume (re-grep, kill and respawn on flip), and never resume a pinned agent for work that must stay on the pinned model.
Still reproduces on v2.1.207 (build 2026-07-10), macOS 15 / Darwin 25.5.0, Max subscription, main loop on
claude-fable-5— observed in an organic session, not a probe:general-purposesubagent was launched via the Agent tool with an explicitmodel: "sonnet"pin. Its transcript shows 14 assistant turns onclaude-sonnet-5(first at2026-07-11T16:06:42Z).[SYSTEM NOTIFICATION - NOT USER INPUT] This is an automated background-task event…in its transcript), every subsequent turn — 23 of them, first at2026-07-11T16:12:49Z— ran onclaude-fable-5.subagents/agent-*.jsonl), so this is a mid-lifetime re-resolution on the wake boundary, not a new agent inheriting the session model.Matches the reported mechanism exactly: the pin holds for the initial run and is lost on the wake/resume re-resolution.