openclaw - 💡(How to fix) Fix Bug: Model fallback not triggered in isolated cron sessions

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…

Root Cause

Root Cause Analysis: In pi-embedded-runner/run/failover-policy.ts, resolveRunFailoverDecision checks params.fallbackConfigured. In isolated sessions, this evaluates to false even though the agent has fallbacks configured.

Fix Action

Fix / Workaround

Workaround: Change sessionTarget from "isolated" to "session:agent:xiaxia:main" — fallback then works.

Code Example

{
  "id": "xiaxia",
  "model": {
    "primary": "volcengine-plan/ark-code-latest",
    "fallbacks": ["deepseek/deepseek-v4-flash", "deepseek/deepseek-v4-pro"]
  }
}

---

# Isolated cron session — fallback NOT triggered
07:10:00 [agent/embedded] embedded run failover decision:
  decision=surface_error reason=timeout from=volcengine-plan/ark-code-latest

# Main session — fallback WORKS correctly
02:32:17 [agent/embedded] embedded run failover decision:
  decision=fallback_model reason=timeout from=deepseek/deepseek-v4-pro
RAW_BUFFERClick to expand / collapse

Bug: Model fallback not triggered in isolated cron sessions

Affected Version: OpenClaw 2026.5.5

Reproduction:

  1. Configure an agent with model fallbacks:
{
  "id": "xiaxia",
  "model": {
    "primary": "volcengine-plan/ark-code-latest",
    "fallbacks": ["deepseek/deepseek-v4-flash", "deepseek/deepseek-v4-pro"]
  }
}
  1. Create a recurring cron job with sessionTarget: "isolated" and agentId: "xiaxia"
  2. When the primary model fails (timeout/overload), fallback is NOT triggered

Expected: Failover should try fallback models. Actual: embedded run failover decision: decision=surface_error — no fallback attempt.

Root Cause Analysis: In pi-embedded-runner/run/failover-policy.ts, resolveRunFailoverDecision checks params.fallbackConfigured. In isolated sessions, this evaluates to false even though the agent has fallbacks configured.

The hasConfiguredModelFallbacks() function calls resolveRunModelFallbacksOverride()resolveAgentModelFallbacksOverride(cfg, agentId). The resolveCronAgent function properly merges agent config at the cron level, but by the time the pi-embedded-runner evaluates fallbackConfigured during failover, the fallback config has been lost.

Log evidence:

# Isolated cron session — fallback NOT triggered
07:10:00 [agent/embedded] embedded run failover decision:
  decision=surface_error reason=timeout from=volcengine-plan/ark-code-latest

# Main session — fallback WORKS correctly
02:32:17 [agent/embedded] embedded run failover decision:
  decision=fallback_model reason=timeout from=deepseek/deepseek-v4-pro

Impact: Recurring cron tasks on isolated sessions silently fail without trying configured fallback models.

Workaround: Change sessionTarget from "isolated" to "session:agent:xiaxia:main" — fallback then works.

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 Bug: Model fallback not triggered in isolated cron sessions