Skip to content

Stream disconnected before completion #3924

Closed

Description

@YoloMark98

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

Activity

  1. added
    bug
    on Sep 19, 2025
  2. BinaryBeastMaster commented on Sep 19, 2025

    @BinaryBeastMaster

    For me running /compact fixes it

  3. mxroute commented on Sep 19, 2025

    @mxroute

    Consistently receiving this on my MacBook as well.

  4. edgardcham commented on Sep 19, 2025

    @edgardcham

    Same for me, can't even run compact.

  5. chris-thriveo commented on Sep 19, 2025

    @chris-thriveo

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

  6. necatituran commented on Sep 21, 2025

    @necatituran

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

  7. Mac-V-Sog commented on Sep 21, 2025

    @Mac-V-Sog

    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.

  8. yurgon commented on Sep 21, 2025

    @yurgon

    same on macbook pro M4 and Macos 26

  9. tibo-openai commented on Sep 21, 2025

    @tibo-openai
    Collaborator

    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

  10. zerox80 commented on Sep 21, 2025

    @zerox80

    @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

  11. zerox80 commented on Sep 21, 2025

    @zerox80

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

  12. edgardcham commented on Sep 21, 2025

    @edgardcham

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

  13. scottyleics commented on Sep 21, 2025

    @scottyleics

    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.

  14. mxroute commented on Sep 21, 2025

    @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

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

  15. minhdanh commented on Sep 21, 2025

    @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

    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?

  16. 27 remaining items

  17. p3x-robot commented on Oct 9, 2025

    @p3x-robot

    i deleted the whole ~/.codex folder and it works.

  18. fullofcaffeine commented on Oct 9, 2025

    @fullofcaffeine

    +1, seems to only happen with gpt5-high for me. So frustrating.

  19. shenfangqi123 commented on Oct 11, 2025

    @shenfangqi123

    had the same issue, no idea what it was, but when I start a new chat then it seem to be fixed.

  20. ashe0047 commented on Oct 13, 2025

    @ashe0047

    Still happening, what is this mess

  21. ashe0047 commented on Oct 13, 2025

    @ashe0047

    Billion dollar company but cant even handle stream errors

  22. p3x-robot commented on Oct 13, 2025

    @p3x-robot

    Still happening, what is this mess

    i deleted the whole ~/.codex folder and it works.

  23. p3x-robot commented on Oct 13, 2025

    @p3x-robot

    Billion dollar company but cant even handle stream errors

    i deleted the whole ~/.codex folder and it works.

  24. Hexthebaldy commented on Oct 15, 2025

    @Hexthebaldy

    i met the same problem using gpt5-high, run /compact manually and it works

  25. evzz74 commented on Oct 15, 2025

    @evzz74

    I use /model or /init also have the same problem ,this is why?

  26. Aniurm commented on Oct 20, 2025

    @Aniurm

    I've suffered a lot in thie problem.

    Please fix it ASAP

  27. mxroute commented on Oct 20, 2025

    @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

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

    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.

  28. WilliamWatcher commented on Oct 22, 2025

    @WilliamWatcher

    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?

  29. changed the title [-]⚠️ stream error: stream disconnected before completion. !HELP[/-] [+]Stream disconnected before completion[/+] on Nov 14, 2025
  30. etraut-openai commented on Nov 18, 2025

    @etraut-openai
    Contributor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions