Documentation Index
Fetch the complete documentation index at: https://openclaw.zhcndoc.com/llms.txt
Use this file to discover all available pages before exploring further.
目标
- 按 HTTP 请求重试,而不是按多步骤流程重试。
- 仅重试当前步骤,以保持顺序。
- 避免重复执行非幂等操作。
默认值
- 尝试次数:3
- 最大延迟上限:30000 ms
- 抖动:0.1(10%)
- 提供方默认值:
- Telegram 最小延迟:400 ms
- Discord 最小延迟:500 ms
行为
模型提供方
- OpenClaw 允许提供方 SDK 处理正常的短重试。
- 对于基于 Stainless 的 SDK,例如 Anthropic 和 OpenAI,可重试的响应
(
408、409、429和5xx)可以包含retry-after-ms或retry-after。当该等待时间超过 60 秒时,OpenClaw 会注入x-should-retry: false,使 SDK 立即上报错误,并且模型 故障转移可以轮换到另一个认证配置或回退模型。 - 可通过
OPENCLAW_SDK_RETRY_MAX_WAIT_SECONDS=<seconds>覆盖上限。 将其设置为0、false、off、none或disabled,可让 SDK 在内部遵守较长的Retry-After睡眠时间。
Discord
- 针对速率限制错误(HTTP 429)、请求超时、HTTP 5xx 响应, 以及瞬时传输故障(例如 DNS 解析失败、连接重置、 套接字关闭和 fetch 失败)进行重试。
- 可用时使用 Discord 的
retry_after,否则使用指数退避。
Telegram
- 对瞬时错误重试(429、timeout、connect/reset/closed、temporarily unavailable)。
- 可用时使用
retry_after,否则使用指数退避。 - Markdown 解析错误不会重试;它们会回退为纯文本。
配置
在~/.openclaw/openclaw.json 中按提供方设置重试策略:
说明
- 重试按请求生效(消息发送、媒体上传、反应、投票、贴纸)。
- 复合流程不会重试已完成的步骤。