Skip to content

[Linux][Remote Control] WebSocket repeatedly returns HTTP 503 upstream connection termination #44313

Open

Description

@ktogias

What happened?

Codex Remote Control is enabled on a Linux host, but it cannot establish the Remote Control WebSocket connection. codex remote-control start --json consistently reports:

Error: Remote control is enabled on <HOSTNAME> but the connection is errored.

The Remote Control transport logs show repeated Connecting -> Errored transitions because the WebSocket endpoint returns HTTP 503 Service Unavailable:

websocket_url=wss://chatgpt.com/backend-api/wham/remote/control/server
error=failed to connect app-server remote control websocket:
HTTP error: 503 Service Unavailable
cf-ray: <REDACTED>-ATH
body: upstream connect error or disconnect/reset before headers.
reset reason: connection termination
error_kind=Other
has_enrollment=true
server_id=Some("<REDACTED>")
environment_id=Some("<REDACTED>")

This repeats indefinitely with exponential reconnect backoff up to 30s.

This appears distinct from #41121, where the Remote Control WebSocket is reached but authentication returns HTTP 403. Here, enrollment exists and the failure is an upstream 503 before the WebSocket handshake completes.

Environment

  • Fedora 44.0.0, x86_64
  • Codex CLI: 0.153.4
  • Managed Codex: 0.153.4
  • app-server: 0.153.4
  • app-server daemon: running in persistent mode
  • Auth mode: ChatGPT
  • No proxy environment variables
  • Remote Control enrollment already exists and is reused

codex doctor --all --ascii --no-color reports:

[ok] state        databases healthy
[ok] auth         auth is configured
[ok] app-server   running (persistent mode)
[ok] network      no proxy env vars
[!!] websocket    Responses WebSocket failed; HTTPS fallback may still work
    endpoint                 wss://chatgpt.com/backend-api/<redacted>
    DNS                      2 IPv4, 2 IPv6, first IPv4
    handshake transport error http 503 Service Unavailable:
      upstream connect error or disconnect/reset before headers.
      reset reason: connection termination
[ok] reachability active provider endpoints are reachable over HTTP

