Repository navigation
[macOS Desktop] Codex stuck in “Reconnecting... waiting for network” while Browser Codex works; durable WebSocket closes with code 1006 #51399
Description
What version of the Codex App are you using (From “About Codex” dialog)?
Powered by Codex & OWL 版本 26.930.61225
What subscription do you have?
plus
What platform is your computer?
macos
What issue are you seeing?
Summary
Codex inside the ChatGPT macOS desktop app is consistently stuck in:
Reconnecting... waiting for network
and eventually reports:
Connection failed: error sending request
The same ChatGPT account works normally in Browser Codex on the same Mac and the same network/VPN.
Terminal Codex also remains usable through a separate API/custom-provider configuration, so the failure appears isolated to the ChatGPT/Codex macOS desktop transport.
The desktop logs repeatedly show that the durable app-server WebSocket is closed before the connection is established, with close code 1006.
Environment
- Platform: macOS / Apple Silicon
- Product: ChatGPT macOS Desktop, Codex workspace
- Desktop app: latest version available as of October 6, 2026
- Bundled Codex Framework observed: 154.0.8037.98
- Authentication: ChatGPT account
- VPN/proxy:
- HTTP/HTTPS system proxy: 127.0.0.1:21081
- SOCKS proxy: 127.0.0.1:21080
- Issue reproduces in both:
- macOS System Proxy mode
- TUN mode
Actual behavior
Every Codex request in the macOS desktop app enters a reconnect loop:
Reconnecting... waiting for network
The response never completes normally.
A minimal reproduction such as:
"Reply with only OK"
also fails.
Desktop log evidence
The desktop log repeatedly contains:
Starting app-server connection hostId=durable transport=websocket
followed by:
WebSocket was closed before the connection was established
and:
app_server_connection.closed code=1006
The app then repeatedly increments reconnectAttempt and retries the durable WebSocket connection.
Example sequence:
- hostId=durable
- transport=websocket
- connection_failed_before_ready
- closeCode=1006
- wasInitialized=false
- repeated reconnect attempts
The codex_apps MCP connection also reports:
HTTP request failed: error sending request for url
https://chatgpt.com/backend-api/ps/mcp
Important control tests
Browser Codex
PASS.
Browser Codex works normally using:
- the same ChatGPT account
- the same Mac
- the same VPN/network
HTTPS reachability
PASS.
The Codex responses endpoint is reachable through the local proxy:
https://chatgpt.com/backend-api/codex/responses
Test result:
HTTP/1.1 200 Connection Established
HTTP/2 405
Allow: POST
This demonstrates that DNS, TCP, TLS, the VPN exit, chatgpt.com, and the HTTPS Codex endpoint itself are reachable.
TLS
PASS.
Connections through the local proxy successfully establish TLS 1.3.
The certificate for chatgpt.com is valid and issued by Google Trust Services.
No TLS interception was observed.
Troubleshooting already completed
The following did NOT resolve the issue:
- Restarted ChatGPT Desktop
- Fully terminated ChatGPT/Codex Desktop processes
- Changed VPN nodes
- Tested macOS System Proxy mode
- Tested TUN mode
- Updated ChatGPT Desktop to the latest available version
- Completely reinstalled ChatGPT Desktop
- Reset the ChatGPT Desktop local application state
- Recreated the desktop application data
- Retested with a fresh Codex conversation
Desktop-only state was reset while preserving the working standalone CLI Codex environment.
The problem still reproduces after a clean reinstall and fresh desktop state.
Additional observation
When the VPN client is switched to "proxy listener only" mode, ChatGPT Desktop no longer uses the VPN path and returns:
unsupported_country_region_territory
This mode is therefore not a valid workaround.
System Proxy and TUN modes both route ChatGPT successfully, but Desktop Codex still fails.
Expected behavior
Codex Desktop should establish its durable app-server / task connection and execute requests normally, as Browser Codex does on the same account and network.
If WebSocket transport cannot be established, the desktop client should either:
- correctly use the configured proxy/VPN path for the durable WebSocket; or
- fall back to a supported HTTPS transport instead of remaining in an indefinite reconnect loop.
Suspected area
This appears specific to the ChatGPT/Codex macOS Desktop transport path rather than general OpenAI connectivity.
Potentially relevant components:
- durable app-server WebSocket transport
- Electron/Chromium network service
- desktop proxy handling
- WebSocket fallback behavior
Request
Please escalate this to the Codex Desktop / networking engineering team.
I would like to know:
- Whether this is a known issue.
- Whether there is a supported workaround to disable or bypass the failing durable WebSocket transport.
- Whether additional diagnostic logs or a feedback/thread ID would help.
- Whether a fixed desktop build is available or planned.
I can provide sanitized desktop logs from:
~/Library/Logs/com.openai.codex/
Possibly related public reports:
- Windows proxy handling differs across Dot Cloud tasks, cua_repl, and standalone node_repl #50751
- Codex Desktop OAuth token_exchange_failed immediately after automatic update to 26.810.41047 on macOS #38482
What steps can reproduce the bug?
Steps to reproduce:
-
Launch the latest ChatGPT macOS desktop app.
-
Sign in with my ChatGPT account.
-
Open Codex in the desktop app.
-
Start a new Codex conversation.
-
Send a minimal prompt such as:
Reply with only OK
-
The request does not complete. The UI repeatedly shows:
Reconnecting... waiting for network
followed by:
Connection failed: error sending request
-
The issue reproduces consistently, including after:
- restarting the ChatGPT desktop app;
- switching VPN nodes;
- testing both macOS System Proxy mode and TUN mode;
- updating ChatGPT Desktop to the latest version;
- resetting ChatGPT Desktop local application state;
- completely reinstalling ChatGPT Desktop.
Important control tests:
- Browser Codex works normally with the same ChatGPT account, on the same Mac, network, and VPN.
- Terminal Codex also remains usable through a separate API/custom-provider configuration.
- The ChatGPT Codex HTTPS endpoint is reachable through the same network path.
For example:
curl
--proxy http://127.0.0.1:21081
-sS
-o /dev/null
-D -
--connect-timeout 8
--max-time 20
https://chatgpt.com/backend-api/codex/responses
returns:
HTTP/1.1 200 Connection Established
HTTP/2 405
allow: POST
This confirms that DNS, TCP, TLS, the VPN exit, chatgpt.com, and the HTTPS Codex endpoint are reachable.
Relevant desktop logs repeatedly show:
Starting app-server connection hostId=durable transport=websocket
WebSocket was closed before the connection was established
app_server_connection.closed code=1006
connection_failed_before_ready
The client then repeatedly increments reconnectAttempt and retries.
The codex_apps MCP connection also reports:
HTTP request failed: error sending request for url
https://chatgpt.com/backend-api/ps/mcp
Code snippet:
Not applicable. This is reproducible directly in the ChatGPT macOS desktop UI and appears to be a desktop networking / WebSocket transport issue rather than application code.
Session ID:
Not available / not exposed in the desktop UI.
Token limit usage:
Not applicable. The failure occurs even with a brand-new conversation and a minimal prompt ("Reply with only OK").
Context window usage:
Not applicable. The failure reproduces in a fresh conversation with effectively no prior context.
What is the expected behavior?
No response
Additional information
No response
Activity
github-actions commentedon Oct 6, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Adonstein commentedon Oct 6, 2026
Thanks for the duplicate suggestions. I reviewed #50813 and #50561.
They appear related at the transport level because all three reports involve the durable WebSocket closing with code 1006 before initialization.
However, I don't believe my report is an exact duplicate yet:
"Reconnecting... waiting for network"
followed by:
"Connection failed: error sending request"
So the low-level durable WebSocket failure may share a root cause with those reports, but the affected product surface and reproduction are different.
I'm happy for maintainers to consolidate this issue if they confirm the same root cause, but I will leave #51399 open for now.
nowhere1975 commentedon Oct 13, 2026
Additional data point: a newer desktop build is still affected, and the durable transport has never once become ready
Confirming the same symptom on a build newer than the one in the original report. I also have a nuance that may help narrow the root cause: in my case the HTTPS conversation transport keeps working while only the durable/cloud WebSocket is dead, which may explain why the "Reconnecting…" banner never clears.
Environment
127.0.0.1:7890, SOCKS5127.0.0.1:7890(Clash/Mihomo)hostId=durablehas never reachedready— 9,003 attempts, 0 successesAggregated across all 110 desktop log files (
~/Library/Logs/com.openai.codex/), spanning 2026-09-30 → 2026-10-13:Transport start success … durablecause=connection_readyTotals over those files:
So this does not look like a regression introduced by 26.930 → 26.1007; the transport has never come up in any log I have.
Nuance: only the durable/cloud transport is broken — the HTTPS chat path is healthy
In a single recent log file covering roughly 5 minutes of active use:
The model responds normally and messages route fine, yet the UI stays on:
With
hostId=durableretryingcodex-cloud-backend.chatgpt.comevery 20 s indefinitely (reconnectAttempt=2067was observed in one window). This suggests the desktop UI derives its connection state solely from the durable WebSocket, even when the HTTPS path is serving requests successfully.Log excerpt (typical cycle)
The lifetime is a consistent ~15 s before
1006, which looks like a fixed timeout rather than a random drop.Already ruled out on my side
codex-cloud-backend.chatgpt.comresolves and matchesDOMAIN-SUFFIX,chatgpt.comin the proxy rule set, so it is correctly sent to the proxy group rather than falling through to DIRECT. A plain request through the same proxy completes a normal TLS handshake (~0.6 s).What might help maintainers
If
cause=connection_readycan never fire in this configuration, it would be useful to know what the durable transport requires beyond a working HTTPS path — e.g. a specific port/protocol, a feature flag on the account, or an additional hostname that must be reachable. The distinction between "HTTPS chat works" and "durable never ready" seems to be the key observable here.Happy to provide full logs, capture a packet trace, or run a diagnostic build.
taotiger commentedon Oct 15, 2026
A potentially useful recovery path for this exact macOS Desktop symptom (
Reconnecting... waiting for network, durable WebSocket code 1006 /open_timeout): inspect~/.codex/config.tomlbefore reinstalling or resetting the app.One affected user reports their ChatGPT/Codex desktop sessions (both existing and new Codex conversations) started working again immediately after following a config-focused fix. The steps they followed were:
~/.codex/config.toml, then look for a stale top-level override such asopenai_base_url = "http://127.0.0.1:PORT/v1", potentially left by an Ollama/local bridge/router integration. If present and no longer intended, comment it out or remove it.[features]the exact keyrespect_system_proxy = true(singular, notrespect_system_proxies).Outcome: the user reports the previously unusable desktop Codex/Work execution recovered. Caveat: they did not isolate which of these changes was decisive, so this is a reported combined troubleshooting path, not a confirmed root cause of every
durable1006 case. Do not remove deliberate custom endpoints without a backup.Related technical discussion: #40435 documents a stale localhost
openai_base_urlcausing misleading reconnect errors; #39237 discusses the exactrespect_system_proxykey and a confirmed macOS desktop improvement.taotiger commentedon Oct 15, 2026
Sharing a user-confirmed successful workaround for macOS ChatGPT Work/Codex desktop getting stuck at
Reconnecting 5/5/waiting for network, with durable WebSocket1006andopen_timeout. The user's old and brand-new Codex conversations were affected. Reinstalling the app, clearing caches, and restarting did not help.What the user did (both changes together):
~/.codex/config.toml.openai_base_urloverrides (for example, a localhost endpoint left by an Ollama/local bridge/router setup) if they are no longer appropriate:# openai_base_url = "http://127.0.0.1:12345/v1"[features]section (do not create a second duplicate section), if supported by your installed client:Outcome: The reporting user confirmed on 2026-10-15 that after doing both #2 and #3, their issue was resolved immediately.
Limitations: Because both configuration changes were made before retesting, we cannot isolate which change was necessary. We also cannot confirm that the stale custom endpoint was the direct cause of the durable WebSocket close: the issue may depend on client configuration or network handling. This is a user-reported workaround, not an upstream-confirmed fix. Inspect and back up config rather than deleting projects or conversation history.
Further clarification from the same user (2026-10-16): prior proxy environment changes
Before making the two
config.tomlchanges above, the user had also run these commands (port 7890 was their local proxy endpoint):Chronology: Setting these environment variables alone did not resolve the failure at the time. The user subsequently changed both
openai_base_urlandrespect_system_proxyinconfig.toml, then the app worked. It is not established whether the earlierlaunchctl setenvvalues remained in effect for the relaunched app and contributed indirectly whenrespect_system_proxywas enabled. Therefore this case is not evidence that only the two TOML edits are sufficient. These proxy commands are diagnostic context, not a universal recommended fix (a proxy must actually be listening on that port; environmental proxy choices are setup-specific). Avoid assuming causation without an isolated retest.rkgutha commentedon Oct 15, 2026
Potential workaround: Disconnect Ollama's ChatGPT Desktop integration
I started experiencing the same
Reconnecting 5/5 — waiting for networkissue on October 14, 2026. Codex briefly worked again in the evening, but the issue returned the next morning.What worked for me:
observations:
~/.codex/config.toml.respect_system_proxy = true.Sharing in case this helps others experiencing the same issue.