Skip to content

Continuously reconnecting: "stream disconnected before completion" #10378

Closed

Description

@StativBus

What version of the VS Code extension are you using?

0.4.68

What subscription do you have?

Business

Which IDE are you using?

VS Code

What platform is your computer?

Windows

What issue are you seeing?

Codex keeps working for the most part. It just takes longer because after some thinking steps it shows this:

Reconnecting... 1/5
stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses)

If it counts up to 5 the task is stopped. I can then just type something like "retry" and it usually works again.

Given that it does work somewhat I assume it cannot be that the FIrewall is blocking it right? What could be potential troubleshoots?

What steps can reproduce the bug?

Any usage of the extension.

What is the expected behavior?

No "Reconnecting" messages.

Additional information

The firewall has caused issues before.
I am using this on Windows in the sandbox without WSL.

Activity

  1. added
    bugSomething isn't working
    windows-osIssues related to Codex on Windows systems
    sandboxIssues related to permissions or sandboxing
    on Feb 2, 2026
  2. etraut-openai commented on Feb 2, 2026

    @etraut-openai
    Contributor

    Please use the /feedback command to upload logs and session details and post the thread ID here.

    Are you using any non-default config.toml settings? Are you using an Azure endpoint, a corporate LLM proxy, or is this the default OpenAI endpoint?

  3. StativBus commented on Feb 2, 2026

    @StativBus
    Author

    Hi, thank you for the quick response! I am using all detault settings. I can't say this with 100% certainty, but I believe its the default OpenAI endpoint. The ID of an exemplary chat (it happens in all of them) is: 019c0ee3-1933-72b2-bdc6-c5d5f823460a

  4. etraut-openai commented on Feb 2, 2026

    @etraut-openai
    Contributor

    I looked at your logs. This appears to be a basic network connectivity issue. You'll need to debug on your end. Check for things like firewalls, network proxies (TLS handshakes), VPNs, or DNS issues. If you're on a corporate network, your IT team may be able to help.

  5. StativBus commented on Feb 4, 2026

    @StativBus
    Author

    Thank you for checking. Yes, you appear to be right. Even though we are not using a VPN, there appear to be some additional firewall settings or the like because the issue does NOT appear when in the office. Does this point to something specific that I could tell our IT or is this too little information to go off of. If so, feel free to close the issue. You are right in that it is an issue on my end.

  6. etraut-openai commented on Feb 4, 2026

    @etraut-openai
    Contributor

    You can tell your IT that https://chatgpt.com/backend-api/codex/responses is the endpoint that Codex needs to access.

  7. Iris2762 commented on Apr 16, 2026

    @Iris2762

    I also met this problem today. I sent a easy message to codex, but it kept reconnect, and finally said "stream disconnected before completion: stream closedbefore response.completed"

    Image

    I tried to turn off my VPN, and switching WIFI to my personal hotspot. The two ways didn't solve my problem. And finally, I checked the config file:C:\Users\admin.codex\config.toml, and I found that the base_url is not openai_base_url, it's other providers.

    I suddenly remembered that I use CC-switch before, and I configured codex provider in CC-switch, it overlap config infomation of codex itself.

    after I delete the configuration of cc-switch codex, my codex app can response correctly.
    I put my solution here ,farion1231/cc-switch#1490 (comment)
    Image

  8. LukasWillin commented on Jul 21, 2026

    @LukasWillin

    I seemed to be able to mostly "fix" / work around this issue by following this link (https://learn.chatgpt.com/docs/config-file/config-advanced#azure-provider-and-per-provider-tuning) and setting:

    [model_providers.azure]
    name = "Azure OpenAI"
    base_url = "****"
    env_key = "****"
    wire_api = "responses"
    request_max_retries = 100 # should prevent disconnect issues
    stream_max_retries = 100 # should prevent disconnect issues
    stream_idle_timeout_ms = 300000 # should prevent disconnect issues

    I don't know however if this works outside the Azure AI Foundry provider.

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 workingextensionIssues related to the VS Code extensionsandboxIssues related to permissions or sandboxingwindows-osIssues related to Codex on Windows systems

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions