Codex CLI sessions become unrecoverable after ~37-40 minutes on Windows 11 after websocket disconnects

Open 💬 7 comments Opened Apr 20, 2026 by kfawell
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

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?

  1. Start a new Codex CLI session on Windows 11.
  2. Use the session normally for around 30-40 minutes.
  3. Continue sending prompts after that point.
  4. Eventually the session starts hitting websocket disconnect/retry behavior.
  5. After that happens, the same session no longer recovers; any new prompt in that session triggers long reconnect attempts.
  6. Start a fresh session.
  7. 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

View original on GitHub ↗

7 Comments

etraut-openai contributor · 3 months ago

If you can repro, please use /feedback to upload logs and session details, then post the thread ID here.

Mahkhmood9 · 3 months ago

@kfawell repro = (meaning reproduce ... if you can reproduce/recreate)

CATMIAOZHI · 6 days ago
If you can repro, please use /feedback to upload logs and session details, then post the thread ID here.

@etraut-openai same issue
feedback id 019f5f63-d521-73b2-b202-c5644a88a4a3

Mahkhmood9 · 6 days ago
> If you can repro, please use /feedback to upload logs and session details, then post the thread ID here. @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

CATMIAOZHI · 5 days ago
> > If you can repro, please use /feedback to upload logs and session details, then post the thread ID here. > > > @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.

Mahkhmood9 · 3 days ago
> > > If you can repro, please use /feedback to upload logs and session details, then post the thread ID here. > > > > > > @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 .

Help me learn how to process and handle images the size of 20000x20000

(think what you want to happen as you write this)

````
use libvips , and ad a pyramid scrolling


I recomend still using Gpt-Terra 
as its more truthful to what you ask it , instead of have a brain anyurism , (which is not fun recovering from hahaha)
Mahkhmood9 · 3 days ago
> > > If you can repro, please use /feedback to upload logs and session details, then post the thread ID here. > > > > > > @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.

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