Files
openclaw-openclaw/docs/concepts/retry.md
Peter Steinberger f7d7148cf0 docs: rewrite published docs grounded in current source (#100142)
Source-grounded rewrite of 529 published docs pages with per-unit information-loss verification: 1,713 factual corrections cited to src/**, generated surfaces regenerated, frontmatter titles preserved for i18n, release notes pages untouched. All docs gates green.

Closes #100141
2026-07-05 00:32:47 -04:00

2.4 KiB

summary, read_when, title
summary read_when title
Retry policy for outbound provider calls
Updating provider retry behavior or defaults
Debugging provider send errors or rate limits
Retry policy

Goals

  • Retry per HTTP request, not per multi-step flow.
  • Preserve ordering by retrying only the current step.
  • Avoid duplicating non-idempotent operations.

Defaults

Setting Default
Attempts 3
Max delay cap 30000 ms
Jitter 0.1 (10%)
Telegram min delay 400 ms
Discord min delay 500 ms

Behavior

Model providers

  • OpenClaw lets provider SDKs handle normal short retries.
  • For Stainless-based SDKs such as Anthropic and OpenAI, retryable responses (408, 409, 429, and 5xx) can include retry-after-ms or retry-after. When that wait is longer than 60 seconds, OpenClaw injects x-should-retry: false so the SDK surfaces the error immediately and model failover can rotate to another auth profile or fallback model.
  • Override the cap with OPENCLAW_SDK_RETRY_MAX_WAIT_SECONDS=<seconds>. Set it to 0, false, off, none, or disabled to let SDKs honor long Retry-After sleeps internally.

Discord

  • Retries on rate-limit errors (HTTP 429), request timeouts, HTTP 5xx responses, and transient transport failures such as DNS lookup failures, connection resets, socket closes, and fetch failures.
  • Uses Discord retry_after when available, otherwise exponential backoff.

Telegram

  • Retries on transient errors (429, timeout, connect/reset/closed, temporarily unavailable).
  • Uses retry_after when available, otherwise exponential backoff.
  • HTML/Markdown parse errors are not retried; they fall back to plain text on the first attempt.

Configuration

Set retry policy per provider in ~/.openclaw/openclaw.json:

{
  channels: {
    telegram: {
      retry: {
        attempts: 3,
        minDelayMs: 400,
        maxDelayMs: 30000,
        jitter: 0.1,
      },
    },
    discord: {
      retry: {
        attempts: 3,
        minDelayMs: 500,
        maxDelayMs: 30000,
        jitter: 0.1,
      },
    },
  },
}

Notes

  • Retries apply per request (message send, media upload, reaction, poll, sticker).
  • Composite flows do not retry completed steps.