Skip to content

Recoverable reconnect loop before HTTP fallback when entering new or resumed thread #24045

Open

Description

What version of the Codex App are you using (From “About Codex” dialog)?

26.519.31651

What subscription do you have?

ChatGPT Plus

What platform is your computer?

Darwin 25.4.0 arm64 arm

What issue are you seeing?

When I enter a new or resumed Codex Desktop thread, the first user turn often shows a recoverable reconnect loop:

Reconnecting... 2/5
Reconnecting... 3/5
Reconnecting... 4/5
Reconnecting... 5/5

The session eventually recovers and completes normally, so this is not a permanent connectivity failure.

From local logs, the pattern appears to be:

Codex first attempts responses_websocket against wss://chatgpt.com/backend-api/codex/responses.
The WebSocket startup prewarm / first turn stream fails or times out.
Codex retries several times.
Codex falls back to responses_http / SSE.
The turn completes successfully.
Representative sanitized log fragments:

startup websocket prewarm setup failed: timeout waiting for child process to exit
event.name="codex.websocket_connect" duration_ms=15002 success="false" error.message="timeout"
stream disconnected - retrying sampling request (1/5 ...)
stream_request:model_client.stream_responses_api ... transport="responses_http"
response.completed

This happens in a proxied network environment using Shadowsocks + Clash Verge Rev with local mixed proxy 127.0.0.1:7897.

What steps can reproduce the bug?

  1. Start Codex Desktop on macOS.
  2. Open an existing workspace.
  3. Create a new thread or resume an existing thread.
  4. Send the first user message.
  5. Observe Reconnecting... 2/5 through 5/5.
  6. Wait for the retries to finish.
  7. The session eventually becomes usable after HTTP/SSE fallback.

Additional experiments performed:

  • codex app --disable plugins: reconnect still occurred.
  • Clash Global mode with the same node: reconnect still occurred.
  • Different proxy node type: reconnect still occurred.
  • Minimal CLI control test via proxy completed successfully.
  • Codex logs show traffic routed through 127.0.0.1:7897, so this does not appear to be missing proxy configuration.
  • Plugin catalog endpoints may return Cloudflare 403, but model requests still succeed after fallback.

I can provide a sanitized diagnostic report if useful.

What is the expected behavior?

Codex Desktop should either:

  1. establish the WebSocket transport successfully, or
  2. fall back to responses_http / SSE quickly and quietly when WebSocket prewarm fails.

Ideally there should also be a documented local configuration option to force HTTP/SSE or disable responses_websocket in network environments where WebSocket is unreliable.

Additional information

Environment:

  • macOS Tahoe 26.4.1, Apple Silicon
  • Platform: Darwin 25.4.0 arm64 arm
  • Codex CLI: 0.130.0
  • Codex Desktop: 26.519.31651
  • Network: mainland China network, Shadowsocks + Clash Verge Rev, local mixed proxy 127.0.0.1:7897

The issue is recoverable: after several reconnect attempts, the turn completes via HTTP/SSE fallback. The main impact is a consistent startup delay and confusing reconnect UI whenever entering a new or resumed thread.

Activity

  1. added
    bugSomething isn't working
    connectivityIssues involving networking or endpoint connectivity problems (disconnections)
    on May 22, 2026
  2. github-actions commented on May 22, 2026

    @github-actions
    Contributor

    Potential duplicates detected. Please review them and close your issue if it is a duplicate.

    Powered by Codex Action

  3. HonestMonth commented on May 25, 2026

    @HonestMonth

    Yes i have been having same issue now for the last 2 days. Nothing working.

  4. ChrisExodus commented on Jul 14, 2026

    @ChrisExodus

    Same issue on macOS using OpenWrt PassWall with a VLESS proxy. Every new task starts with Reconnecting... 1/5 through 5/5, then recovers and completes after falling back to HTTP/SSE. The issue repeats for each new task. Please consider immediate HTTP fallback or a documented option to disable the WebSocket transport.

  5. a86582751 commented on Sep 8, 2026

    @a86582751

    Independent confirmation from a Windows 11 / ChatGPT-auth Codex Desktop + CLI / Clash environment.

    We saw the same visible Reconnecting 1/5 through 5/5 pattern in Desktop. A controlled CLI A/B test was clean when Codex was made to use only the local HTTP CONNECT endpoint (HTTP_PROXY and HTTPS_PROXY pointing at the Clash mixed port), with ALL_PROXY unset, and a ChatGPT-auth Responses provider configured with supports_websockets = false. The task completed without any reconnect retries.

    The provider workaround we tested was:

    model_provider = "openai_http"
    
    [model_providers.openai_http]
    name = "OpenAI"
    requires_openai_auth = true
    supports_websockets = false

    wire_api = "responses" is currently the default. The exact name = "OpenAI" matters in current builds for retaining OpenAI-specific capabilities such as remote compaction. With global web search enabled, we also confirmed first-party web search still worked in our CLI test.

    This seems to be a useful targeted mitigation for the delayed WS-to-HTTP fallback, rather than evidence that Clash itself is necessarily failing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appIssues related to the Codex desktop appbugSomething isn't workingconnectivityIssues involving networking or endpoint connectivity problems (disconnections)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions