Handling Request Retries in OpenClaw
I have often dealt with flaky network connections or strict rate limits when sending automated messages. It is frustrating when a single failed HTTP request breaks an entire notification flow. I want my system to handle these hiccups automatically so I don’t have to write custom error-handling logic for every message.
OpenClaw handles this by retrying individual HTTP requests. It focuses on keeping things simple: it retries the current step to preserve ordering and avoids repeating actions that shouldn’t be duplicated.
What You’ll Need
Section titled “What You’ll Need”- An active OpenClaw installation.
- Access to your
~/.openclaw/openclaw.jsonconfiguration file.
Quick Start
Section titled “Quick Start”By default, OpenClaw tries to send a request 3 times. It uses exponential backoff with a 10% jitter and caps the delay at 30,000 ms.
To customize these settings, you need to edit your ~/.openclaw/openclaw.json file. You can set specific policies for Telegram and Discord. Here is the exact structure you should use:
{ channels: { telegram: { retry: { attempts: 3, minDelayMs: 400, maxDelayMs: 30000, jitter: 0.1, }, }, discord: { retry: { attempts: 3, minDelayMs: 500, maxDelayMs: 30000, jitter: 0.1, }, }, },}These retries apply to every individual request, whether you are sending a message, uploading media, adding a reaction, or posting a poll.
Troubleshooting
Section titled “Troubleshooting”Discord only retries on rate limits
Section titled “Discord only retries on rate limits”If you notice Discord requests failing without retrying, check the error code. Discord is configured to retry only on HTTP 429 (rate-limit) errors. It will use the retry_after value provided by Discord if it is available.
Telegram Markdown failures
Section titled “Telegram Markdown failures”Telegram handles retries for transient errors like timeouts or connection resets. However, if you have a Markdown parse error, OpenClaw will not retry the request. Instead, it falls back to sending the message as plain text to ensure the content arrives.
Ordering and composite flows
Section titled “Ordering and composite flows”If you are running a multi-step flow and a later step fails, OpenClaw only retries that specific failed step. It does not go back and retry steps that already finished successfully. This prevents duplicating non-idempotent operations.
If you have questions about specific provider behaviors, check out the AI Setup Assistant.
What’s Next
Section titled “What’s Next”- Telegram Provider Documentation
- Discord Provider Documentation
- Configuration Schema Reference
- Message Formatting Guide
OpenClaw Expert
Still stuck?
If this page didn't answer your case, ask OpenClaw Expert for step-by-step guidance.