Skip to content

No exponential backoff on 429 rate limit errors #5159

@philsalesses

Description

@philsalesses

Bug: No exponential backoff on 429 rate limit errors

Summary

The documented exponential backoff for LLM provider 429 rate limit errors does not work. The system retries within seconds, hammering the API repeatedly.

Expected Behavior

From /concepts/model-failover.md:

Cooldowns use exponential backoff:

  • 1 minute
  • 5 minutes
  • 25 minutes
  • 1 hour (cap)

Actual Behavior

No backoff at all. Retries happen within seconds:

01:25:28.601Z - HTTP 429 rate_limit_error
01:25:29.580Z - HTTP 429 rate_limit_error (1 second later)
01:25:33.021Z - HTTP 429 rate_limit_error (4 seconds)
01:25:34.080Z - HTTP 429 rate_limit_error (1 second)
01:26:00.498Z - HTTP 429 rate_limit_error (26 seconds)
01:26:27.547Z - HTTP 429 rate_limit_error (27 seconds)
01:26:37.315Z - HTTP 429 rate_limit_error (10 seconds)
01:26:54.436Z - HTTP 429 rate_limit_error (17 seconds)

Environment

  • OpenClaw version: 2026.1.29
  • Provider: Anthropic (claude-opus-4-5)
  • OS: macOS (Darwin 25.0.0, arm64)
  • Node: v22.6.0

Reproduction

  1. Hit Anthropic's rate limit (e.g., by running multiple concurrent sessions with a large context)
  2. Observe logs showing 429 errors with no meaningful backoff
  3. Gateway continues hammering the API

Impact

  • Wastes API quota on failed requests
  • Could trigger stricter rate limiting or account flags
  • Sends repeated error messages to users

Suggested Fix

  1. Actually implement the documented exponential backoff
  2. Parse Retry-After header from 429 responses when available
  3. Add config option: auth.cooldowns.rateLimitBackoffHours (default: 1 hour, allow up to 4+ hours)

Logs

Full log excerpt from /tmp/openclaw/openclaw-2026-01-30.log:

{"0":"HTTP 429 rate_limit_error: This request would exceed your account's rate limit. Please try again later. (request_id: req_011CXeaqfFp7NCGedL23dRZa)","_meta":{"date":"2026-01-31T01:25:28.601Z"}}
{"0":"HTTP 429 rate_limit_error: This request would exceed your account's rate limit. Please try again later. (request_id: req_011CXeaqj9DpgfKfHE7bUdC9)","_meta":{"date":"2026-01-31T01:25:29.580Z"}}
{"0":"HTTP 429 rate_limit_error: This request would exceed your account's rate limit. Please try again later. (request_id: req_011CXeaqz78p63FCJf5CN1N4)","_meta":{"date":"2026-01-31T01:25:33.021Z"}}
{"0":"HTTP 429 rate_limit_error: This request would exceed your account's rate limit. Please try again later. (request_id: req_011CXear4ChLjfua8YZQNAnL)","_meta":{"date":"2026-01-31T01:25:34.080Z"}}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions