Codex Desktop New Chat Reconnecting 5 Times? Fix It with One Config Change
📚 Table of Contents
- 1. The Bottom Line: Quick Fix
- 2. The Problem: Does This Sound Like You?
- 3. Does This Fix Apply to You?
- 4. Why Does Codex Keep Reconnecting in a New Chat?
- 5. Step-by-Step Fix
- 6. Complete config.toml Example
- 7. What Each Config Option Does
- 8. How to Verify the Fix
- 9. FAQ
1. The Bottom Line: Quick Fix
Codex Desktop showing "Reconnecting" 5 times in a new chat is a common problem for users on a proxy. The core fix: add an OpenAI provider that forces the HTTP/SSE protocol in config.toml, and make it the default.
Just copy this config and you are done:
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 conversations under the new provider. That is expected behavior.
If you do not have Codex Desktop installed yet, start with the Codex App Guide.
2. The Problem: Does This Sound Like You?

When using Codex Desktop, have you seen any of these:
- Your first message in a new chat (New Chat) triggers 5 Reconnecting popups in a row
- The very first question after launching the app always reconnects
- Everything is fine afterward — only new chats trigger it
- It is most obvious with a local proxy (e.g. 127.0.0.1:10808); direct connections rarely hit it
If this matches your situation, the HTTP/SSE fix below will resolve it.
3. Does This Fix Apply to You?
✅ This fix works if:
- Codex signs in normally
- You eventually get an answer — it is only the first request of a new chat that keeps reconnecting
- You are using a proxy / VPN tool
❌ This fix does not apply if:
- You cannot sign in at all or see a blank screen
- Every request fails permanently
- The proxy node itself cannot reach OpenAI's servers
Want to compare Codex quotas across plans? See the Codex Quota Comparison.
4. Why Does Codex Keep Reconnecting in a New Chat?
Codex prefers WebSocket for streaming by default. It is efficient, but it is very sensitive to local proxies. If anything jitters in the WebSocket handshake (Upgrade), the TLS tunnel, or the long-lived connection, Codex triggers its automatic reconnection — usually about 5 retries.
Many articles about this issue tell you to "switch nodes" or "just retry." That only treats the symptom. This article takes a different approach: don't switch nodes, don't change the retry count — drop WebSocket entirely and force the more proxy-friendly HTTP/SSE (Server-Sent Events) streaming instead.
5. Step-by-Step Fix
Step 1: Fully close Codex Desktop
Step 2: Back up the config file
The config file is located at:
- Windows:
C:\Users\your-username\.codex\config.toml - macOS / Linux:
~/.codex/config.toml
If you cannot find the file, run codex --version once to let Codex generate a default config, then continue.
PowerShell backup command:
Copy-Item "$env:USERPROFILE\.codex\config.toml" "$env:USERPROFILE\.codex\config.toml.bak"

Step 3: Edit config.toml
Change
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 provider (fixes Reconnecting in new chats)
[model_providers.openai_http]
name = "OpenAI HTTP only"
wire_api = "responses"
supports_websockets = false
requires_openai_auth = true7. What Each Config Option Does
| Config option | What it does |
|---|---|
model_provider = "openai_http" | Makes the HTTP-only provider the default |
supports_websockets = false | The key one: disables WebSocket, forces HTTP/SSE |
requires_openai_auth = true | Keeps using your web login — no API Key |
wire_api = "responses" | Keeps using the newer Responses API |
8. How to Verify the Fix
Verify from the command line:
bashcodex debug models
Open Codex → New Chat → type "hello"

Confirm that Reconnecting no longer keeps popping up
Pros and Cons
What this HTTP/SSE fix gets you
- Treats the root cause: no need to switch nodes or change retry counts — it bypasses the WebSocket handshake failure entirely
- Zero cost: one config change, no API Key — you keep using your web login
- No quality impact: only the transport protocol changes; model capability and context stay the same
Limitations / things to note
- Only applies if you can sign in and only the first message of a new chat reconnects; it won't help if you can't sign in at all
- After switching, history may only show conversations under the new provider
- If it still reconnects occasionally, the proxy node itself is unstable — you'll need to optimize the node
Who It's For
- Users behind a proxy who see Codex reconnect repeatedly on the first message of a new chat
- People who'd rather fix it with a config change than keep switching nodes / retrying
- Developers whose Codex signs in fine but whose handshake is unstable in a proxy environment
9. FAQ
Q1: What is the most common cause of Codex Desktop showing "Reconnecting" 5 times in a new chat? A: A local proxy's poor support for the WebSocket protocol upgrade causes the handshake to fail.
Q2: Does switching to HTTP/SSE affect response quality? A: No. It only changes the transport protocol; model capability and context remain exactly the same.
Q3: Do I need an OpenAI API Key for this? A: No. requires_openai_auth = true keeps using your web login authorization.
Q4: What if Codex crashes after I change the config? A: It is almost always a TOML syntax error. Restore the config.toml.bak backup to recover.
Q5: What if it still reconnects occasionally? A: The proxy node itself is probably unstable. Try optimizing the proxy client core (for example switching to Sing-box) or use a lower-latency node.
Need Codex? Check out the Codex top-up page for supported plans, payment methods, and delivery.
