openclaw - 💡(How to fix) Fix Heartbeat agent ignores its own fallback chain, uses agents.defaults.model.fallbacks instead [1 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#62017Fetched 2026-04-08 03:10:16
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Author
Participants

Error Message

[model-fallback] model fallback decision: decision=candidate_failed requested=mistral/mistral-large-latest candidate=mistral/mistral-large-latest reason=auth next=zai/glm-5

Note: zai/glm-5 is NOT in the heartbeat's configured fallback chain - it comes from agents.defaults.model.fallbacks.

Code Example

{
  "id": "heartbeat",
  "model": {
    "primary": "mistral/mistral-large-latest",
    "fallbacks": [
      "openrouter/openrouter/free",
      "zai/glm-4.7",
      "codestral/codestral-latest",
      "groq/openai/gpt-oss-120b"
    ]
  }
}

---

[model-fallback] model fallback decision: decision=candidate_failed requested=mistral/mistral-large-latest candidate=mistral/mistral-large-latest reason=auth next=zai/glm-5
RAW_BUFFERClick to expand / collapse

Bug Description

The heartbeat agent does not use the fallback chain defined in agents.list[].model.fallbacks. Instead, it falls back to agents.defaults.model.fallbacks when the primary model fails.

Steps to Reproduce

  1. Configure a heartbeat agent with a custom fallback chain in agents.list:
{
  "id": "heartbeat",
  "model": {
    "primary": "mistral/mistral-large-latest",
    "fallbacks": [
      "openrouter/openrouter/free",
      "zai/glm-4.7",
      "codestral/codestral-latest",
      "groq/openai/gpt-oss-120b"
    ]
  }
}
  1. Observe that when the primary model fails, the heartbeat uses agents.defaults.model.fallbacks instead.

Expected Behavior

The heartbeat agent should use its own configured fallback chain from agents.list[heartbeat].model.fallbacks.

Actual Behavior

The heartbeat falls back to agents.defaults.model.fallbacks which has a different fallback order.

Logs

[model-fallback] model fallback decision: decision=candidate_failed requested=mistral/mistral-large-latest candidate=mistral/mistral-large-latest reason=auth next=zai/glm-5

Note: zai/glm-5 is NOT in the heartbeat's configured fallback chain - it comes from agents.defaults.model.fallbacks.

Environment

  • OpenClaw version: 2026.4.5
  • Node version: 22.22.0

Suggested Fix

The heartbeat runner should pass the agent-specific fallback chain via fallbacksOverride to runWithModelFallback, or the model selection logic should use the agent's configured fallbacks instead of the global defaults.

extent analysis

TL;DR

The heartbeat agent can be fixed by passing the agent-specific fallback chain via fallbacksOverride to runWithModelFallback or by modifying the model selection logic to use the agent's configured fallbacks.

Guidance

  • Verify that the fallbacksOverride parameter is not being passed to runWithModelFallback in the current implementation.
  • Check the model selection logic to see if it is using the global defaults (agents.defaults.model.fallbacks) instead of the agent's configured fallbacks (agents.list[].model.fallbacks).
  • Update the heartbeat runner to pass the agent-specific fallback chain via fallbacksOverride to runWithModelFallback.
  • Consider modifying the model selection logic to prioritize the agent's configured fallbacks over the global defaults.

Example

// Example of passing agent-specific fallback chain via fallbacksOverride
{
  "id": "heartbeat",
  "model": {
    "primary": "mistral/mistral-large-latest",
    "fallbacks": [
      "openrouter/openrouter/free",
      "zai/glm-4.7",
      "codestral/codestral-latest",
      "groq/openai/gpt-oss-120b"
    ]
  }
}

// In the heartbeat runner code
runWithModelFallback({
  // ...
  fallbacksOverride: agent.model.fallbacks
})

Notes

The exact implementation details may vary depending on the specific codebase and requirements. It is essential to review the code and test the changes thoroughly to ensure the fix works as expected.

Recommendation

Apply workaround by passing the agent-specific fallback chain via fallbacksOverride to runWithModelFallback, as this approach is more targeted and less likely to introduce unintended side effects.

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