Files
openclaw/docs/concepts/retry.md

70 lines
1.4 KiB
Markdown
Raw Normal View History

2026-01-07 17:48:19 +00:00
---
summary: "Retry policy for outbound provider calls"
read_when:
- Updating provider retry behavior or defaults
- Debugging provider send errors or rate limits
title: "Retry Policy"
2026-01-07 17:48:19 +00:00
---
2026-01-31 21:13:13 +09:00
2026-01-07 17:48:19 +00:00
# Retry policy
## Goals
2026-01-31 21:13:13 +09:00
2026-01-07 17:48:19 +00:00
- Retry per HTTP request, not per multi-step flow.
- Preserve ordering by retrying only the current step.
- Avoid duplicating non-idempotent operations.
## Defaults
2026-01-31 21:13:13 +09:00
2026-01-07 17:48:19 +00:00
- Attempts: 3
- Max delay cap: 30000 ms
- Jitter: 0.1 (10 percent)
- Provider defaults:
- Telegram min delay: 400 ms
- Discord min delay: 500 ms
## Behavior
2026-01-31 21:13:13 +09:00
2026-01-07 17:48:19 +00:00
### Discord
2026-01-31 21:13:13 +09:00
2026-01-07 17:48:19 +00:00
- Retries only on rate-limit errors (HTTP 429).
- Uses Discord `retry_after` when available, otherwise exponential backoff.
### Telegram
2026-01-31 21:13:13 +09:00
2026-01-07 17:48:19 +00:00
- Retries on transient errors (429, timeout, connect/reset/closed, temporarily unavailable).
- Uses `retry_after` when available, otherwise exponential backoff.
- Markdown parse errors are not retried; they fall back to plain text.
## Configuration
2026-01-31 21:13:13 +09:00
2026-01-30 03:15:10 +01:00
Set retry policy per provider in `~/.openclaw/openclaw.json`:
2026-01-07 17:48:19 +00:00
```json5
{
channels: {
telegram: {
retry: {
attempts: 3,
minDelayMs: 400,
maxDelayMs: 30000,
2026-01-31 21:13:13 +09:00
jitter: 0.1,
},
},
discord: {
retry: {
attempts: 3,
minDelayMs: 500,
maxDelayMs: 30000,
2026-01-31 21:13:13 +09:00
jitter: 0.1,
},
},
},
2026-01-07 17:48:19 +00:00
}
```
## Notes
2026-01-31 21:13:13 +09:00
2026-01-07 17:48:19 +00:00
- Retries apply per request (message send, media upload, reaction, poll, sticker).
- Composite flows do not retry completed steps.