mirror of
https://github.com/openai/codex.git
synced 2026-10-26 18:38:47 +00:00
## Why Remote-control requests could bypass a server's `Retry-After` deadline through pairing, auth changes, or reconnects. Proactive token refresh could also continue using a valid token despite an explicit server delay. ## What changed - Share retry deadlines across enrollment, token refresh, pairing, pairing status, and WebSocket handshakes, preserving them across enrollment replacement and disable/enable transitions. - Honor `Retry-After` on HTTP `429` and `503` pairing and handshake responses, including incomplete pairing response bodies. - Add up to 30 seconds of jitter once per response without shortening the server's deadline, including for `Retry-After: 0`. - Defer new requests while retaining valid tokens, and prevent auth changes from shortening the server delay while keeping shutdown responsive. ## Testing Add regression coverage for shared deadlines, concurrent pairing and handshake failures, auth recovery, disable/enable transitions, retries after expiry, prompt shutdown, and jitter bounds. GitOrigin-RevId: 69a5a46559031709a4558190c3142eb65e2ae634