← Back to PRs

#9482: feat: add cloud code assist retry logic and parsing for rate limit errors

by mrcha033 open 2026-02-05 08:10 View on GitHub →
agents stale
## Summary - Add a single bounded retry for Cloud Code Assist 429 “capacity” errors. - Parse the provider’s “reset after Ns” hint and wait up to 60s before retrying. - Avoids premature profile cooldown/failover on transient CCA throttles. ## Testing - Not run (please advise). <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR adds a single bounded retry path for Cloud Code Assist throttling errors (HTTP 429 “capacity”), by parsing a provider error hint of the form “reset after Ns” and sleeping up to 60 seconds before retrying the embedded PI run loop. The retry is guarded to only occur once per run (`cloudCodeAssistRetryUsed`) and is applied both for prompt submission failures (`promptError`) and assistant failures (`lastAssistant?.errorMessage`) when the provider is `google-gemini-cli`, to reduce unnecessary auth profile cooldown/failover on transient throttles. <h3>Confidence Score: 4/5</h3> - This PR is generally safe to merge with low functional risk. - Change is localized and adds a bounded, single retry with a hard cap; no obvious control-flow or state bugs were found. Main issue is an incorrect provider/model in one warning log, which can mislead triage but won’t break behavior. - src/agents/pi-embedded-runner/run.ts <!-- greptile_other_comments_section --> <sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub> <!-- /greptile_comment -->

Most Similar PRs