Problem
AWS Bedrock models return a specific error message when daily token limits are exceeded:
This error is not recognized by OpenClaw as a rate-limit condition, causing the primary model to keep failing without properly triggering fallback.
Root Cause
The rate limit detection regex in OpenClaw only matches:
/(rate[_ ]limit|too many requests|429|resource has been exhausted|cloudflare)/i
Missing patterns:
too many tokens per day (AWS Bedrock specific)
tokens per day
quota exceeded (some providers)
Impact
- Primary model keeps failing repeatedly
- Fallback chain doesn't trigger properly
- System appears "stuck" trying the same broken model
- No circuit breaker for repeated failures
Suggested Fix
Add missing patterns to the rate limit detection:
// gateway-cli-CuFEx2ht.js (line ~5780)
rate_limit: /(rate[_ ]limit|too many requests|429|resource has been exhausted|cloudflare|too many tokens|tokens per day)/i,
// api-key-rotation-5wHpygo9.js
if (lower.includes("too many tokens")) return true;
if (lower.includes("tokens per day")) return true;
Workaround Applied (local)
We've patched the compiled files locally:
- Added
too many tokens and tokens per day to the regex
- Gateway restarted successfully
Environment
- OpenClaw version: 2026.3.2
- Platform: Ubuntu 22.04
- Node.js: v25.8.0
Thank you for considering this fix! 🦞
Problem
AWS Bedrock models return a specific error message when daily token limits are exceeded:
This error is not recognized by OpenClaw as a rate-limit condition, causing the primary model to keep failing without properly triggering fallback.
Root Cause
The rate limit detection regex in OpenClaw only matches:
/(rate[_ ]limit|too many requests|429|resource has been exhausted|cloudflare)/iMissing patterns:
too many tokens per day(AWS Bedrock specific)tokens per dayquota exceeded(some providers)Impact
Suggested Fix
Add missing patterns to the rate limit detection:
Workaround Applied (local)
We've patched the compiled files locally:
too many tokensandtokens per dayto the regexEnvironment
Thank you for considering this fix! 🦞