openclaw - 💡(How to fix) Fix LiveSessionModelSwitchError in isolated cron jobs (v2026.3.28) [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#58542Fetched 2026-04-08 02:01:17
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Timeline (top)
closed ×1commented ×1cross-referenced ×1locked ×1

~25 of 33 cron jobs are failing with LiveSessionModelSwitchError: Live session model switch requested: anthropic/claude-opus-4-6.

All jobs are configured with sessionTarget: isolated and have a model override (e.g. google/gemini-2.0-flash or google/gemini-2.5-flash). The default agent model is anthropic/claude-opus-4-6.

Root Cause

~25 of 33 cron jobs are failing with LiveSessionModelSwitchError: Live session model switch requested: anthropic/claude-opus-4-6.

All jobs are configured with sessionTarget: isolated and have a model override (e.g. google/gemini-2.0-flash or google/gemini-2.5-flash). The default agent model is anthropic/claude-opus-4-6.

Fix Action

Fix / Workaround

Workaround Attempted

  • lightContext: true — no effect
  • Gateway restart — fixes some jobs temporarily, others still fail
  • openclaw doctor --fix — no effect

Code Example

33 cron jobs, ~7 working, ~26 failing
Default model: anthropic/claude-opus-4-6
Cron job models: google/gemini-2.0-flash, google/gemini-2.5-flash
All sessionTarget: isolated
RAW_BUFFERClick to expand / collapse

Bug Report

Version: OpenClaw 2026.3.28 (f9b1079) OS: macOS Darwin 25.2.0 (arm64)

Description

~25 of 33 cron jobs are failing with LiveSessionModelSwitchError: Live session model switch requested: anthropic/claude-opus-4-6.

All jobs are configured with sessionTarget: isolated and have a model override (e.g. google/gemini-2.0-flash or google/gemini-2.5-flash). The default agent model is anthropic/claude-opus-4-6.

Expected Behavior

Isolated cron sessions should use the model specified in payload.model directly, without triggering a model switch from the default.

Actual Behavior

The session bootstraps with the default model (anthropic/claude-opus-4-6), then the cron payload model triggers a LiveSessionModelSwitchError. This is intermittent — some jobs with the same config work fine, others fail consistently.

Reproduction

  1. Set agents.defaults.model.primary to a different provider than cron jobs (e.g. anthropic)
  2. Create isolated cron job with payload.model set to a Google model
  3. Job fails with LiveSessionModelSwitchError

Workaround Attempted

  • lightContext: true — no effect
  • Gateway restart — fixes some jobs temporarily, others still fail
  • openclaw doctor --fix — no effect

Related

Possibly related to PR #47592 'Cron: honor isolated agentTurn payload.model override' — the fix may not fully cover this case.

Environment

33 cron jobs, ~7 working, ~26 failing
Default model: anthropic/claude-opus-4-6
Cron job models: google/gemini-2.0-flash, google/gemini-2.5-flash
All sessionTarget: isolated

extent analysis

TL;DR

The most likely fix involves ensuring that the payload.model override is correctly honored for isolated cron sessions, potentially by revisiting the implementation of PR #47592.

Guidance

  • Review the code changes made in PR #47592 to ensure that the fix correctly handles the sessionTarget: isolated configuration and the payload.model override.
  • Verify that the agents.defaults.model.primary setting is not interfering with the cron job's ability to use the specified model.
  • Test the cron jobs with different model overrides to see if the issue is specific to certain models or providers.
  • Consider adding additional logging or debugging statements to understand why some jobs work fine while others fail consistently.

Example

No code snippet is provided as the issue does not contain enough information to create a specific example.

Notes

The intermittent nature of the issue and the fact that some jobs work fine while others fail consistently suggest that there may be a timing or synchronization issue at play. The fix may require a deeper understanding of the underlying system and the interactions between the cron jobs, the agent models, and the session management.

Recommendation

Apply workaround: Revisit and refine the implementation of PR #47592 to ensure that isolated cron sessions correctly use the specified model override, as this is likely to address the root cause of the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix LiveSessionModelSwitchError in isolated cron jobs (v2026.3.28) [1 comments, 2 participants]