Continuously reconnecting: "stream disconnected before completion"

Resolved 💬 7 comments Opened Feb 2, 2026 by StativBus Closed Feb 4, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of the VS Code extension are you using?

0.4.68

What subscription do you have?

Business

Which IDE are you using?

VS Code

What platform is your computer?

Windows

What issue are you seeing?

Codex keeps working for the most part. It just takes longer because after some thinking steps it shows this:

Reconnecting... 1/5
stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses)

If it counts up to 5 the task is stopped. I can then just type something like "retry" and it usually works again.

Given that it does work somewhat I assume it cannot be that the FIrewall is blocking it right? What could be potential troubleshoots?

What steps can reproduce the bug?

Any usage of the extension.

What is the expected behavior?

No "Reconnecting" messages.

Additional information

The firewall has caused issues before.
I am using this on Windows in the sandbox without WSL.

View original on GitHub ↗

7 Comments

github-actions[bot] contributor · 5 months ago

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

  • #9670
  • #9323
  • #8814
  • #9556
  • #9830

Powered by Codex Action

etraut-openai contributor · 5 months ago

Please use the /feedback command to upload logs and session details and post the thread ID here.

Are you using any non-default config.toml settings? Are you using an Azure endpoint, a corporate LLM proxy, or is this the default OpenAI endpoint?

StativBus · 5 months ago

Hi, thank you for the quick response! I am using all detault settings. I can't say this with 100% certainty, but I believe its the default OpenAI endpoint. The ID of an exemplary chat (it happens in all of them) is: 019c0ee3-1933-72b2-bdc6-c5d5f823460a

etraut-openai contributor · 5 months ago

I looked at your logs. This appears to be a basic network connectivity issue. You'll need to debug on your end. Check for things like firewalls, network proxies (TLS handshakes), VPNs, or DNS issues. If you're on a corporate network, your IT team may be able to help.

StativBus · 5 months ago

Thank you for checking. Yes, you appear to be right. Even though we are not using a VPN, there appear to be some additional firewall settings or the like because the issue does NOT appear when in the office. Does this point to something specific that I could tell our IT or is this too little information to go off of. If so, feel free to close the issue. You are right in that it is an issue on my end.

etraut-openai contributor · 5 months ago

You can tell your IT that https://chatgpt.com/backend-api/codex/responses is the endpoint that Codex needs to access.

Iris2762 · 3 months ago

I also met this problem today. I sent a easy message to codex, but it kept reconnect, and finally said "stream disconnected before completion: stream closedbefore response.completed"

<img width="590" height="801" alt="Image" src="https://github.com/user-attachments/assets/ff850b1f-af18-43a4-ab38-69994478ced6" />

I tried to turn off my VPN, and switching WIFI to my personal hotspot. The two ways didn't solve my problem. And finally, I checked the config file:C:\Users\admin\.codex\config.toml, and I found that the base_url is not openai_base_url, it's other providers.

I suddenly remembered that I use CC-switch before, and I configured codex provider in CC-switch, it overlap config infomation of codex itself.

after I delete the configuration of cc-switch codex, my codex app can response correctly.
I put my solution here ,https://github.com/farion1231/cc-switch/issues/1490#issuecomment-4257829454
<img width="990" height="205" alt="Image" src="https://github.com/user-attachments/assets/ae7a3404-fe30-42f0-91ad-0d37cc598aef" />