Title: Codex CLI sessions become unrecoverable after ~37-40 minutes on Windows 11 after websocket disconnects
What version of Codex CLI is running?
codex-cli 0.121.0
Which model were you using?
gpt-5.4
What platform is your computer?
Windows 11
What terminal emulator are you using?
PowerShell
Network environment
Home network, no intentional VPN/proxy in use.
What issue are you seeing?
In Codex CLI, a session works normally for a while, then starts failing with websocket disconnect/reconnect behavior. Once a given session enters this state, it no longer recovers. Opening a brand new session works again temporarily, but after roughly the same amount of time, that new session also starts failing.
The affected session is not just interrupted mid-turn once; it becomes effectively poisoned:
- re-opening the same session is possible
- but as soon as I send another prompt, it spends a long time trying to connect/reconnect
- it does not resume normal operation
- starting a fresh session is the only workaround
User-visible error
Stream disconnected before completion: failed to send websocket request: IO error: An existing connection was forcibly closed by the remote host. (os error 10054)
What steps can reproduce the bug?
- Start a new Codex CLI session on Windows 11.
- Use the session normally for around 30-40 minutes.
- Continue sending prompts after that point.
- Eventually the session starts hitting websocket disconnect/retry behavior.
- After that happens, the same session no longer recovers; any new prompt in that session triggers long reconnect attempts.
- Start a fresh session.
- The fresh session works again, but later fails the same way.
What is the expected behavior?
If a websocket transport drops mid-session, the session should either:
- reconnect cleanly and continue working, or
- fail once for that turn but remain usable for future prompts.
A session should not become permanently unusable after one of these disconnects.
What do you see instead?
The session retries repeatedly and then remains stuck in a reconnect/failure loop. A new session works, but the old session appears permanently unrecoverable.
Timing observed locally
I checked the local session metadata and codex-tui.log timestamps. Two recent CLI sessions on the same machine showed:
-
Session A:
- started:
2026-04-19T20:38:04.277Z
- first disconnect:
2026-04-19T21:18:06.307Z
- elapsed: about
40m 02s
-
Session B:
- started:
2026-04-20T18:52:37.394Z
- first disconnect:
2026-04-20T19:29:51.868Z
- elapsed: about
37m 14s
So the first failure appears after roughly 37-40 minutes in recent sessions.
Relevant sanitized log excerpts
2026-04-19T21:18:06.307294Z WARN ... thread.id=<redacted> ... codex_core::codex:
stream disconnected - retrying sampling request (1/5 in 213ms)...
2026-04-19T21:29:44.689782Z INFO ... thread.id=<redacted> ... codex_core::codex:
Turn error: stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses)
2026-04-20T19:29:51.868205Z WARN ... thread.id=<redacted> ... codex_core::codex:
stream disconnected - retrying sampling request (1/5 in 208ms)...
2026-04-20T19:31:35.011644Z WARN ... thread.id=<redacted> ... codex_core::client:
falling back to HTTP
2026-04-20T19:33:13.257185Z WARN ... thread.id=<redacted> ... codex_core::codex:
stream disconnected - retrying sampling request (1/5 in 196ms)...
Additional notes
This does not look like a one-off total network outage because:
- new sessions can still be started after the failure
- those new sessions work normally for a while
- the problem is that older affected sessions do not recover once they start disconnecting
Title: Codex CLI sessions become unrecoverable after ~37-40 minutes on Windows 11 after websocket disconnects
What version of Codex CLI is running?
codex-cli 0.121.0Which model were you using?
gpt-5.4What platform is your computer?
Windows 11
What terminal emulator are you using?
PowerShell
Network environment
Home network, no intentional VPN/proxy in use.
What issue are you seeing?
In Codex CLI, a session works normally for a while, then starts failing with websocket disconnect/reconnect behavior. Once a given session enters this state, it no longer recovers. Opening a brand new session works again temporarily, but after roughly the same amount of time, that new session also starts failing.
The affected session is not just interrupted mid-turn once; it becomes effectively poisoned:
User-visible error
What steps can reproduce the bug?
What is the expected behavior?
If a websocket transport drops mid-session, the session should either:
A session should not become permanently unusable after one of these disconnects.
What do you see instead?
The session retries repeatedly and then remains stuck in a reconnect/failure loop. A new session works, but the old session appears permanently unrecoverable.
Timing observed locally
I checked the local session metadata and
codex-tui.logtimestamps. Two recent CLI sessions on the same machine showed:Session A:
2026-04-19T20:38:04.277Z2026-04-19T21:18:06.307Z40m 02sSession B:
2026-04-20T18:52:37.394Z2026-04-20T19:29:51.868Z37m 14sSo the first failure appears after roughly
37-40 minutesin recent sessions.Relevant sanitized log excerpts
Additional notes
This does not look like a one-off total network outage because: