openclaw - 💡(How to fix) Fix [Bug]: OpenRouter Retry-After: 60 causes fallback chain to stall before reaching later providers

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…

When OpenRouter returns a 429 with Retry-After: 60, the SDK waits the full 60 seconds before falling through to the next provider in the fallback chain.

Root Cause

The SDK waits the full Retry-After: 60 seconds before falling through to the next provider. Workaround in place: OPENCLAW_SDK_RETRY_MAX_WAIT_SECONDS=10 in service drop-in config mitigates but does not fix the root cause.

Fix Action

Fix / Workaround

The SDK waits the full Retry-After: 60 seconds before falling through to the next provider. Workaround in place: OPENCLAW_SDK_RETRY_MAX_WAIT_SECONDS=10 in service drop-in config mitigates but does not fix the root cause.

Workaround in place: OPENCLAW_SDK_RETRY_MAX_WAIT_SECONDS=10 caps the wait but does not fix root cause. SDK should fall through to next provider when Retry-After exceeds the configured max wait threshold.

RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

When OpenRouter returns a 429 with Retry-After: 60, the SDK waits the full 60 seconds before falling through to the next provider in the fallback chain.

Steps to reproduce

  1. Configure OpenClaw with openrouter/free as primary and paid fallbacks.
  2. Hit OpenRouter rate limit causing a 429 with Retry-After: 60 response.
  3. Observe fallback chain stalls for 60 seconds before reaching next provider.

Expected behavior

The SDK should respect the configured max wait cap and fall through to the next provider in the fallback chain immediately when the Retry-After delay exceeds the threshold, rather than waiting the full duration.

Actual behavior

The SDK waits the full Retry-After: 60 seconds before falling through to the next provider. Workaround in place: OPENCLAW_SDK_RETRY_MAX_WAIT_SECONDS=10 in service drop-in config mitigates but does not fix the root cause.

OpenClaw version

2026.4.21

Operating system

WSL2 / Ubuntu 24.04 / Windows 11 Pro

Install method

npm global

Model

openrouter/openrouter/free

Provider / routing chain

openclaw -> openrouter/free -> openrouter paid fallbacks -> deepseek direct

Additional provider/model setup details

Fallback chain: openrouter/free -> openrouter/meta-llama/llama-3.1-8b-instruct -> openrouter/mistralai/ministral-3b-2512 -> openrouter/deepseek/deepseek-v4-flash -> deepseek/deepseek-v4-flash direct. Config lives in ~/.openclaw/openclaw.json under agents.defaults.model. Retry cap set via OPENCLAW_SDK_RETRY_MAX_WAIT_SECONDS=10 in /root/.config/systemd/user/openclaw-gateway.service.d/retry.conf

Logs, screenshots, and evidence

Impact and severity

Affected: All users with OpenRouter fallback chains Severity: Annoying (delays fallback routing by up to 60 seconds) Frequency: Intermittent - occurs on OpenRouter rate limit hits Consequence: Agent stalls for 60 seconds before reaching next provider, causing slow or failed responses

Additional information

Workaround in place: OPENCLAW_SDK_RETRY_MAX_WAIT_SECONDS=10 caps the wait but does not fix root cause. SDK should fall through to next provider when Retry-After exceeds the configured max wait threshold.

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

The SDK should respect the configured max wait cap and fall through to the next provider in the fallback chain immediately when the Retry-After delay exceeds the threshold, rather than waiting the full duration.

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]: OpenRouter Retry-After: 60 causes fallback chain to stall before reaching later providers