Skip to content

Stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses) #13245

Open

Description

@joe5saia

When using codex from the CLI I am frequently getting a "Reconnecting" message and codex fails to reconnect after 5 attempts. I see this message Stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses). The thread ID is 019caee5-4280-7290-a4ca-6456a7f599c4

Activity

  1. added
    bugSomething isn't working
    CLIIssues related to the Codex CLI
    on Mar 2, 2026
  2. etraut-openai commented on Mar 2, 2026

    @etraut-openai
    Contributor

    From your logs, this looks like a basic network connectivity issue. We see these frequently with VPNs and proxies, but it might also just be flakiness with your connection.

  3. joe5saia commented on Mar 2, 2026

    @joe5saia
    Author

    Cool Thank you. For additional context, I use Tailscale and have a hardwired connection to my router. No other VPNs running other than Tailscale. I see this issue about once an hour or so, but it's unpredictable.

  4. hhmoud-acerta commented on Mar 2, 2026

    @hhmoud-acerta

    @etraut-openai My thread ID is 019caf1f-0131-7303-8f3c-5d92be272875, any idea what is going on? Not using a VPN.

  5. etraut-openai commented on Mar 2, 2026

    @etraut-openai
    Contributor

    @hhmoud-acerta, yours looks like a connectivity issue as well. You mentioned you are not using a VPN. How about a corporate proxy or firewall?

  6. SaiKayala commented on Mar 2, 2026

    @SaiKayala

    Hi @etraut-openai , looks like even I'm facing the same issue, both on cli and codex app. I dont use any VPN nor behind any corporate firewall or proxy. It works well for few hours and then doesn't at all for few.

    Feedback id - 019caf97-3bf2-7361-ae77-16d4ba5ab89a

  7. 0xNiloy commented on Mar 2, 2026

    @0xNiloy

    Hey @etraut-openai I am getting the exact same issue .

    Here is the feedback ID : 019cb060-a88e-77b2-a9df-4bb9825f238d

  8. Supercox72 commented on Mar 7, 2026

    @Supercox72

    What can you tell me about these sessions?
    019cc2a1-ca49-7b11-b4b4-a1aeae73c146
    019cc43c-7ad5-7fe0-b4c7-ffcd5454d2fe

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

    I started getting this at my office on Wednesday evening March 4, 2026 and regularly receiving them at my home since then Wednesday through Friday March 6, 2026.

    Image
  9. Supercox72 commented on Mar 7, 2026

    @Supercox72

    Somebody recommended that I log out & that would fix it.

    Token exchange failed: error sending request for url (https://auth.openai.com/oauth/token)

    I took the bait... desperate to get this working again and then I can't get logged back in!
    Five separate times (& counting) without luck!

    Image
  10. added
    agentIssues related to the core agent loop
    and removed
    CLIIssues related to the Codex CLI
    on Mar 7, 2026
  11. yukuanj commented on Mar 11, 2026

    @yukuanj

    Somebody recommended that I log out & that would fix it.

    Token exchange failed: error sending request for url (https://auth.openai.com/oauth/token)

    I took the bait... desperate to get this working again and then I can't get logged back in! Five separate times (& counting) without luck!

    Image

    Same to me.

  12. s1f102500012 commented on Mar 12, 2026

    @s1f102500012

    I ran into the same issue on my Mac. After testing, I found that only Codex 5.3 in the CLI works; all models in the app, as well as the other models in the CLI, are unavailable for local tasks.

  13. cihadturhan commented on Mar 26, 2026

    @cihadturhan

    From your logs, this looks like a basic network connectivity issue. We see these frequently with VPNs and proxies, but it might also just be flakiness with your connection.

    This is not a network issue. Changing model works. I'm pretty sure there is a hidden rate-limit for openclaw bots that open ai doesn't tell. Because of this, I can't use Codex at all.

  14. phuturesh commented on Mar 31, 2026

    @phuturesh

    From your logs, this looks like a basic network connectivity issue. We see these frequently with VPNs and proxies, but it might also just be flakiness with your connection.

    This is not a network issue. Changing model works. I'm pretty sure there is a hidden rate-limit for openclaw bots that open ai doesn't tell. Because of this, I can't use Codex at all.

    It seems like I encountered the same situation, but changing model only works for a short while for me.

  15. Nowi5 commented on Apr 1, 2026

    @Nowi5

    Same issue. Looks like throtteling:

    Edited settings.py +9 -0
    Reconnecting... 1/5
    Reconnecting... 2/5
    Edited settings.py +0 -47
    Reconnecting... 1/5
    Reconnecting... 2/5
    Reconnecting... 3/5
    
  16. hasani114 commented on Apr 2, 2026

    @hasani114

    stream disconnected before completion: Connection reset by peer (os error 54)

    Image
  17. AndrewXiGua commented on Apr 3, 2026

    @AndrewXiGua
    Image

    threadID:019d5287-e006-7c20-85a8-8ab299d53d7e

  18. arjitj2 commented on Apr 6, 2026

    @arjitj2

    Same issue. threadID 019d5f83-d0c4-7ad0-a6cf-5b3b13cc287b

    Super frustrating.

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

    @windgentle

    我每天也遇到这个问题

  21. telami commented on May 13, 2026

    @telami

    same question

  22. anishp55 commented on May 17, 2026

    @anishp55

    i am having this issue with the CLI as well, it hard to tell exactly what is going on since i can't get any verbose output from the CLI, but it looks like its not even getting to the point of making any request to the server, since i am not seeing anything coming into my llama.cpp server from the codex cli session. and this is with a local model that i can use with the Zoo Code extension in vscode.

  23. lwen554 commented on May 28, 2026

    @lwen554

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

    我一直提示这样,使用的codex客户端昨天下午还好好的,但是突然到了晚上就不行了,一直reconnecting...然后得到上面那一串。。。到底改怎么解决

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