Agent tool: spawn-time `model` override is silently lost when a background agent is resumed via SendMessage
Version: 2.1.202 (Claude Code CLI, Linux)
Summary: A background agent spawned with a model override (e.g. model: haiku or model: sonnet from a session running a larger model) loses that override when it is continued via SendMessage after stopping/completing. The resumed turns run on the session model instead of the spawn-time override, with no warning. The agent's own transcript shows the per-turn message.model field flipping mid-file.
Steps to reproduce:
- Run a session on model A (in our case
claude-fable-5). - Spawn a background agent with the Agent tool and an explicit override to a cheaper model B (e.g.
model: "sonnet"or"haiku"). Verify from the agent transcript that its assistant turns stamp model B. - Let the agent stop (complete its task) — or stop it.
- Continue it with
SendMessageto its agent id. - Inspect the transcript: every turn after the resume stamps model A (the session model), not model B.
Expected: spawn-time options (model, and presumably effort/agent-type settings) are persisted in the task state and re-applied on every resume — or at minimum the resume warns that the override will not carry.
Actual: the override is dropped silently. We observed three instances in one day, including two where >85% and ~36% of an agent's total output tokens ran on the wrong (more expensive) tier. In one case the model id changed mid-transcript with no gap marker at all; in another it flipped across a <synthetic> marker.
Impact: any orchestration pattern that routes work across model tiers for cost or policy reasons cannot trust resume — teams either respawn fresh (losing the agent's accumulated context) or eat silent cost inflation. It also corrupts per-model cost attribution, since a transcript's work is split across tiers invisibly unless you diff message.model per turn.
Workarounds we use: (1) respawn fresh instead of resuming down-tier agents; (2) a PreToolUse hook that blocks SendMessage to agents whose first-turn model differs from the session model unless explicitly acknowledged; (3) a post-hoc transcript audit that flags mixed-model files. All three would be unnecessary if the override persisted.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