How to Fix Codex Reconnecting
Summary: Does Codex Desktop keep showing 5 Reconnecting errors when you start a new chat? This article provides the most complete HTTP/SSE fallback solution — by editing
config.tomlto force WebSocket off, you can solve the repeated reconnection issue on your first question under a proxy in just 2 minutes.
📚 Table of Contents (Click to Jump)
- 1. Bottom Line First: Quick Fix
- 2. Symptoms: Codex New Chat 5 Times Reconnecting
- 3. When This Fix Applies
- 4. Root Cause Analysis
- 5. Step-by-Step Fix
- 6. Complete config.toml Example
- 7. How the Key Settings Work
- 8. How to Verify and Test
- 9. FAQ
1. Bottom Line First (Fastest Fix)
5 Reconnecting errors on new chats in Codex Desktop is a common issue for many users on a proxy. The core fix: add a new OpenAI Provider to config.toml that forces the HTTP/SSE protocol, and set it as the default.
Just copy the config below to fix 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 chat history list may only show records from the new provider — this is normal.
2. Symptoms: Are You Seeing This?

When using Codex Desktop, the following things often happen:
- The first message in a new chat (New Chat) pops up 5 Reconnecting errors in a row
- The very first question right after launching the app always reconnects
- Later conversations are completely fine; only new chats tend to trigger it
- It's especially noticeable when a local proxy is active (e.g. 127.0.0.1:10808), and rarely occurs on a direct connection
If you match these symptoms, the HTTP/SSE fix in this article will completely solve your problem.
3. When This Fix Applies (or Not)
✅ This fix works if:
- You can log in to Codex normally
- You eventually get an answer, but the first request in a new chat keeps Reconnecting
- You're using a VPN/local proxy tool
❌ This fix won't help if:
- You can't log in at all or see a blank screen
- All requests permanently fail
- Your proxy node itself can't reach OpenAI services
4. Root Cause: Why Does a New Codex Chat Keep Reconnecting?
Codex uses WebSocket for streaming by default. While efficient, it's very sensitive to local proxies. Any hiccup in the WebSocket handshake (Upgrade), TLS tunneling, or long-lived connection can trigger the auto-reconnect mechanism, which usually retries about 5 times.
Best approach: instead of changing the retry count, abandon WebSocket entirely and force the proxy-friendlier HTTP/SSE (Server-Sent Events) streaming response.
5. Step-by-Step Fix
Step 1: Fully quit Codex Desktop
Step 2: Back up the config file
The config file path is usually: C:\Users\你的用户名\.codex\config.toml
Backup command in PowerShell:
Copy-Item "$env:USERPROFILE\.codex\config.toml" "$env:USERPROFILE\.codex\config.toml.bak"

Step 3: Edit config.toml
Change the
model_providerat the top to: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-chat Reconnecting)
[model_providers.openai_http]
name = "OpenAI HTTP only"
wire_api = "responses"
supports_websockets = false
requires_openai_auth = true7. How the Key Settings Work
| Setting | What it does |
|---|---|
model_provider = "openai_http" | Sets the HTTP-protocol Provider as the default |
supports_websockets = false | The most critical: disables WebSocket and forces HTTP/SSE |
requires_openai_auth = true | Keeps using your web login session, no API Key needed |
wire_api = "responses" | Keeps using the advanced Responses API |
8. How to Verify and Test
Verify from the command line:
bashcodex debug models
Open Codex → start a new chat → type "Hello"

- Check whether the repeated Reconnecting errors are gone
9. FAQ
Q1: What's the most common cause of 5 Reconnecting errors on a new chat in Codex Desktop?
A: A handshake failure caused by your local proxy's poor support for the WebSocket protocol upgrade.
Q2: Will switching to HTTP/SSE affect answer quality?
A: Not at all — it only changes the transport protocol; the model's capabilities and context remain the same.
Q3: Do I need an OpenAI API Key?
A: No — requires_openai_auth = true keeps using your web login 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 move to a lower-latency node.
