Error: stream disconnected before completion: stream closed before response.completed

Open 💬 11 comments Opened Jan 27, 2026 by bharat-savaliya-altera
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

0.87.0

What subscription do you have?

Enterprise

Which model were you using?

gpt5

What platform is your computer?

Microsoft Windows NT 10.0.26100.0 x64

What terminal emulator and version are you using (if applicable)?

_No response_

What issue are you seeing?

■ stream disconnected before completion: stream closed before response.completed'

above message is coming when execution is in progress.. it stops. we have to prompt "continue" to proceed

What steps can reproduce the bug?

Uploaded thread: 019be04b-ed14-75a3-87e0-44814acd1149

What is the expected behavior?

_No response_

Additional information

_No response_

View original on GitHub ↗

11 Comments

github-actions[bot] contributor · 5 months ago

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

  • #9936
  • #9635
  • #9727
  • #9830

Powered by Codex Action

etraut-openai contributor · 5 months ago

Thanks for uploading the logs. I don't see any smoking guns in the logs.

This looks to me like a vanilla networking connectivity issue. Are you using Codex on a corporate network? If so, I recommend working with your IT team to investigate issues with routing, proxies, firewalls, etc.

ahmedelami · 5 months ago

This worked for me:

The issue was a stale, cached authentication session in the local config (it was prioritizing an old/limited API Org instead of my ChatGPT subscription).

  1. Kill lingering processes and remove the cached auth file:
pkill -f codex
rm ~/.codex/auth.json
  1. Start fresh (forcing no env vars to ensure a clean login):
env -u OPENAI_API_KEY -u OPENAI_ORGANIZATION codex
  1. Select "Sign in with ChatGPT" when prompted.

Lmk if it also works for you or helps?

ibabencu · 5 months ago

here is a new one.
Or mention your thread ID 019c13b5-b3e2-74b2-aa13-f351fb90a614 in an existing issue. thank you! great stuff codex, I like it more than claude code :)). for now.

etraut-openai contributor · 5 months ago

@ibabencu, thanks for uploading your logs. That error occurred because you tripped a server-side check that blocks conversations that are considered unsafe. I don't see anything in your prompt that would be an obvious cyber risk or similar, so this was likely a false positive. We're always working to better tune these safety detectors. If you see other instances of this, please use /feedback to upload the session details. We make use of this data to improve the models and detectors.

atimmer · 5 months ago

I've uploaded a /feedback, thread ID 019c2dad-c1c0-7331-bb4b-0e19534b637a.

ibabencu · 5 months ago

[like] Ionut Babencu reacted to your message:
________________________________
From: Anton Timmermans @.*>
Sent: Thursday, February 5, 2026 1:53:40 PM
To: openai/codex
@.*>
Cc: Ionut Babencu @.>; Mention @.>
Subject: Re: [openai/codex] Error: stream disconnected before completion: stream closed before response.completed (Issue #9995)

[https://avatars.githubusercontent.com/u/584693?s=20&v=4]atimmer left a comment (openai/codex#9995)<https://github.com/openai/codex/issues/9995#issuecomment-3853814382>

I've uploaded a /feedback, thread ID 019c2dad-c1c0-7331-bb4b-0e19534b637a.


Reply to this email directly, view it on GitHub<https://github.com/openai/codex/issues/9995#issuecomment-3853814382>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AWJOXJ35N7GCTCYN3BZBUQL4KNDOJAVCNFSM6AAAAACTBH6276VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTQNJTHAYTIMZYGI>.
You are receiving this because you were mentioned.Message ID: @.***>

etraut-openai contributor · 5 months ago

@atimmer, thanks for uploading your logs. I looked at them, and I suspect the issue you're hitting is due to very long tool outputs. We'll need to look into it further. In the meantime, as a potential workaround, try to reframe the task or adjust your skills / MCPs so the output of tool calls is smaller.

lamellama · 4 months ago

Using the VSCode plugin, I logged out by clicking the settings cog icon at the top of the view and logged back in

pauldinu10 · 3 months ago

I kept running into this on Azure with gpt-5.3-codex and 5.4. Built a workaround that auto-retries on stream disconnect and splits large tasks into separate sessions to avoid context overflow and compaction errors.
https://github.com/pauldinu10/codex-smart
It's a PowerShell wrapper that runs each task from a tasks.md file as a fresh codex exec --full-auto session. If the stream drops, it retries automatically up to N times. Not a fix, but makes Codex usable for long migrations.

PZ123CLI · 1 month ago

stream disconnected before completion: stream closed before response.completed