Frequent reconnect loop in Codex App: websocket closed by server before response.completed

Open 💬 53 comments Opened Apr 22, 2026 by GGBondBlueWhale
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

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/5
  • Reconnecting... 3/5
  • Reconnecting... 4/5
  • Reconnecting... 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:

  1. Use the Codex App normally for some time
  2. Send a prompt that produces a streamed response
  3. During streaming, the connection drops unexpectedly
  4. The app shows repeated reconnect attempts
  5. 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" />

View original on GitHub ↗

53 Comments

github-actions[bot] contributor · 2 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #17199
  • #17202
  • #17201
  • #18952

Powered by Codex Action

GGBondBlueWhale · 2 months ago

I reviewed the duplicates suggested by the bot. They look related, but not like exact duplicates of this report.

  • #17199 is about the VS Code extension on Windows
  • #17201 is the closest, but it is a Codex App report on Windows and is much less specific
  • #17202 is a broader stream-disconnect report spanning App and CLI

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.

BtcCrush · 2 months ago

加一

zkw13 · 2 months ago

最近两天特别严重,UTC+8 的 14:00~18:00

CaesarC · 2 months ago

+1

shanelindsay · 2 months ago

suspect it is due to system updates to the expected launch of 5.5 later today, servers are flaky

Optimuspime123 · 2 months ago

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" />

kuzkokov · 2 months ago

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:

I reviewed the duplicates suggested by the bot. They look related, but not like exact duplicates of this report. VS Code extension: infinite reconnect loop + "stream disconnected before completion" #17199 is about the VS Code extension on Windows Im run into this issue, were its trying to reconnect #17201 is the closest, but it is a Codex App report on Windows and is much less specific * Stream disconnected before completion: An error occurred while processing your request. #17202 is a broader stream-disconnect report spanning App and CLI 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.

it seems that it doesn't really depend on the usage method or the OS.

Optimuspime123 · 2 months ago

Really hope someone looks into this wtf...

lbqdly · 2 months ago

same problem, Y ?

kukudeshiyi · 2 months ago

and will lose the before threads if i switch to http only mode.....hope can provide a better way as the fallback

kukudeshiyi · 2 months ago

the issue broke my weekend, so bad experience. why before is good?

mahesha-quattr · 2 months ago

facing same issues today, is this due to network issues from ourside or codex/openai side?

ragno7 · 2 months ago

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.

manojLuffy · 2 months ago

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" />

leo-pe2 · 2 months ago

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.

wang-sanity · 2 months ago

+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..

mistercrunch · 2 months ago

+1, seeing the same using Codex SDK while using https://agor.live/

zippoxer · 2 months ago

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

Forux · 2 months ago

The same $200 subscription, very often

NN1985 · 2 months ago
this

I have this issue as well.

tobby888 · 2 months ago

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" />

magjac-tiepoint · 2 months ago

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

m-fayzan · 2 months ago

+1

hetaodw · 2 months ago

+1

TibJnt · 2 months ago

+1

AbeHamade · 2 months ago

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.

hb5813 · 2 months ago

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.

zrt219 · 2 months ago

<img width="704" height="211" alt="Image" src="https://github.com/user-attachments/assets/ed5065e8-8a43-4e25-8603-dfd9cde00eea" />

kinda of insane

okamototomoyuki · 1 month ago

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/responses is being used as the endpoint.
I then tried directly invoking image generation through the Responses API by setting image_generation in the request body's tools, 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.

drptbl · 1 month ago

<img width="727" height="404" alt="Image" src="https://github.com/user-attachments/assets/c04098cf-f242-4a3b-9628-86efa63813e3" />

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.

Could be it, I always work with multiple screenshots within my context.

olepbach-dev · 1 month ago

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" />

ownbylichaobao · 1 month ago

So is no one from the official team going to fix this?

josevicentecruz · 1 month ago

Same problem here. So annoying.

lhotwll217 · 1 month ago

Yes this seems to have _maybe_ gotten better but still huge blocker.

Are Websockets designed to be used like this?

NN1985 · 1 month ago
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.

ilyes-i-ben · 1 month ago

+1 it's happening much more often now

4eiz · 1 month ago

+1

mdcgqq · 1 month ago

+1

ewal001 · 1 month ago

о боже кодекс! что за тупые ошибки
11

ZenoBell · 1 month ago

+1

omarojo · 1 month ago

+1

2000mew · 1 month ago

+1 huge downer!

peterjarian · 1 month ago

+1

Angeschossen · 1 month ago

+1 Pretty much unuseable in this state, sorry.

xr0mii · 1 month ago

+1

hyeluoh · 1 month ago

+1

paulchill · 1 month ago

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.

Kircerta · 1 month ago

I also encountered "stream disconnected before completion: websocket closed by server before response.completed" issue on macOS Codex. Version 26.616.41845.

hyeluoh · 1 month ago

Guys, I added proxy configuration in ~/.codex/.env, and I haven't seen the reminder to reconnect five times anymore.

cat ~/.codex/.env                                                                                                                                                                                                                
http_proxy="http://127.0.0.1:1080" 
https_proxy="http://127.0.0.1:1080"
all_proxy="socks5://127.0.0.1:1080"
no_proxy="localhost,127.0.0.1,::1,192.168.0.0/16"
adhikary97 · 8 days ago

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" />

CodeBBakGoSu · 6 days ago

Additional reproducible case specific to Codex App multi-agent v2:

  • Codex App: 26.707.71524 (build 5263)
  • macOS 26.5.2, arm64
  • Feature/context: multi_agent_v2 sub-agent in the Codex App
  • Sub-agent task name: slides_9_15
  • Workload: inspect six local slide images, run a local command, then continue an image-generation/editing workflow

Observed sequence in the sub-agent card:

  1. "Viewed 6 images"
  2. "Ran command"
  3. "Agent updating"
  4. "Reconnecting ... /5"
  5. stream disconnected before completion: websocket closed by server before response.completed

The 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.

Lincoln-Muller · 1 day ago

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:

I am currently getting:

stream disconnected before completion: websocket closed by server before response.completed

My chat seems to have broken. Here is the chat:
codex://threads/<thread ID>
<thread ID>
/Users/<not showing this here>/Documents/Codex/2026-07-18/i
Chat Name: "Create personal track website"

Whenever I send a message, it starts compacting context, and then immediately shows the "Reconnecting ... /5" and it seems to be broken. 
Can you please try and repair the chat?

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.