Repository navigation
Stream disconnected before completion #3924
Description
What version of Codex is running?
v0.39.0
Which model were you using?
gpt-5-codex high (but with all models)
What platform is your computer?
WSL (Linux on windows)
What steps can reproduce the bug?
I was fixing an error in my codebase and at a certain point it started giving me stream errors, which is impossible, since I don't have any network problems and the context I'm giving it is very small. This only happens with the new version; I never had this problem before:
■ stream disconnected before completion: Your input exceeds the context window of this model. Please adjust your input and try again.
What is the expected behavior?
No response
What do you see instead?
Additional information
No response
Activity
BinaryBeastMaster commentedon Sep 19, 2025
For me running /compact fixes it
mxroute commentedon Sep 19, 2025
Consistently receiving this on my MacBook as well.
edgardcham commentedon Sep 19, 2025
Same for me, can't even run compact.
chris-thriveo commentedon Sep 19, 2025
Can confirm i am getting the same error consistently using codex + cursor 1.6.27 on mac.
necatituran commentedon Sep 21, 2025
I'm getting this error, it started it yesterday. any hope for fix?
Mac-V-Sog commentedon Sep 21, 2025
I am also getting this error. I have tried resetting vs code, logging in and out of Codex and deleting config file but no change. I'm on Window 11 and haven't had this error until now.
yurgon commentedon Sep 21, 2025
same on macbook pro M4 and Macos 26
tibo-openai commentedon Sep 21, 2025
Hey all, is this an error you see within one long session and are you all re-using the same session over and over again? Wondering if you have tried to create a new chat or session and whether you still hit this issue when you do?
Here is the "new chat" button in vscode:

zerox80 commentedon Sep 21, 2025
@tibo-openai
This happens even when i delete the history in ~/.codex/
Very strange, 200k Context used i get this disgusting error. Fix it ASAP! Unuseable, it does mvn test BAM ! i get the input too long error?!?! for 10k lines code project
zerox80 commentedon Sep 21, 2025
And i think the people here talk about the CLI, not the extension in VS Code.
edgardcham commentedon Sep 21, 2025
@tibo-openai
This happens in both CLI and extension for me. And yes it's a long session where the context is consumed, but /compact doesn't work because I get the same error.
Sometimes if it's a big task, codex reaches the limit and just breaks midway. Not ideal. An auto-compact feature is needed like CC.
scottyleics commentedon Sep 21, 2025
No fix but I get the same error now, was ok previously working on the same project with less complicated requests. /compact /clear or a new chat same problem.
mxroute commentedon Sep 21, 2025
Using latest CLI on MacBook, no current project/chat, fresh wipe of ~/.codex.
minhdanh commentedon Sep 21, 2025
Yes. I'm on cli and I'm in the middle of debugging an issue. I would not want to switch to a new session. Coming from Claude Code I didn't have this problem before. There must be a way to work on a long session, no?
27 remaining items
p3x-robot commentedon Oct 9, 2025
i deleted the whole
~/.codexfolder and it works.fullofcaffeine commentedon Oct 9, 2025
+1, seems to only happen with
gpt5-highfor me. So frustrating.shenfangqi123 commentedon Oct 11, 2025
had the same issue, no idea what it was, but when I start a new chat then it seem to be fixed.
ashe0047 commentedon Oct 13, 2025
Still happening, what is this mess
ashe0047 commentedon Oct 13, 2025
Billion dollar company but cant even handle stream errors
p3x-robot commentedon Oct 13, 2025
i deleted the whole ~/.codex folder and it works.
p3x-robot commentedon Oct 13, 2025
i deleted the whole ~/.codex folder and it works.
Hexthebaldy commentedon Oct 15, 2025
i met the same problem using gpt5-high, run /compact manually and it works
evzz74 commentedon Oct 15, 2025
I use /model or /init also have the same problem ,this is why?
Aniurm commentedon Oct 20, 2025
I've suffered a lot in thie problem.
Please fix it ASAP
mxroute commentedon Oct 20, 2025
Following up with my report. Unlike the overwhelming majority of reports, mine had nothing to do with the installation or any project, and almost appeared to be caused by an account level issue after a process of elimination. It finally solved itself (I assume by some fix outside of my visibility), and my report should no longer be taken into account. I'm only making this an additional comment because that too might be useful information for someone.
WilliamWatcher commentedon Oct 22, 2025
Updated codex and it seems to have solved it. I had an issue where codex was both installed as a formula and cask, but it should only be a cask?
[-]⚠️ stream error: stream disconnected before completion. !HELP[/-][+]Stream disconnected before completion[/+]etraut-openai commentedon Nov 18, 2025
I think the "Your input exceeds the context window of this model" error is now properly handled. I'm going to close this bug. If you see this behavior with the latest versions of codex, please open a new issue and provide any relevant details.