The separate Codex Responses WebSocket (wss://chatgpt.com/backend-api/codex/responses) is also returning the same class of HTTP 503 upstream error at the same time, while HTTPS reachability remains healthy.

Steps to reproduce

  1. Have Remote Control already enabled/enrolled on the host.
  2. Run:
codex remote-control stop
codex remote-control start
  1. Observe:
Error: Remote control is enabled on <HOSTNAME> but the connection is errored.
  1. Restart the persistent app-server daemon:
codex app-server daemon restart
sleep 3
codex app-server daemon version
codex remote-control start --json
  1. The daemon restarts successfully and all component versions match, but Remote Control still reports connection is errored.

  2. codex remote-control pair --json succeeds and returns a pairing code/environment ID, indicating that pairing RPC functionality is available.

  3. Inspecting the Remote Control transport logs shows repeated HTTP 503 responses from:

wss://chatgpt.com/backend-api/wham/remote/control/server

with Cloudflare traffic terminating at the ATH POP and body:

upstream connect error or disconnect/reset before headers. reset reason: connection termination

Expected behavior

The enrolled app-server should establish the Remote Control WebSocket and become available for remote control.

Actual behavior

The Remote Control WebSocket repeatedly returns HTTP 503 and transitions from Connecting to Errored. Restarting the app-server daemon does not recover it.

Additional notes

  • Enrollment is present (has_enrollment=true) and persisted enrollment is reused.
  • Server token refresh is attempted normally.
  • No 401, 403, or 409 is observed.
  • State databases pass integrity checks.
  • CLI, managed Codex, and app-server are all exactly 0.153.4.
  • HTTPS provider endpoints remain reachable.
  • Account ID, installation ID, server ID, environment ID, hostname, and full Cloudflare Ray IDs are intentionally redacted.

Activity

  1. added
    bug
    CLI
    connectivity
    app-server
    on Sep 9, 2026
  2. ktogias commented on Sep 9, 2026

    @ktogias
    Author

    Additional datapoint from the same affected Linux host:

    The interactive Codex CLI itself is also hitting a 503 on the Codex Responses WebSocket and falling back to HTTPS:

    Falling back from WebSockets to HTTPS transport. unexpected status 503 Service Unavailable: upstream connect error or disconnect/reset before headers. reset reason: connection termination, url:
    wss://chatgpt.com/backend-api/codex/responses, cf-ray: a3898fb3fb2bc6b9-ATH
    

    This is occurring at the same time that the separate Remote Control WebSocket

    wss://chatgpt.com/backend-api/wham/remote/control/server
    

    repeatedly returns the same class of 503 Service Unavailable / upstream connect error or disconnect/reset before headers / connection termination errors.

    So the CLI can continue operating only because the Responses path has an HTTPS fallback, whereas Remote Control remains Errored because its WebSocket transport does not recover via an equivalent fallback.

    This further suggests the issue is not limited to Remote Control enrollment/state, but may affect the WebSocket path from this client/region to ChatGPT upstream services. Both observed failures are being served through the Cloudflare ATH POP.

  3. leoxsantana commented on Sep 10, 2026

    @leoxsantana

    Additional Windows datapoint from Brazil (Cloudflare GRU):

    • OS: Windows 11 x64
    • ChatGPT/Codex desktop package: 26.903.8094.0
    • Codex CLI / app-server: 0.153.4
    • Auth mode: ChatGPT

    The desktop UI reports:

    Pairing code unavailable: Remote control failed to connect

    At 2026-09-09T22:08:52.637Z, after six reconnect attempts, the Remote Control transport failed at:

    wss://chatgpt.com/backend-api/wham/remote/control/server

    with:

    HTTP 503 Service Unavailable

    upstream connect error or disconnect/reset before headers. reset reason: connection termination

    Cloudflare Ray ID: a389839b4e23c6ce-GRU

    The same event reported has_enrollment=true. A redacted codex doctor run shows:

    • desktop app-server handshake: OK
    • authentication/config/installation: OK
    • normal HTTP provider reachability: OK
    • no proxy environment variables and no enabled Windows proxy
    • Responses WebSocket: the same HTTP 503 / upstream connection termination

    I restarted the desktop app and reproduced the failure on a second independent connection/mobile hotspot. The result did not change. Process inspection also shows one real desktop-app root process; the other ChatGPT processes are normal child/helper processes.

    This Windows reproduction matches the reported upstream WebSocket failure and does not appear to be caused by general connectivity or duplicate app instances. I can provide a fully redacted doctor report if maintainers need it.

  4. elhean commented on Sep 10, 2026

    @elhean

    Additional macOS datapoint with cross-network / cross-POP isolation.

    I can reproduce the same Remote Control and Responses WebSocket HTTP 503 failure on two separate Apple Silicon Macs:

    • macOS 26.6.2
    • ChatGPT Desktop 26.903.61454
    • Codex CLI / Desktop bundled Codex: 0.153.4
    • Auth mode: ChatGPT
    • No proxy environment variables
    • Tailscale disabled during final tests

    Both machines initially had unrelated stale/version-skewed app-server state. That was cleaned up and both were aligned to Codex 0.153.4. Afterward:

    • local Code Mode execution passes
    • /usr/bin/true passes
    • project-local shell execution passes
    • normal HTTPS provider reachability passes
    • Remote Control still fails with HTTP 503 and reconnect loops

    I also deleted the local Remote Control enrollment on one Mac and performed a completely fresh re-enrollment from zero. The new enrollment was successfully created and persisted with Remote Control enabled, but the WebSocket immediately returned the same HTTP 503. This appears to rule out stale enrollment as the cause.

    Network isolation

    The Remote Control endpoint:

    wss://chatgpt.com/backend-api/wham/remote/control/server

    returns:

    503 Service Unavailable

    with:

    upstream connect error or disconnect/reset before headers. reset reason: connection termination

    from three independent hosts:

    1. MacBook Pro on a Serbian residential connection
    2. separate Mac Studio on another access network
    3. unrelated Linux hosting server on a different provider

    All three requests terminate at Cloudflare BEG and include x-openai-proxy-wasm: v0.1.

    A normal HTTPS GET to the same endpoint from BEG returns the expected:

    HTTP/2 426

    so HTTPS reachability to the endpoint itself is healthy.

    A completely unrelated WebSocket endpoint (ws.postman-echo.com) successfully returns:

    101 Switching Protocols

    from the affected Mac, so WebSockets are not generally blocked by the local network.

    Independent control from another POP

    I also ran the identical unauthenticated diagnostic from a GitHub-hosted Ubuntu runner:

    • Azure runner region: westus3
    • Cloudflare colo: LAX

    Results:

    • ordinary GET to the OpenAI Remote endpoint: HTTP/2 426
    • WebSocket Upgrade request to the OpenAI Remote endpoint: HTTP/1.1 400 Bad Request
    • control WebSocket: HTTP/1.1 101 Switching Protocols

    Importantly, the LAX request does not reproduce the upstream 503.

    This adds BEG/macOS evidence to the ATH and GRU reports already present here and suggests the failure is associated with particular Cloudflare → OpenAI WebSocket upstream paths rather than Remote enrollment state, duplicate desktop instances, a single ISP, or general WebSocket connectivity.

    The Desktop UI messages observed during the same underlying transport failure were misleading:

    • Could not enable Remote Control. Check if only one instance is active
    • Couldn't update remote control availability

    while process inspection showed only one actual Desktop instance and the transport logs showed repeated HTTP 503 / reconnect events with zero successful Connected events.

  5. dpalis commented on Sep 10, 2026

    @dpalis

    Additional macOS datapoint from Brazil (Cloudflare GRU), same failure signature.

    Environment

    • ChatGPT Desktop 26.903.61454 (auto-updated today ~13:08 UTC), bundled CLI / app-server 0.153.4
    • macOS 26.6.2 (Darwin 25.6.0), Apple Silicon
    • Auth mode: ChatGPT; no proxy; IPv4 and IPv6 both available
    • Remote Control enrollment already existed and is reused (has_enrollment=true)

    Timeline (from the app-server log db)

    • Remote Control websocket had been connected continuously since 2026-09-07 12:02 UTC.
    • First failure at 2026-09-09 21:12 UTC. Since then 979 reconnect attempts, every one HTTP 503 Service Unavailable, body upstream connect error or disconnect/reset before headers. reset reason: connection termination, request-id: <none>. Example: cf-ray: a389addf38156ea9-GRU at 22:37 UTC.
    • Still failing at 21:48 BRT (00:48 UTC). Restarting the app, restarting only the app-server, and rebooting the iPhone do not help. iOS shows the host as Offline with a stale "last seen".

    Isolation

    • A raw, unauthenticated websocket upgrade (curl --http1.1 with Upgrade: websocket) to https://chatgpt.com/backend-api/wham/remote/control/server returns 503 with the same body, over both IPv4 and IPv6. The same happens for any path under /backend-api/wham/ when the Upgrade headers are present.
    • The same URLs without the Upgrade headers respond normally (426 on /server, 404 on /client), and /backend-api/me returns 403 as expected. So plain HTTPS reaches the upstream; only websocket upgrades are being reset at the gateway.
  6. lazyd3v commented on Sep 10, 2026

    @lazyd3v

    Additional Linux datapoint through Cloudflare CDG, reproducing the same failure signature on 2026-09-10 around 05:53 UTC.

    Environment

    • Ubuntu 24.04.4 LTS, x86_64
    • Installed desktop package: chatgpt 26.901.51231
    • Desktop-bundled Codex: 0.153.4
    • Separately installed CLI on PATH: 0.152.1
    • Auth mode: ChatGPT
    • Diagnostics report no proxy environment variables and no managed proxy configured

    Desktop Remote Control logs
    At 2026-09-10T05:53:27Z, the transport logged reconnect attempt 6 with has_enrollment=true for:

    wss://chatgpt.com/backend-api/wham/remote/control/server
    HTTP error: 503 Service Unavailable
    upstream connect error or disconnect/reset before headers. reset reason: connection termination
    request-id: <none>
    cf-ray: a38c2c1f79482c0b-CDG
    

    Multiple preceding reconnect attempts show the same error.

    Fresh diagnostics and isolation

    • Ran doctor --json using both the separate CLI 0.152.1 and desktop-bundled 0.153.4. Both report the Responses WebSocket failing with the same HTTP 503/upstream connection termination, while normal HTTP provider reachability passes (HTTP 405) and auth is configured.
    • At 2026-09-10T05:53:31Z, an unauthenticated ordinary HTTP/1.1 GET to the Remote Control server endpoint returned 426 Upgrade Required, with websocket_upgrade_required.
    • An unauthenticated HTTP/1.1 GET to that same endpoint with standard WebSocket upgrade headers returned 503 Service Unavailable with the same upstream connection termination body. Ray ID: a38c2c3979d7c395-CDG.
    • Both raw responses included x-openai-proxy-wasm: v0.1 and CDG Ray IDs.

    This adds CDG/Ubuntu evidence to the existing reports. The raw upgrade probe reproduces the 503 independently of CLI version or local enrollment, although it does not establish the underlying cause. Hostname, local paths, and account/enrollment identifiers are omitted.

  7. ktogias commented on Sep 10, 2026

    @ktogias
    Author

    Update: As of Sep 10 around 13:14 EEST, the issue has recovered for me without any local configuration, authentication, enrollment, or network changes.

    Remote Control is working normally again, and the Codex Responses WebSocket errors have also disappeared.

    This further suggests a transient upstream/WebSocket infrastructure issue rather than a client-side state problem.

  8. fbajosh commented on Sep 15, 2026

    @fbajosh

    Ubuntu 24.04, ChatGPT Linux desktop app, failure began around September 14, iOS and macOS controllers both fail to receive new chats, full ChatGPT/app-server restart did not fix it, CLI 0.154.0, local DB integrity OK, and Remote had previously worked.

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

    CLILinuxapp-serverbugconnectivityremote

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions