2026 Latest | What to Do About 5 'Reconnecting' Messages on Every New Codex Desktop Session? One-Click Fix Guide with Local Proxy HTTP/SSE

6/7/2026 Codex Desktop new session reconnecting 5 timesCodex frequent reconnectionconfig.toml modificationWebSocket proxy jitterHTTPS/SSE streaming responseCodex network error fixOpenAI_HTTP configuration

Summary (Snippet): When using the Codex client, have you ever been troubled by "Codex Desktop shows 5 'Reconnecting' messages on every new session"? This is usually not a model or account issue, but rather an incompatibility between your local proxy and the WebSocket protocol. This article provides a perfect HTTP/SSE downgrade fix — simply modifying the config.toml file is enough to completely eliminate the repeated reconnection problem on Codex's first question.


# 📚 Table of Contents


1. Conclusion First (Quick Fix)

14

If Codex Desktop shows about 5 reconnecting messages in a row the first time you send a request, or when you start a new conversation, but it still responds correctly after reconnecting, it's most likely not that the model is unavailable, but that the first streaming connection experienced WebSocket jitter when passing through your local network proxy.

The ultimate solution: In Codex's config.toml configuration file, add a new OpenAI Provider that forces the HTTP/SSE protocol and set it as the default. This perfectly avoids the WebSocket instability in the proxy chain.

Core code (just add it to your configuration):

model_provider = "openai_http"

[model_providers.openai_http]
name = "OpenAI HTTP only"
wire_api = "responses"
supports_websockets = false
requires_openai_auth = true

Note: After switching to openai_http, the history list on the right may only show conversations under the new Provider. This is normal and does not mean your account or model has been replaced.


2. The Symptom: Is This What You're Experiencing?

When you search for "Codex Desktop shows 5 'Reconnecting' messages on every new session", the following typical characteristics usually come with it:

Symptom Detailed description
First question reconnects wildly Every time you open the software and send your first message, it typically prompts reconnection about 5 times before starting to output text.
Easily reproduced with a new session Even if the software isn't closed, as long as you start a new chat via New Chat, the first request is still prone to jitter.
Subsequent conversations are completely normal Once the first message is sent successfully, the following continuous conversation is extremely smooth (ruling out account/model bans).
Especially noticeable with a proxy enabled Direct connection works fine, but when a local proxy (such as 127.0.0.1:10808) is mounted, it always reproduces.

3. Applicable and Non-Applicable Scenario Check

Before you start modifying, please check the following scenarios to confirm whether this solution suits you:

✅ Perfectly applicable to this solution:

  • Your Codex Desktop account can log in normally.
  • You can eventually get model answers; it's just that the first request or new session request frequently reports reconnecting.
  • Your computer has a network proxy / VPN tool enabled.

❌ Not applicable to this solution (needs a different troubleshooting direction):

  • Codex cannot log in at all — white screen or network errors.
  • All model requests fail 100%, no matter how long you wait.
  • The proxy tool's own nodes are dead and chatgpt.com cannot be accessed.
  • You are fully blocked by the company intranet firewall or antivirus software.

4. Core Cause: Why Does It Keep Reconnecting?

Codex's default OpenAI Provider prioritizes transport over WebSocket. WebSocket is extremely efficient by itself, but it is very sensitive to network proxy chains.

When a request passes through your local proxy, any instability in the following links can trigger an automatic reconnection:

  1. WebSocket Upgrade (protocol upgrade): Some proxy software doesn't perfectly support upgrading from HTTP to WebSocket.
  2. Long-lived connection maintenance: When establishing a long-lived connection for the first time, it may be unexpectedly cut off by the proxy client or underlying network middleware.
  3. TLS Tunneling: The proxy's HTTPS tunnel handshake may have latency or jitter.
  4. Automatic retry mechanism: As soon as Codex detects a disconnect, it immediately initiates a retry (usually requiring about 5 attempts before a successful downgrade or pass-through).

The way out: Don't try to change Codex's retry count. Instead, make it give up WebSocket entirely and switch to HTTP/SSE (Server-Sent Events) streaming, which is extremely proxy-friendly.


5. Step-by-Step Fix Guide

# Step 1: Completely close Codex Desktop

Please make sure to exit and fully close the Codex Desktop program first, to prevent the software from overwriting your configuration changes or causing file-occupancy conflicts.

