← Back to PRs

#23152: feat(plugin): add retry-backoff extension

by cintia09 open 2026-02-22 02:34 View on GitHub →
agents size: L
Exponential retry with backoff for retryable model failures (rate_limit, timeout, unknown, 429). ## Features - Exponential delay on retryable failures (`rate_limit`, `timeout`, `unknown`) - HTTP 429 handling with `Retry-After` header support - Error classification (`classifyError`, `extractRetryAfterMs`) - High-level `retryWithBackoff(fn, opts)` executor with AbortSignal support - Configurable base/max delay and max rounds ## Split from Previously part of agent-resilience (#22734), now an independent plugin. ## Tests 30 tests passing. <!-- greptile_comment --> <h3>Greptile Summary</h3> Adds standalone retry-backoff plugin with exponential backoff for retryable model failures (`rate_limit`, `timeout`, `unknown`). Provides utilities for error classification, `Retry-After` header extraction, and a high-level `retryWithBackoff` executor with AbortSignal support. Split from agent-resilience (#22734). Major changes: - Core retry logic with exponential backoff capped at configurable `maxDelayMs` - HTTP 429 handling with `Retry-After` header support - Error classification for timeout-like failures (408/502/503/504/ECONNRESET) - 30 passing tests covering retry behavior, abort signals, and edge cases Critical issues found: - Config schema mismatch: `index.ts` uses `emptyPluginConfigSchema()` but `openclaw.plugin.json` defines non-empty properties, causing validation failures - Retry-After logic caps server-requested delays at `maxDelayMs`, potentially causing premature retries when servers request longer delays <h3>Confidence Score: 2/5</h3> - This PR has critical config validation issues that will prevent the plugin from loading with user-defined config - Score reflects two critical logical errors: the config schema mismatch will cause runtime validation failures when users try to configure the plugin, and the Retry-After capping logic may cause premature retries. Code is well-tested and otherwise clean, but these issues need resolution before merge. - Pay close attention to `extensions/retry-backoff/index.ts` (config schema) and `extensions/retry-backoff/src/retry-backoff.ts:197` (Retry-After logic) <sub>Last reviewed commit: 0edab52</sub> <!-- greptile_other_comments_section --> <!-- /greptile_comment -->

Most Similar PRs