You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Regression v2026.3.28: LiveSessionModelSwitchError when spawning subagent with different model than parent #58305
After upgrading from v2026.3.23-2 to v2026.3.28, spawning a subagent with a different model than the parent session fails with LiveSessionModelSwitchError: Live session model switch requested: <model>.
Steps to Reproduce
Parent session running on anthropic/claude-sonnet-4-6
Call sessions_spawn with agentId: "marketing" and model: "google/gemini-2.5-pro"
Error fires immediately at spawn time (runtime ~1s, 0 tokens consumed)
Expected Behavior
Subagent should start on google/gemini-2.5-pro as requested. This worked correctly in v2026.3.23-2.
Actual Behavior
LiveSessionModelSwitchError: Live session model switch requested: google/gemini-2.5-pro
Variants Tried
Passing model explicitly in sessions_spawn
Setting model.primary on the agent in agents.list
Removing model.primary from agent config and passing at spawn time
Multi-agent setups where different agents run on different models are completely broken. Specifically, any agent configured with a non-default model cannot be used as a subagent from a parent running on a different model.
Suspected Cause
The v2026.3.28 changelog mentions moving bundled CLI inference defaults onto the plugin surface and changes to model inference routing. This likely tightened live session model switching in a way that inadvertently blocks legitimate subagent model overrides.
Workaround
None found. Running all subagents on the parent session's model (Sonnet) as a temporary workaround.
Current main already implements the reported fix. Subagent spawns now persist the child session's runtime model before the child run starts, regression coverage asserts that ordering, and the changelog records the LiveSessionModelSwitchError fix in the 2026.3.31 release notes.
What I checked:
Current spawn path persists child runtime model before launch:persistInitialChildSessionRuntimeModel writes model/modelProvider into the child session store, and spawnSubagentDirect calls it before the agent gateway start. (src/agents/subagent-spawn.ts:204, 0783090da009)
Regression test covers the exact ordering: Test asserts sessions.patch happens first, then session-store runtime-model persistence, then agent launch, for a child spawned with an explicit different model. (src/agents/subagent-spawn.model-session.test.ts:48, 0783090da009)
Model-selection coverage still supports per-agent subagent models differing from the parent: Tests verify agents.list[].subagents.model wins over the agent primary model, matching the reported cross-model parent/child configuration. (src/agents/model-selection.test.ts:1440, 90877e0d4274)
User-facing docs still describe distinct subagent model overrides: Docs say subagents can use agents.defaults.subagents.model, per-agent agents.list[].subagents.model, or explicit sessions_spawn.model overrides. Public docs: docs/tools/subagents.md. (docs/tools/subagents.md:72, 90877e0d4274)
Release notes record this exact bug class as fixed: The 2026.3.31 changelog says transient cron and subagent model overrides no longer get misread as persisted live-session switches, avoiding LiveSessionModelSwitchError in isolated runs. (CHANGELOG.md:1900, 90877e0d4274)
So I’m closing this as already implemented rather than keeping a duplicate issue open.
Activity
danielsan1 commentedon Mar 31, 2026
Same here! I’m downgrading now to .24 as my cron jobs are burning my token as it constantly switches basic Haiku jobs to Opus - not usable.
goncalovelosa commentedon Mar 31, 2026
#57972
steipete commentedon Apr 25, 2026
Closing this as implemented after Codex review.
Current main already implements the reported fix. Subagent spawns now persist the child session's runtime model before the child run starts, regression coverage asserts that ordering, and the changelog records the
LiveSessionModelSwitchErrorfix in the 2026.3.31 release notes.What I checked:
persistInitialChildSessionRuntimeModelwritesmodel/modelProviderinto the child session store, andspawnSubagentDirectcalls it before theagentgateway start. (src/agents/subagent-spawn.ts:204, 0783090da009)sessions.patchhappens first, then session-store runtime-model persistence, thenagentlaunch, for a child spawned with an explicit different model. (src/agents/subagent-spawn.model-session.test.ts:48, 0783090da009)agents.list[].subagents.modelwins over the agent primary model, matching the reported cross-model parent/child configuration. (src/agents/model-selection.test.ts:1440, 90877e0d4274)agents.defaults.subagents.model, per-agentagents.list[].subagents.model, or explicitsessions_spawn.modeloverrides. Public docs:docs/tools/subagents.md. (docs/tools/subagents.md:72, 90877e0d4274)LiveSessionModelSwitchErrorin isolated runs. (CHANGELOG.md:1900, 90877e0d4274)So I’m closing this as already implemented rather than keeping a duplicate issue open.
Review notes: reviewed against 90877e0d4274; fix evidence: release 2026.3.31, commit 0783090da009.