# Step 2: Locate and back up the configuration file

The configuration file config.toml is usually located at the following path: C:\Users\YourUsername\.codex\config.toml

To be safe, it's recommended to run the following command in PowerShell to back it up:

Copy-Item "$env:USERPROFILE\.codex\config.toml" "$env:USERPROFILE\.codex\config.toml.bak"

15

16

# Step 3: Edit config.toml

Open the file with Notepad or VS Code.

1. Change the default Provider Find model_provider at the top of the file and change it to:

model_provider = "openai_http"

17

(Note: if this field already exists, just change the value — don't add a duplicate second line)

2. Append the HTTP Provider definition

Scroll to the very end of the file and paste the following code:

[model_providers.openai_http]
name = "OpenAI HTTP only"
wire_api = "responses"
supports_websockets = false
requires_openai_auth = true

18

# Step 4: Save and restart

Save the file, then restart Codex Desktop. Create a new session and send a message — watch the magic happen.


6. Complete config.toml Configuration Example

If your configuration file is fairly blank, or you don't know where to insert the changes, you can refer to this structurally complete, out-of-the-box example below. (Keep your original sandbox, plugin, and other configuration unchanged)

# Set the global default Provider to the HTTP mode we just created
model_provider = "openai_http"
model = "gpt-5.5"
model_reasoning_effort = "high"

[windows]
sandbox = "elevated"

# =========== Below is the newly added HTTP-specific Provider ===========
[model_providers.openai_http]
name = "OpenAI HTTP only"
wire_api = "responses"
supports_websockets = false
requires_openai_auth = true


7. Analysis of the Core Configuration Parameters

If you understand the principles, you can easily handle variant problems too:

Configuration parameter Core purpose analysis
model_provider = "openai_http" Points the default LLM provider to our custom module.
[model_providers.openai_http] Declares a new Provider; the advantage is that it doesn't break the native openai configuration, making it easy to roll back at any time.
wire_api = "responses" Keeps using the native advanced Responses API interface.
supports_websockets = false The core magic: directly blocks the WebSocket handshake, forcing a downgrade to stable HTTP/SSE.
requires_openai_auth = true Inherits Codex/OpenAI's web login state (SSO), so you don't need to set up an API Key yourself.

8. How to Verify the Configuration

If you're not sure whether you changed it correctly, you can quickly debug with the command-line tool:

Open a terminal and enter the following command:

codex debug models

19

If the system returns a normal model list without any syntax errors, your config.toml changes are completely correct.

20

Final test: Go back to the software, start a New Chat and send "Hello". If it responds instantly without the annoying reconnecting messages, the local proxy handshake problem has been successfully avoided!


9. Frequently Asked Questions (FAQ)

Q1: On the Codex desktop client, the first question of a new session keeps reconnecting. What's the most core reason? A: If subsequent conversations work normally, the most common cause is that your local network proxy software isn't stable enough in supporting WebSocket protocol upgrade or long-lived connection maintenance.

Q2: Will disabling WebSocket and switching to HTTP/SSE affect code generation quality or model intelligence? A: Absolutely not. This merely changes the "data-transport highway" between the client and server; the cargo in the truck (the AI model's capabilities and context) doesn't change at all.

Q3: Does this method require me to bind a credit card in the OpenAI backend to generate an API Key? A: No. The requires_openai_auth = true in the configuration means it will continue to use your client's built-in login authorization state.

Q4: Why is it not recommended to just modify the original default openai provider directly? A: Creating a new openai_http offers a non-destructive modification. Future Codex client updates may overwrite the default configuration; an independent configuration is easier to maintain, and if anything goes wrong, you can simply delete it to restore everything.

Q5: After changing the configuration, Codex won't open / crashes immediately. What should I do? A: This means there's a punctuation error in config.toml (for example, a missing quote or bracket). Just delete the newly added code, or restore the .bak file you backed up in Step 2.

Q6: I followed the steps, but it still reconnects often. What should I do? A: If it still disconnects in HTTP mode, focus your troubleshooting on:

  1. Whether your proxy node itself has high latency or frequent packet loss.
  2. Try switching the proxy client's core (for example, from Xray to Sing-box).
  3. Check whether the system global proxy settings conflict with the software's actual request path.
  4. Make sure the Codex client has been upgraded to the latest available version.