Skip to content

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

Open

Description

@bharat-savaliya-altera

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

Activity

  1. added
    CLIIssues related to the Codex CLI
    windows-osIssues related to Codex on Windows systems
    tool-callsIssues related to tool calling
    on Jan 27, 2026
  2. added
    agentIssues related to the core agent loop
    and removed
    windows-osIssues related to Codex on Windows systems
    CLIIssues related to the Codex CLI
    tool-callsIssues related to tool calling
    on Jan 27, 2026
  3. etraut-openai commented on Jan 27, 2026

    @etraut-openai
    Contributor

    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.

  4. ahmed-ela commented on Jan 28, 2026

    @ahmed-ela

    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?

  5. ibabencu commented on Jan 31, 2026

    @ibabencu

    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.

  6. etraut-openai commented on Jan 31, 2026

    @etraut-openai
    Contributor

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

  7. atimmer commented on Feb 5, 2026

    @atimmer

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

  8. ibabencu commented on Feb 5, 2026

    @ibabencu
  9. etraut-openai commented on Feb 5, 2026

    @etraut-openai
    Contributor

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

  10. lamellama commented on Mar 18, 2026

    @lamellama

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

  11. pauldinu10 commented on Mar 23, 2026

    @pauldinu10

    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.

  12. added
    connectivityIssues involving networking or endpoint connectivity problems (disconnections)
    and removed
    agentIssues related to the core agent loop
    on Apr 11, 2026
  13. PZ123CLI commented on Jun 20, 2026

    @PZ123CLI

    stream disconnected before completion: stream closed before response.completed

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

    bugSomething isn't workingconnectivityIssues involving networking or endpoint connectivity problems (disconnections)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions