mirror of
https://github.com/openai/codex.git
synced 2026-11-24 23:20:47 +00:00
## Why A silent WebSocket can leave an active controller waiting up to 60 seconds for the host to detect the outage. Reconnect backoff from earlier failures can delay recovery further. ## What changed - Reconnect after 30 seconds without incoming WebSocket frames when a live controller is present. Keep the 60-second pong timeout when only the relay client is connected. - Start at the initial jittered delay for the first five retries when controller activity resumes after a period with no live controllers, then increase backoff if failures continue. - Preserve live streams and their terminals when a sequenced `initialize` request is replayed. Ignore cleanup from an old writer if a replacement connection has reused the stream. ## Testing Cover the attached and relay-only timeout paths, retry backoff across controller lifecycle changes, and writer cleanup after stream reuse. GitOrigin-RevId: 6618e7bca4852b05d41b18e53fe49efcb2b6db70