Version
2026.6.5 (build 5181e4f), reproduced on macOS and Linux.
Summary
A subagent model configured via agents.defaults.subagents.model.primary is resolved correctly at spawn time, but discarded before the child run starts. The child silently runs on agents.defaults.model.primary instead. Depending on that default this either hard-fails the spawn (pre-flight thinking validation) or silently runs every delegation on the wrong (potentially much more expensive) model.
Reproduction
- Configure e.g.:
"agents": { "defaults": {
"model": { "primary": "some-openai-compat/model-without-thinking" },
"subagents": { "model": { "primary": "minimax/MiniMax-M2.5" }, "thinking": "low" }
}}
- Have the agent call
sessions_spawn without an explicit model param.
sessions_spawn returns resolvedModel: "minimax/MiniMax-M2.5", modelApplied: true — but the child fails pre-flight with Thinking level "low" is not supported for <agent-default-model>. Use one of: off. — runtime 0s, 0 tokens. The configured subagent model (and its fallbacks) is never attempted.
If the agent-default model does support the configured thinking level, there is no error at all: every delegation silently runs on the agent default instead of the configured subagent model (in our case Sonnet instead of MiniMax — a pure cost leak).
Root cause (dist trace, 2026.6.5)
subagent-spawn-plan-*.js — resolveSubagentModelAndThinkingPlan builds initialSessionPatch with modelOverrideSource: params.modelOverride?.trim() ? "user" : "auto". A config-driven choice therefore gets labeled "auto", with no modelOverrideFallbackOriginProvider/Model set.
agent-scope-*.js — hasLegacyAutoFallbackWithoutOrigin(entry) returns true for modelOverrideSource === "auto" without origin fields. That was meant to clean up stale auto-fallback leftovers, but every fresh spawn patch matches by construction.
agent-command-*.js — storedModelOverride = hasLegacyAutoFallbackOverrideWithoutOrigin ? void 0 : sessionEntry?.modelOverride?.trim() → the configured override is dropped; the child resolves to the agent default. The session's thinkingLevel (from subagents.thinking) still counts as an explicit override, so unsupported levels throw instead of downgrading.
Suggested fix
Either have the spawn plan set user-equivalent provenance (or the origin fields) for config-driven subagent model choices, or exclude fresh spawn patches from the legacy-auto-fallback cleanup heuristic.
Workaround
Passing an explicit model on every sessions_spawn call (→ modelOverrideSource: "user") survives the heuristic; or set subagents.thinking: "off" to at least make the spawn succeed on the (wrong) default model.
Version
2026.6.5 (build 5181e4f), reproduced on macOS and Linux.
Summary
A subagent model configured via
agents.defaults.subagents.model.primaryis resolved correctly at spawn time, but discarded before the child run starts. The child silently runs onagents.defaults.model.primaryinstead. Depending on that default this either hard-fails the spawn (pre-flight thinking validation) or silently runs every delegation on the wrong (potentially much more expensive) model.Reproduction
sessions_spawnwithout an explicitmodelparam.sessions_spawnreturnsresolvedModel: "minimax/MiniMax-M2.5", modelApplied: true— but the child fails pre-flight withThinking level "low" is not supported for <agent-default-model>. Use one of: off.— runtime 0s, 0 tokens. The configured subagent model (and its fallbacks) is never attempted.If the agent-default model does support the configured thinking level, there is no error at all: every delegation silently runs on the agent default instead of the configured subagent model (in our case Sonnet instead of MiniMax — a pure cost leak).
Root cause (dist trace, 2026.6.5)
subagent-spawn-plan-*.js—resolveSubagentModelAndThinkingPlanbuildsinitialSessionPatchwithmodelOverrideSource: params.modelOverride?.trim() ? "user" : "auto". A config-driven choice therefore gets labeled"auto", with nomodelOverrideFallbackOriginProvider/Modelset.agent-scope-*.js—hasLegacyAutoFallbackWithoutOrigin(entry)returns true formodelOverrideSource === "auto"without origin fields. That was meant to clean up stale auto-fallback leftovers, but every fresh spawn patch matches by construction.agent-command-*.js—storedModelOverride = hasLegacyAutoFallbackOverrideWithoutOrigin ? void 0 : sessionEntry?.modelOverride?.trim()→ the configured override is dropped; the child resolves to the agent default. The session'sthinkingLevel(fromsubagents.thinking) still counts as an explicit override, so unsupported levels throw instead of downgrading.Suggested fix
Either have the spawn plan set user-equivalent provenance (or the origin fields) for config-driven subagent model choices, or exclude fresh spawn patches from the legacy-auto-fallback cleanup heuristic.
Workaround
Passing an explicit
modelon everysessions_spawncall (→modelOverrideSource: "user") survives the heuristic; or setsubagents.thinking: "off"to at least make the spawn succeed on the (wrong) default model.