OpenAI Codex CLI error
Codex CLI: stream disconnected before completion: error sending request for url...
stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses)Status: OpenLast verified 3 documented fixes2 sources
What it means
Codex could not send the request to the Codex responses endpoint at all, so it shows "Reconnecting" and fails after its retry attempts.
Causes
- Maintainer etraut-openai on #13245: from uploaded logs this looks like a basic network connectivity issue; seen frequently with VPNs and proxies, or simple connection flakiness.
- Maintainers also asked users without a VPN whether a corporate proxy or firewall was in the path (#13245).
How to fix it
- Fix 1.
Check VPNs, proxies, corporate proxies and firewalls between your machine and chatgpt.com (maintainer etraut-openai on #13245).
- Fix 2.
If your network uses a corporate TLS proxy or private root CA, point Codex at the PEM bundle; the same CA settings apply to login, normal HTTPS requests and WebSocket connections (official auth docs).
Terminalexport CODEX_CA_CERTIFICATE=/path/to/corporate-root-ca.pem - Fix 3.
If it persists, run /feedback to upload logs and share the thread ID with maintainers.
Slash command/feedback
More Codex CLI errors
All 14 Codex CLI errorsstream disconnected before completion: stream closed before response.completedStatus: WorkaroundError running remote compact task: stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses/compact)Status: Fixed in releaseSelected model is at capacity. Please try a different model.Status: By designYour access token could not be refreshed because your refresh token was already used. Please log out and sign in again.Status: Fixed in releaseCodex ran out of room in the model's context window. Start a new thread or clear earlier history before retrying.Status: Fixed in releaseError logging in: Port 127.0.0.1:1455 is already in useStatus: WorkaroundToken exchange failed: token endpoint returned status 403 ForbiddenStatus: WorkaroundMCP client for `playwright` failed to start: program not foundStatus: Fixed in release
Related reading
- Codex CLI 0.163: Instant Steering Is Now the DefaultCodex CLI 0.163.0 makes mid-response steering the default and adds searchable /config and a leader key. What changed and what to check before upgrading.
- Codex 'gpt-5.5 Model Is Not Supported' Error: The FixCodex says gpt-5.5 is not supported with a ChatGPT account because OpenAI retired it from ChatGPT sign-in on October 14. The fix and what still works.
- Agent Harness Lessons From a 500B-Token Decompile: Give Agents a PASS/FAIL OracleAgent harness lessons from a 500B+ token decompile: a byte-matching PASS/FAIL oracle beat the reviewer agent. How agents cheated it and what to copy.
- Codex CLI Background Daemon: How to Turn It OffCodex CLI starts a persistent, self-updating background daemon since 0.157.0. What it does, why it hit Hacker News and the reported workaround to turn it off.
- Codex CLI 0.162: Managed Worktrees and Pinned TasksCodex CLI 0.162 lets the agent create and list its own Git worktrees, adds pinned tasks and custom provider capability overrides. What to change this week.
- ChatGPT Free vs Go vs Plus After GPT-6: Which Model You GetFree and Go ($8) both get GPT-6 Luna in Chat. Plus ($20) is the cheapest plan with GPT-6 Sol and full Codex. What each ChatGPT plan buys now.
FAQ
What does "stream disconnected before completion: error sending request for url..." mean in Codex CLI?
Codex could not send the request to the Codex responses endpoint at all, so it shows "Reconnecting" and fails after its retry attempts.
How do I fix "stream disconnected before completion: error sending request for url..."?
There are 3 documented fixes. Start with the first: Check VPNs, proxies, corporate proxies and firewalls between your machine and chatgpt.com (maintainer etraut-openai on #13245).
Is this Codex CLI error fixed?
Status: Open. Still open upstream. Any documented fixes are workarounds so far. Affected versions: Reported March 2026 (#13245); no version-specific fix announced
Sources
Last verified against 2 sources: official docs, maintainer replies and release notes.
- github.comhttps://github.com/openai/codex/issues/13245
- learn.chatgpt.comhttps://learn.chatgpt.com/docs/auth
Newsletter
Fixes for the tools you use, weekly
One email per week. New coding agent releases, what broke, and how developers are working around it.