Description
Isolated cron jobs with a model override fail with LiveSessionModelSwitchError when the cron model differs from the gateway's default agent model.
Environment
- OpenClaw version: 2026.3.28 (f9b1079)
- OS: macOS (Darwin 25.4.0 arm64)
- Default model:
anthropic/claude-opus-4-6
Steps to reproduce
- Set gateway default model to
anthropic/claude-opus-4-6 in agents.defaults.model.primary
- Create an isolated cron job with a different model:
openclaw cron add --name "test" --cron "0 * * * *" --session isolated --message "Hello" --model anthropic/claude-sonnet-4-6
- Run the job:
openclaw cron run <id>
- Check runs:
openclaw cron runs --id <id> --limit 1
Expected behavior
The isolated cron session should start with the model specified in the cron job payload (anthropic/claude-sonnet-4-6), since it's a fresh isolated session with no prior conversation.
Actual behavior
The isolated session initializes with the default agent model (anthropic/claude-opus-4-6), then the cron payload model override triggers a LiveSessionModelSwitchError:
LiveSessionModelSwitchError: Live session model switch requested: anthropic/claude-opus-4-6
The error message references the default model, suggesting the session is initialized with one model and then the cron system tries to apply the override as a model switch (which is blocked).
Workaround
Set the cron job model to match the gateway default model. This defeats the purpose of the model override feature for cost optimization on routine cron tasks.
Additional context
- This affects all isolated cron jobs, including those with
--light-context
- Jobs that previously worked with
model=sonnet before the 2026.3.28 update now fail
sessionTarget: main + systemEvent payload jobs are unaffected (they don't set a model)
Description
Isolated cron jobs with a
modeloverride fail withLiveSessionModelSwitchErrorwhen the cron model differs from the gateway's default agent model.Environment
anthropic/claude-opus-4-6Steps to reproduce
anthropic/claude-opus-4-6inagents.defaults.model.primaryopenclaw cron run <id>openclaw cron runs --id <id> --limit 1Expected behavior
The isolated cron session should start with the model specified in the cron job payload (
anthropic/claude-sonnet-4-6), since it's a fresh isolated session with no prior conversation.Actual behavior
The isolated session initializes with the default agent model (
anthropic/claude-opus-4-6), then the cron payload model override triggers aLiveSessionModelSwitchError:The error message references the default model, suggesting the session is initialized with one model and then the cron system tries to apply the override as a model switch (which is blocked).
Workaround
Set the cron job model to match the gateway default model. This defeats the purpose of the model override feature for cost optimization on routine cron tasks.
Additional context
--light-contextmodel=sonnetbefore the 2026.3.28 update now failsessionTarget: main+systemEventpayload jobs are unaffected (they don't set a model)