codex icon indicating copy to clipboard operation
codex copied to clipboard

Stream disconnected before completion

Open YoloMark98 opened this issue 1 year ago • 53 comments

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 error: stream disconnected before completion: Your input exceeds the context window of this model. Please adjust your input and try again.; retrying 1/5 in 208ms…

⚠️ stream error: stream disconnected before completion: Your input exceeds the context window of this model. Please adjust your input and try again.; retrying 2/5 in 378ms…

⚠️ stream error: stream disconnected before completion: Your input exceeds the context window of this model. Please adjust your input and try again.; retrying 3/5 in 837ms…

⚠️ stream error: stream disconnected before completion: Your input exceeds the context window of this model. Please adjust your input and try again.; retrying 4/5 in 1.482s…

⚠️ stream error: stream disconnected before completion: Your input exceeds the context window of this model. Please adjust your input and try again.; retrying 5/5 in 3.035s…

■ 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?

Image

Additional information

No response

YoloMark98 avatar Sep 19 '25 15:09 YoloMark98

For me running /compact fixes it

BinaryBeastMaster avatar Sep 19 '25 15:09 BinaryBeastMaster

Consistently receiving this on my MacBook as well.

mxroute avatar Sep 19 '25 16:09 mxroute

Same for me, can't even run compact.

edgardcham avatar Sep 19 '25 19:09 edgardcham

Can confirm i am getting the same error consistently using codex + cursor 1.6.27 on mac.

chris-thriveo avatar Sep 19 '25 20:09 chris-thriveo

I'm getting this error, it started it yesterday. any hope for fix?

necatituran avatar Sep 21 '25 04:09 necatituran

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.

Mac-V-Sog avatar Sep 21 '25 13:09 Mac-V-Sog

same on macbook pro M4 and Macos 26

yurgon avatar Sep 21 '25 14:09 yurgon

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: Image

tibo-openai avatar Sep 21 '25 17:09 tibo-openai

@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 avatar Sep 21 '25 17:09 zerox80

And i think the people here talk about the CLI, not the extension in VS Code.

zerox80 avatar Sep 21 '25 17:09 zerox80

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

edgardcham avatar Sep 21 '25 18:09 edgardcham

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.

scottyleics avatar Sep 21 '25 21:09 scottyleics

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: Image

Using latest CLI on MacBook, no current project/chat, fresh wipe of ~/.codex.

mxroute avatar Sep 21 '25 21:09 mxroute

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: Image

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?

minhdanh avatar Sep 21 '25 22:09 minhdanh

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: Image

This is exactly what the problem is. Its "Full"

TheWickie avatar Sep 21 '25 23:09 TheWickie

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: Image

This is exactly what the problem is. Its "Full"

I frequently hit this too, because I am using task master to guide the codex CLI to work on bigger scope of tasks, this can go on for hours. In claude code it auto compacts the context when it is full. I think people are looking for that auto compact feature.

shatteringtheabyss avatar Sep 22 '25 02:09 shatteringtheabyss

+1, context meter says 57% left. This is terrible UX.

EDIT: macOS 15.4, codex 0.39.

fullofcaffeine avatar Sep 22 '25 20:09 fullofcaffeine

same for me ! stream error: stream disconnected before completion: Your input exceeds the context window of this model. Its very annoying. Here i have to tell codex to work file local md files to not overload the context window. /compact forgets the previous conversation and codex needs to reanalyze the content... Switching back to Claude if now fix will be available....

TheSunnySideUpAT avatar Sep 23 '25 06:09 TheSunnySideUpAT

Same problem here on macOS 26 and codex CLI v0.39.0. It is really weird coz most of the time it worked after a few (like 3~5) retries. It just won't work at the very first try.

Liskie avatar Sep 23 '25 08:09 Liskie

I am using Codex CLI v0.39.0 and have encountered this issue in a new chat. My spending limits did not even reach 10%. The context meter says: '47.4K tokens used, 93% context left'

justchillinghere avatar Sep 23 '25 08:09 justchillinghere