·3 min read
Your Agent Got a 429. Adding More Retries Can Make It Worse.

An agent can hit a rate limit while its monthly bill still looks small. Several steps launch together, each carries a growing conversation, and the retries arrive just as the next batch starts. The problem is the shape of the traffic, not simply its monthly total.
HTTP 429 indicates rate limiting; a response may include Retry-After, but implementations and scopes vary. Read the actual provider response and account rules rather than assuming every 429 has the same cause. See the MDN status reference.
Find the exhausted resource
Record the response body, relevant limit headers, request time, model, project or account scope, and estimated request size. Remove credentials from diagnostic records.
Distinguish a short-term request limit, a token budget, concurrency pressure, and a quota or billing condition. A temporary burst may recover after waiting. A quota condition can require an account change; blind retries do not create allowance.
Estimate demand before dispatch
Consider a hypothetical budget of 60 requests per minute and 120,000 budgeted tokens per minute. If each step requires 6,000 budgeted tokens, the token budget permits about 20 steps per minute, well below the request limit.
Launching 25 such steps together demands 150,000 tokens. “Only 25 requests” is not a useful defense. The exact definition of budgeted tokens depends on the provider, including whether output reservations or separate input and output limits apply.
Reserve against the relevant budgets before sending. Reconcile estimates with observed usage where the provider's accounting permits it. A request larger than the entire available limit needs splitting, a different approved route, or rejection; it should not sit in a queue forever waiting for impossible capacity.
Give the queue a deadline and a size limit
Track enqueue time, expiry, priority, and estimated work. If the task cannot start and finish within its remaining deadline, return a clear outcome rather than generating an answer after the caller has gone away.
Separate interactive and background workloads with explicit shares so a batch import cannot consume all available capacity. Add fairness across tenants where relevant. A single global first-in queue can let one large customer delay everyone else.
Queue bounds matter: without them, a temporary provider slowdown can become an application memory problem.
Make retries re-enter the budget
A retry is another request and must use the same admission controls. Use the provider's retry guidance when present; otherwise apply a bounded backoff policy with jitter and a total task deadline.
Do not give the SDK, gateway, and agent loop independent retry budgets. Three attempts at each of three layers can create up to 27 downstream attempts in a worst-case nested sequence. Assign retry ownership and record the real attempt count.
A backup is useful only if it is eligible and has capacity outside the exhausted pool. A second key in the same constrained account may not provide independent allowance.
Preserve progress instead of restarting the agent
Checkpoint completed tool results and task state. After a transient model failure, continue from a valid boundary rather than repeating every successful action. For side-effecting tools, reconcile whether an action completed before retrying it.
Measure whether the policy helped
Track 429s per attempt, accepted tasks before deadline, queue wait, rejected admission, total attempts, and cost per completed task. A lower 429 count achieved by leaving users waiting indefinitely is not an improvement.
Explore model options in Tokatlas, then check the limits and supported behavior of the exact route. Solve avoidable bursts first; additional routing should complement a bounded queue, not disguise an uncontrolled caller.