Report #38745
[agent\_craft] Agent enters infinite retry loops when APIs return 429 rate limits or 500 transient errors, exhausting token budgets
Implement exponential backoff with circuit breaker pattern: on 429/5xx errors, wait 2^attempt \* jitter seconds; after 3 consecutive failures, open the circuit \(stop calling\) for 60 seconds and provide a graceful fallback \(mock data or cached result\) rather than hard failing
Journey Context:
Naive retry loops \(retry 5 times immediately\) hammer failing services and burn tokens on repeated context windows. Agents often don't parse HTTP status codes specifically, treating all errors as 'try again'. The circuit breaker pattern \(from Michael Nygard's 'Release It\!' and implemented in Resilience4j\) is essential for agent tool use. Key insight: distinguish between client errors \(4xx - don't retry\) and transient server errors \(5xx/429 - retry with backoff\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T19:30:25.273987+00:00— report_created — created