Skip to content

[Bug]: Model fallback stops after 2 models instead of trying all configured fallbacks #25926

@Yoongger

Description

@Yoongger

Summary

Bug Description

When the default model and first fallback provider both hit rate_limit cooldown, the fallback logic stops after trying only 2 models instead of continuing through all 17 configured fallback models.

Environment

  • OpenClaw version: 2026.2.23
  • Node: v22.22.0
  • OS: Ubuntu 24.04

Configuration

{
“agents.defaults.model”: {
"primary": "qwen-portal/coder-model",
"fallbacks": [
"opencode/glm-5-free",
"opencode/kimi-k2.5-free",
"opencode/minimax-m2.5-free",
"opencode/gpt-5-nano",
"nvidia-nim/z-ai/glm5",
"nvidia-nim/qwen/qwen3.5-397b-a17b",
"nvidia-nim/moonshotai/kimi-k2.5",
"nvidia-nim/minimaxai/minimax-m2.1",
"nvidia-nim/z-ai/glm4.7",
"xfyun/xopglm47blth2",
"xfyun/xopglmv47flash",
"xfyun/xopglm5",
"xfyun/xopkimik25",
"xfyun/xminimaxm2",
"xfyun/MiniMax-M2.5",
"qwen-portal/vision-model"
]
}
}

Steps to Reproduce

  1. Configure 17 fallback models across multiple providers (qwen-portal, opencode, nvidia-nim, xfyun)
  2. Wait for qwen-portal and opencode to hit rate_limit cooldown
  3. Send a message to trigger model fallback ## Expected Behavior System should skip cooled-down providers and continue trying remaining fallback models (nvidia-nim, xfyun).

Actual Behavior

Error after trying only 2 models:
All models failed (2): opencode/glm-5-free: Provider opencode is in cooldown | qwen-portal/coder-model: Provider qwen-portal is in cooldownThe fallback logic does NOT continue to nvidia-nim or xfyun models.

Logs

All models failed (2): opencode/glm-5-free: Provider opencode is in cooldown (all profiles unavailable) (rate_limit) | qwen-portal/coder-model: Provider qwen-portal is in cooldown (all profiles unavailable) (rate_limit)

Impact

Users experience extended downtime (30-60 minutes) waiting for cooldown to expire, even though other providers (nvidia-nim, xfyun) are available and healthy.

Suggested

Fix The fallback logic should:

  1. Skip providers that are in cooldown state
  2. Continue through the entire fallbacks list until finding a working model
  3. Only fail after all fallbacks have been exhausted

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions