# fix\(codex\): end stalled HTTP 429 retries with an explicit failure · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/commit/719fde80c80b539158d5d9c1419fa5eee47fd641)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

Requested revision: 719fde80c80b539158d5d9c1419fa5eee47fd641

Requested commit: 719fde80c80b539158d5d9c1419fa5eee47fd641

Commit: 719fde80c80b539158d5d9c1419fa5eee47fd641

Tree: 2628d0b6cd788720da016370788530c795fbddff

Author: Hong Liu

Committer: Hong Liu

## Message

```
fix(codex): end stalled HTTP 429 retries with an explicit failure

The Codex CLI retries rate-limited model requests itself and only reports
an `error` notice with `willRetry: true`. With a long Retry-After it sleeps
for the full value and emits nothing, so the turn, and any delegated task
waiting on it, stays running indefinitely.

Bound the wait in the adapter. Each rate-limited retry notice gets the
Retry-After delay when the error text carries one, or exponential backoff
(5s doubling, capped at 5 minutes), plus 60s for the retried request to
show progress. Past attempt 5, a Retry-After above 5 minutes, or a missed
deadline ends the turn as a retryable usage-limit failure with code
`rateLimitRetryExhausted` and the reset time when known, then interrupts
the native turn. Any progress or newer notice re-arms the bound.

```

## Parents

- [044f07257c9684ae4543bd1e1ebf9c394e9e3830](https://git.cafe/pingdotgg/t3code/commit/044f07257c9684ae4543bd1e1ebf9c394e9e3830?format=markdown)

[Source at this commit](https://git.cafe/pingdotgg/t3code/tree/719fde80c80b539158d5d9c1419fa5eee47fd641?format=markdown)
