openclaw - 💡(How to fix) Fix rate_limit errors do not trigger model fallback [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#62332Fetched 2026-04-08 03:05:50
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Author
Participants

When the primary model returns a rate_limit error, the fallback chain is not triggered. Only timeout errors currently invoke embedded_run_failover_decisionmodel_fallback_decision.

Error Message

22:51:57  qwen/qwen3.6-plus:free  reason=rate_limit   ← no failover_decision
22:54:21  qwen/qwen3.6-plus:free  reason=rate_limit   ← no failover_decision
22:54:27  qwen/qwen3.6-plus:free  reason=timeout      ← failover_decision fires ✓
23:11:46  qwen/qwen3.6-plus:free  reason=rate_limit   ← no failover_decision
23:12:03  qwen/qwen3.6-plus:free  reason=timeout      ← failover_decision fires ✓
23:12:35  gpt-5.4                 reason=rate_limit   ← no failover_decision

Root Cause

When the primary model returns a rate_limit error, the fallback chain is not triggered. Only timeout errors currently invoke embedded_run_failover_decisionmodel_fallback_decision.

Code Example

22:51:57  qwen/qwen3.6-plus:free  reason=rate_limit   ← no failover_decision
22:54:21  qwen/qwen3.6-plus:free  reason=rate_limit   ← no failover_decision
22:54:27  qwen/qwen3.6-plus:free  reason=timeout      ← failover_decision fires ✓
23:11:46  qwen/qwen3.6-plus:free  reason=rate_limit   ← no failover_decision
23:12:03  qwen/qwen3.6-plus:free  reason=timeout      ← failover_decision fires ✓
23:12:35  gpt-5.4                 reason=rate_limit   ← no failover_decision
RAW_BUFFERClick to expand / collapse

Summary

When the primary model returns a rate_limit error, the fallback chain is not triggered. Only timeout errors currently invoke embedded_run_failover_decisionmodel_fallback_decision.

Observed behavior

22:51:57  qwen/qwen3.6-plus:free  reason=rate_limit   ← no failover_decision
22:54:21  qwen/qwen3.6-plus:free  reason=rate_limit   ← no failover_decision
22:54:27  qwen/qwen3.6-plus:free  reason=timeout      ← failover_decision fires ✓
23:11:46  qwen/qwen3.6-plus:free  reason=rate_limit   ← no failover_decision
23:12:03  qwen/qwen3.6-plus:free  reason=timeout      ← failover_decision fires ✓
23:12:35  gpt-5.4                 reason=rate_limit   ← no failover_decision

Expected behavior

rate_limit should trigger the fallback chain the same way timeout does.

Config

primary: openrouter/qwen/qwen3.6-plus:free, fallbacks: [openai-codex/gpt-5.4]

Impact

During bursts (multi-agent init after gateway restart), primary model gets rate-limited and all requests fail hard with no recovery.

Suggested fix

Include rate_limit in the set of error conditions that trigger embedded_run_failover_decision, alongside timeout.

extent analysis

TL;DR

Modify the error handling to trigger the fallback chain when a rate_limit error occurs, in addition to timeout errors.

Guidance

  • Review the current implementation of embedded_run_failover_decision and model_fallback_decision to understand how timeout errors are handled.
  • Update the condition that triggers embedded_run_failover_decision to include rate_limit errors, ensuring the fallback chain is invoked in such cases.
  • Verify that the fallback chain is correctly triggered by simulating rate_limit errors and checking the system's response.
  • Test the updated implementation to ensure it handles both rate_limit and timeout errors as expected, invoking the fallback chain in both scenarios.

Example

No explicit code example is provided due to the lack of specific implementation details in the issue.

Notes

The suggested fix assumes that the current implementation of embedded_run_failover_decision and model_fallback_decision is correct and only needs to be extended to handle rate_limit errors. The actual implementation may vary based on the programming language, framework, and specific requirements of the system.

Recommendation

Apply the workaround by modifying the error handling to include rate_limit errors, as this directly addresses the observed issue and is a targeted fix.

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…

FAQ

Expected behavior

rate_limit should trigger the fallback chain the same way timeout does.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING