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
[Bug]: LiveSessionModelSwitchError defeats fallback chain during provider outages #58347
When the primary model (e.g. Anthropic opus) is down and the fallback chain reaches a non-Anthropic last-resort model (e.g. z-ai/glm-5-turbo), the gateway fires LiveSessionModelSwitchError to switch back to the primary — which is still down. This creates a death loop where the last-resort fallback never gets to execute.
Steps to reproduce
live session model switch detected: openrouter/z-ai/glm-5-turbo -> anthropic/claude-opus-4-6 fires every time z-ai is reached. The authProfileOverride is also re-persisted to sessions.json after each fallback, making manual clearing temporary.
Expected behavior
live model switch should be suppressed when falling back during an outage. Version: 2026.3.28 (f9b1079).
Actual behavior
When the primary model (e.g. Anthropic opus) is down and the fallback chain reaches a non-Anthropic last-resort model (e.g. z-ai/glm-5-turbo), the gateway fires LiveSessionModelSwitchError to switch back to the primary — which is still down. This creates a death loop where the last-resort fallback never gets to execute.
Reproducing this exact issue — LiveSessionModelSwitchError blocking fallback on rate limit
Environment: OpenClaw 2026.3.28, macOS, default model gpt-5.4 with fallback to claude-opus-4-6
What happened:
gpt-5.4 hit ChatGPT team plan rate limit (HTTP 429, ~75h cooldown)
Fallback chain attempted claude-opus-4-6 as next candidate
LiveSessionModelSwitchError rejected the Claude candidate with: "Live session model switch requested: openai-codex/gpt-5.4"
Fallback cycled back to gpt-5.4 → 429 again → infinite loop
WhatsApp session became completely unresponsive until manual model override
Log pattern (repeating):
model_fallback_decision: candidate_failed (gpt-5.3-codex → claude-opus-4-6)
reason: "Live session model switch requested: openai-codex/gpt-5.4"
model_fallback_decision: candidate_succeeded (gpt-5.4) ← but this is the rate-limited model
Impact: Complete loss of service on WhatsApp channel for hours. Only resolved by manually switching the session model.
Expected: When the rate-limited model triggers a fallback, LiveSessionModelSwitch should not override the fallback chain. The fallback model should be allowed to serve the request.
+1
info agent/embedded {"subsystem":"agent/embedded"} live session model switch detected before attempt for fc95b21e-7946-42e9-bb44-a73f4734fae7: openai-codex/gpt-5.4 -> anthropic/claude-sonnet-4-6
I also re-ran the live Z.AI fallback repro after that fix: the primary provider was forced to fail auth, the fallback switched to zai/glm-4.7, and the second leg succeeded instead of getting trapped in a live-switch loop.
I am seeing this issue with local models.
I set gemma4:26b as primary....
gateway starts
fallback to another local model and loops...
than cannot message anymore
Activity
g00dluck commentedon Mar 31, 2026
Reproducing this exact issue — LiveSessionModelSwitchError blocking fallback on rate limit
Environment: OpenClaw 2026.3.28, macOS, default model
gpt-5.4with fallback toclaude-opus-4-6What happened:
gpt-5.4hit ChatGPT team plan rate limit (HTTP 429, ~75h cooldown)claude-opus-4-6as next candidateLiveSessionModelSwitchErrorrejected the Claude candidate with:"Live session model switch requested: openai-codex/gpt-5.4"gpt-5.4→ 429 again → infinite loopLog pattern (repeating):
Impact: Complete loss of service on WhatsApp channel for hours. Only resolved by manually switching the session model.
Expected: When the rate-limited model triggers a fallback,
LiveSessionModelSwitchshould not override the fallback chain. The fallback model should be allowed to serve the request.jsompis commentedon Mar 31, 2026
+1
info agent/embedded {"subsystem":"agent/embedded"} live session model switch detected before attempt for fc95b21e-7946-42e9-bb44-a73f4734fae7: openai-codex/gpt-5.4 -> anthropic/claude-sonnet-4-6
steipete commentedon Apr 4, 2026
Covered by #60266 on current main.
I also re-ran the live Z.AI fallback repro after that fix: the primary provider was forced to fail auth, the fallback switched to
zai/glm-4.7, and the second leg succeeded instead of getting trapped in a live-switch loop.Relevant regression coverage is in:
src/agents/live-model-switch.test.tssrc/cron/isolated-agent/run.live-session-model-switch.test.tssrc/agents/model-fallback.test.tssrc/auto-reply/reply/agent-runner-execution.test.tsClosing as completed.
xeonai44 commentedon Apr 4, 2026
I am seeing this issue with local models.
I set gemma4:26b as primary....
gateway starts
fallback to another local model and loops...
than cannot message anymore