Retry Policy for Outbound Provider Calls
Learn how retries work for outbound provider calls, including defaults, behavior for model providers and Discord, and configuration options. Essential for developers integrating with OpenClaw.
Read this when
- Updating provider retry behavior or defaults
- Debugging provider send errors or rate limits
Goals
- Retries happen for each HTTP request, not for an entire multi-step workflow.
- Order is kept intact because only the step currently being executed is retried.
- Non-idempotent actions are not repeated.
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
- Short retries are normally delegated to the provider SDKs by OpenClaw.
- With Stainless-based SDKs, including those from Anthropic and OpenAI, retryable responses (
408,409,429, and5xx) may carryretry-after-msorretry-after. If that wait exceeds 60 seconds, OpenClaw insertsx-should-retry: falseso the SDK reports the error right away, and model failover can switch to a different auth profile or a fallback model. - The cap can be changed using
OPENCLAW_SDK_RETRY_MAX_WAIT_SECONDS=<seconds>. Assign it0,false,off,none, ordisabledso SDKs can respect longRetry-Aftersleep periods internally.
Discord
- Rate-limit errors (HTTP 429), request timeouts, HTTP 5xx responses, and transient transport issues like DNS lookup failures, connection resets, socket closes, and fetch failures all trigger retries.
- Discord's
retry_afteris used when it exists; otherwise, exponential backoff applies.
Telegram
- Transient errors (429, timeout, connect/reset/closed, temporarily unavailable) are retried.
retry_afteris used when available, falling back to exponential backoff otherwise.- HTML/Markdown parse errors skip retries and revert to plain text on the initial attempt.
Configuration
Timing for retries on Discord and Telegram channels is hardcoded and cannot be adjusted through openclaw.json.
Notes
- Each request (message send, media upload, reaction, poll, sticker) is retried individually.
- Steps already completed in composite flows are not retried.