Frequent reconnect loop in Codex App: websocket closed by server before response.completed
What version of the Codex App are you using (From “About Codex” dialog)?
26.417.41555 (1858)
What subscription do you have?
Pro
What platform is your computer?
macOS
What issue are you seeing?
Over the past few hours, I have repeatedly hit a streaming failure in the Codex App during normal use.
While a response is streaming, the app starts reconnecting multiple times and then fails with:
stream disconnected before completion: websocket closed by server before response.completed
The reconnect sequence I saw included:
Reconnecting... 2/5Reconnecting... 3/5Reconnecting... 4/5Reconnecting... 5/5
This has happened many times within a few hours and makes the app feel noticeably slow and unreliable.
What steps can reproduce the bug?
I do not have a fully deterministic repro yet, but this is the pattern I have observed:
- Use the Codex App normally for some time
- Send a prompt that produces a streamed response
- During streaming, the connection drops unexpectedly
- The app shows repeated reconnect attempts
- The turn fails before
response.completed
This happened multiple times over the last few hours during normal usage.
What is the expected behavior?
The stream should stay connected until the response is fully completed, or the app should recover transparently without losing the response.
Additional information
- The failure appears intermittent, but frequent enough to significantly interrupt normal workflow
- When it happens, I often have to retry or regenerate
- I have a screenshot showing the reconnect loop and exact error text if needed
- I also encountered the
Reconnecting...problem multiple times within the same task, not just across separate tasks - Based on when I started noticing it, this appears to have been happening since around 1–2 AM US Eastern Time
- I am reasonably confident this was not caused by my local network, because my internet connection remained stable and usable throughout the same period
- During this same window, Codex also felt unusually slow overall, even when using GPT-5.4 in fast mode
<img width="1496" height="160" alt="Image" src="https://github.com/user-attachments/assets/1e1185d3-ece3-428e-a233-8847ee86e9f8" />
<img width="1360" height="414" alt="Image" src="https://github.com/user-attachments/assets/4433448f-c0a3-46b5-b5d5-a7b122c04132" />
53 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
I reviewed the duplicates suggested by the bot. They look related, but not like exact duplicates of this report.
I’m keeping this issue open because this report is specifically about the Codex App on macOS, repeated reconnects within the same task, a stable local internet connection during the failures, and unusually slow overall responses during the same time window even when using GPT-5.4 fast mode.
加一
最近两天特别严重,UTC+8 的 14:00~18:00
+1
suspect it is due to system updates to the expected launch of 5.5 later today, servers are flaky
same problem, thread ID thread ID 019dba73-6770-7d90-aac3-6941581fc48b sent feedback twice Codex is becoming unusable for me
<img width="1825" height="215" alt="Image" src="https://github.com/user-attachments/assets/73e80d5d-2077-47d0-8b4a-e85f6a9ef2c7" />
having the same issue for more than a week now. can't use codex at all now, so I switched to other providers.
was trying it with both codex app and cli on macos — the result is the same.
so, just adding to that:
it seems that it doesn't really depend on the usage method or the OS.
Really hope someone looks into this wtf...
same problem, Y ?
and will lose the before threads if i switch to http only mode.....hope can provide a better way as the fallback
the issue broke my weekend, so bad experience. why before is good?
facing same issues today, is this due to network issues from ourside or codex/openai side?
Had the most complicated week trying to navigate my way around this problem - and especially the weekend. Working on multiple big projects with codex and couldn't really move forward with them because of the connectivity problems. The issues continue today. Hope it gets sorted out soon. I have a pro subscription specifically for this service.
Continuously facing. More than 97% usage still remaining. This is really annoying. Wasted my whole weekend. I am on windows btw.
<img width="1089" height="885" alt="Image" src="https://github.com/user-attachments/assets/47403746-97b0-47f6-951b-4e9c8374e465" />
Also getting this since GPT 5.5 has been introduced. I haven't used much from my ratelimits but still very annoying. I'm on mac.
+1. is anyone from the codex team even following this thread? This has been going on for a while! Very frustrating. Will need to drop the app and start using Claude code or just use vscode..
+1, seeing the same using Codex SDK while using https://agor.live/
seeing the same, especially as thread grows over an hour or so, i suspect that Codex generating images or viewing images contributes to this
only solution is creating a new thread
The same $200 subscription, very often
I have this issue as well.
Same probem in $20 Plus
I used it smoothly this morning, but tonight, it doesn't work.
<img width="1478" height="450" alt="Image" src="https://github.com/user-attachments/assets/946a4117-d3bc-4063-a991-3da3b2d51d2f" />
I also see this since yesterday evening (CEST). I have tried many network connections and rebooted several time to no avail. I haven't gotten Codex to start cleanly even once. Please advice
+1
+1
+1
This is so bad, it makes Codex unusable. Point of record: I am on the Pro Plan $100/mo. so plan is not the issue.
This issue arises when there are several large images in a websocket session, causing the upstream server to close the connection with a 1009 error due to the message size being too large. I can resolve this issue by turning off websocket and reverting to https. Alternatively, I can actively trigger compact, as even with websocket enabled, compact still operates over https.
<img width="704" height="211" alt="Image" src="https://github.com/user-attachments/assets/ed5065e8-8a43-4e25-8603-dfd9cde00eea" />
kinda of insane
I’m experiencing an issue where image generation that completes almost instantly via ChatGPT or the OpenAI API ends up taking tens of minutes or hanging entirely when routed through Codex.
After inspecting the Codex source, I found that
https://chatgpt.com/backend-api/codex/responsesis being used as the endpoint.I then tried directly invoking image generation through the Responses API by setting
image_generationin the request body'stools, but the behavior did not improve.This seems less like a Codex-side issue and more likely a server-side issue with the Responses API itself.
I would appreciate it if you could investigate this issue.
<img width="727" height="404" alt="Image" src="https://github.com/user-attachments/assets/c04098cf-f242-4a3b-9628-86efa63813e3" />
Could be it, I always work with multiple screenshots within my context.
I also used Codex to try and generate a whole bunch of images. The images went through, but throughout the session the Codex app disconnected multiple times. If I try to talk with the same session again, I'm met with these reconnecting problems all the time.
<img width="768" height="272" alt="Image" src="https://github.com/user-attachments/assets/2ce2f45a-ded1-48b3-9840-5a5ae5f71501" />
So is no one from the official team going to fix this?
Same problem here. So annoying.
Yes this seems to have _maybe_ gotten better but still huge blocker.
Are Websockets designed to be used like this?
I still say there is good reason developers prefer the old true and reliable ChatCompletions endpoint.
+1 it's happening much more often now
+1
+1
о боже кодекс! что за тупые ошибки
11
+1
+1
+1 huge downer!
+1
+1 Pretty much unuseable in this state, sorry.
+1
+1
This is driving me nuts - in codex + vs code codex extension same issue, constantly loosing connection and thinking. burning through requests to just stop and start trying to get it to carry on.
I also encountered "stream disconnected before completion: websocket closed by server before response.completed" issue on macOS Codex. Version 26.616.41845.
Guys, I added proxy configuration in ~/.codex/.env, and I haven't seen the reminder to reconnect five times anymore.
Still get this issue everyday even for fresh chats
<img width="324" height="181" alt="Image" src="https://github.com/user-attachments/assets/d018d580-b3ab-42e7-9200-222bcb055d6f" />
Additional reproducible case specific to Codex App multi-agent v2:
multi_agent_v2sub-agent in the Codex Appslides_9_15Observed sequence in the sub-agent card:
stream disconnected before completion: websocket closed by server before response.completedThe parent task remained responsive, but the sub-agent turn never produced a completed response. Any generated result that had not already been persisted locally was effectively lost, and the sub-agent had to be interrupted/restarted.
This seems related to the image-heavy cases already reported here, but adds a multi-agent-v2-specific failure mode: a child-agent stream can die while the parent thread remains usable. Expected behavior is either transparent child-stream recovery/resume, or a terminal child-agent error surfaced to the parent so the coordinator can retry without waiting indefinitely.
Screenshot with the exact reconnect sequence is available.
FOR ANYONE LOOKING FOR THE SOLUTION - READ BELOW!
Hi all, I experienced the same issue.
I was working on a website, and a lot of images were involved. Randomly, the thread died and I got into the compaction disconnect loop. So, I created a new Codex chat and sent the following message:
You can get the chat information by right clicking the chat and copying these 3 options:
<img width="163" height="74" alt="Image" src="https://github.com/user-attachments/assets/ec0bb9c3-6e98-46b2-be91-990da24bd40c" />
I used Sol medium for this task, because I wanted to make sure a dumber model like Luna or Terra wouldn't mess anything up. In a few minutes, it found the issue, fixed it, and the chat is back to normal.
Here is what it finished with:
<img width="637" height="292" alt="Image" src="https://github.com/user-attachments/assets/b85c4aaf-b9d7-4a62-a125-e4c1c3717411" />
Please give this message a thumbs up if it helped fix the solution for you. Sometimes, the best thing to do is to just let Codex fix its own issue.