Codex Desktop New Session Shows 5 Times Reconnecting? Perfect HTTP/SSE Fix (2026 Latest)
Summary: Codex Desktop frequently shows 5 times Reconnecting when starting a new session? This article provides the most thorough HTTP/SSE fallback solution — force-disable WebSocket by editing
config.toml. In just 2 minutes you can resolve the repeated reconnection on the first question under a proxy environment.
📚 Table of Contents (click to jump)
- 1. Conclusion first: quick fix
- 2. Symptom: Codex new session 5 times Reconnecting
- 3. Applicable scenario check
- 4. Root cause analysis
- 5. Step-by-step fix guide
- 6. Complete config.toml example
- 7. Core configuration explained
- 8. Configuration verification & testing
- 9. FAQ
1. Conclusion First (Fastest Fix)
Codex Desktop showing 5 times Reconnecting on new sessions is a common issue many users encounter when using a proxy. Core solution: add an OpenAI Provider to config.toml that forces the HTTP/SSE protocol, and set it as the default.
Just copy the following config to solve it:
model_provider = "openai_http"
[model_providers.openai_http]
name = "OpenAI HTTP only"
wire_api = "responses"
supports_websockets = false
requires_openai_auth = trueNote: after switching, the history list may only show records under the new Provider — this is normal.
2. The Symptom: Is This What You're Experiencing?

When using Codex Desktop, the following often happens:
- Sending the first message in a new chat triggers 5 consecutive Reconnecting prompts
- The first question right after the app starts always reconnects
- Subsequent conversations work perfectly fine — only new sessions tend to trigger it
- It's especially obvious when using a local proxy (e.g., 127.0.0.1:10808); it rarely happens on a direct connection
If you match these characteristics, the HTTP/SSE fix in this article will completely resolve your issue.
3. Applicable & Non-Applicable Scenarios
✅ Applicable to this solution:
- Codex can sign in normally
- You eventually get an answer — it's just that the first request in a new session repeatedly Reconnects
- You're using a VPN/local proxy tool
❌ Not applicable to this solution:
- You can't sign in at all or get a blank screen
- All requests permanently fail
- The proxy node itself can't access OpenAI services
4. Root Cause: Why Does Codex Keep Reconnecting on New Sessions?
Codex prefers to use WebSocket for streaming by default. Although efficient, it's very sensitive to local proxies. Any slight instability in the WebSocket handshake (Upgrade), TLS tunneling, or long-lived connection keep-alive will trigger the automatic reconnection mechanism, typically retrying about 5 times.
Best approach: instead of changing the retry count, completely abandon WebSocket and force the use of HTTP/SSE (Server-Sent Events) streaming responses, which have much better proxy compatibility.
5. Step-by-Step Fix Guide
Step 1: Completely quit Codex Desktop
Step 2: Back up the configuration file
The config file path is usually: C:\Users\YourUsername\.codex\config.toml
PowerShell backup command:
Copy-Item "$env:USERPROFILE\.codex\config.toml" "$env:USERPROFILE\.codex\config.toml.bak"

Step 3: Edit config.toml
Change the top
model_providerto:tomlmodel_provider = "openai_http"
Append the following at the very bottom of the file:
toml[model_providers.openai_http] name = "OpenAI HTTP only" wire_api = "responses" supports_websockets = false requires_openai_auth = true
Step 4: Save and restart Codex Desktop
6. Complete config.toml Example
model_provider = "openai_http"
model = "gpt-5.5"
model_reasoning_effort = "high"
[windows]
sandbox = "elevated"
# HTTP/SSE-only Provider (fixes new session Reconnecting)
[model_providers.openai_http]
name = "OpenAI HTTP only"
wire_api = "responses"
supports_websockets = false
requires_openai_auth = true7. Core Configuration Explained
| Config option | Explanation |
|---|---|
model_provider = "openai_http" | Sets the default Provider to use the HTTP protocol |
supports_websockets = false | Most critical: disables WebSocket, forcing HTTP/SSE |
requires_openai_auth = true | Keeps using the web sign-in session — no API Key needed |
wire_api = "responses" | Keeps using the advanced Responses API |
8. Configuration Verification & Testing
Verify via the command line:
bashcodex debug models
Open Codex → start a new session → type "Hello"

- Check whether the repeated Reconnecting prompts no longer appear
9. FAQ
Q1: What's the most common cause of Codex Desktop new sessions showing 5 times Reconnecting?
A: Handshake failure caused by the local proxy's poor support for WebSocket protocol upgrades.
Q2: Will switching to HTTP/SSE affect model answer quality?
A: Not at all — it only changes the transport protocol; model capability and context remain unchanged.
Q3: Do I need to apply for an OpenAI API Key?
A: No. requires_openai_auth = true will keep using your web sign-in authorization.
Q4: What if the app crashes after the change?
A: It's most likely a TOML format error — just restore from the backup file.
Q5: What if it still reconnects occasionally?
A: Keep optimizing your proxy client core (e.g., switch to Sing-box), or switch to a lower-latency node.