Codex CLI sessions become unrecoverable after ~37-40 minutes on Windows 11 after websocket disconnects
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
7 Comments
If you can repro, please use
/feedbackto upload logs and session details, then post the thread ID here.@kfawell repro = (meaning reproduce ... if you can reproduce/recreate)
@etraut-openai same issue
feedback id 019f5f63-d521-73b2-b202-c5644a88a4a3
I recomend you use the latest version of codex , I assume you are but again
know that a lot has improved - regarding websockets or whatever
you replaied in "Codex CLI sessions become unrecoverable after " but you have a threadid to share?
can you explain the issue you are facing?
e g you cant scroll up?
what was unrecoverable 15 hours ago,,, now you can access what you needed?
npm install -g @openai/codex@alpha
I encountered this issue while trying to use the latest version of the Codex desktop application (version 26.707.72221) for a session. Specifically, when I used the gpt-5.6 sol model to process an image with a resolution of 20000x20000, the session experienced WebSocket disconnections and reconnections.
The specific issue is that once a session enters this state, it cannot be restored. Although it’s possible to reopen the same session, whenever I send new commands, it takes a very long time to attempt to connect/reconnect, and the session never returns to normal operation. Using the /compact and /fork commands doesn’t help either. The only solution is to start a new session.
you can use this prompt .
(think what you want to happen as you write this)
````
use libvips , and ad a pyramid scrolling
Make sure you try learn , try read what it tries to do ----
it ruins the fun in using it, I recomend play wit the prompts
try learn and try explore new ideas with , aI is a lot of fun
as per the 20000x20000 image , its a big image which could account to 1.2gb vram
so you need to use the /feedback command , within the chat/thread it happen
<3