Skip to content

Title: Remote control websocket frequently disconnects with "pong timeout"  #56435

Open

Description

@nemonemo0301-lab

Environment:

  • Codex app-server daemon 0.164.0 (x86_64-unknown-linux-musl), CLI 0.162.1
  • Debian 13 VM (US data center), no systemd
  • Started with codex remote-control start, paired with the ChatGPT mobile app

Problem:
The remote control websocket to wss://chatgpt.com/backend-api/wham/remote/control/server disconnects several times per hour. On Oct 23, 2026 it disconnected 6 times between 09:57 and 10:48 UTC. The mobile app then shows the machine in red with "Connection failed".

Log (each time):
WARN remote_control::websocket: remote control websocket reader disconnected, err: remote control websocket pong timeout
It reconnects automatically after about 5 seconds.

Requests:

  1. Is there a setting to make the pong timeout longer or the ping interval shorter?
  2. Could the mobile app keep the session during short reconnects instead of showing "Connection failed"?

Activity

  1. added
    bug
    CLI
    connectivity
    on Oct 23, 2026
  2. mieqga-web commented on Nov 28, 2026

    @mieqga-web

    Additional reproducible case: Windows Codex Desktop + Android Remote Control, 2026-11-27/28 (UTC+8). The host-side Remote Control WebSocket has this exact pong timeout failure; ordinary model responses and the mobile thread-loading path behave differently.

    Environment: Windows ChatGPT/Codex Desktop MSIX 26.1120.6357.0, bundled Codex CLI/app-server 0.171.0-alpha.13.2, Android 17 ChatGPT app. Clash Verge/Mihomo local HTTP/mixed proxy + TUN. Windows manual system proxy disabled, explicit HTTP_PROXY, HTTPS_PROXY, ALL_PROXY pointing to an existing local proxy listener, NO_PROXY limited to loopback.

    Verified host-side timeline:

    • In repeated native ~/.codex/logs_2.sqlite samples, codex_app_server_transport::transport::remote_control::websocket logs remote control websocket pong timeout at almost exactly 60 seconds after Connected; automatic reconnection takes about 5–9 seconds.
    • Examples on 2026-11-28 UTC+8: pong timeout at 12:16:44 / reconnected 12:16:50; timeout at 12:17:50 / reconnected 12:17:57. After a complete desktop process restart, Connected 12:26:15 → pong timeout 12:27:15 → reconnected 12:27:21.
    • Android Remote intermittently shows reconnecting or loads thread history indefinitely. The host nonetheless receives initialize, thread/list, and thread/read requests; Connected alone does not imply the mobile transcript loaded.
    • The model Responses stream is separately functional on short turns and showed zero response-stream disconnects during the last ~84-second post-restart check, despite the Remote Control pong timeout.
    • Same proxy can reach https://chatgpt.com/ over CONNECT/TLS (HTTP 200). An independent WSS endpoint through the same proxy returned 8/8 Ping/Pong over ~80 seconds. That does not rule out network issues specific to the Remote Control endpoint.
    • We checked the recent timeout windows against thread/resume activity; many timeouts had no resume within ±90 seconds. This case therefore does not appear to be explained by the large-thread-resume scenario alone (although large sessions exist on the host).

    Proxy-feature A/B: With the local proxy/TUN otherwise unchanged, features.respect_system_proxy=false did not prevent the remote pong timeouts. Setting it to true (while system_proxy_fallback remained enabled by default) and fully restarting the desktop app also did not prevent them, as proven by the 12:27:15 event. We have since removed the explicit respect_system_proxy line so new CLI runs use the default; the existing desktop has not yet been restarted for that particular no-override A/B because an unrelated native task is in progress. No claim of a fix.

    Request: Could maintainers investigate why the authenticated Remote Control WebSocket is not processing Pong on this Windows path, and whether there is a supported way to distinguish client heartbeat starvation, endpoint-specific proxy/relay path failures, and backend session-read stalls? It would also help if short host reconnections did not leave the Android transcript indefinitely stuck loading.

    Sanitized summary only; no raw logs, credentials, account identifiers, device IDs, proxy subscription information, private file paths, or project/thread content attached. Related: #39974 and #50934.

    Update — 2026-11-28 ~14:02 UTC+8 (same host, newly observed distinct failure mode): After removing the explicit respect_system_proxy override and fully restarting the Windows desktop, the user reports that Android sometimes receives one fresh transcript update but then remains stuck on old content. The host logs after restart show no further host Remote WebSocket pong timeout events in the current observation window, yet codex_app_server_transport::transport::remote_control::client_tracker records forwarding remote control connection closed transport event at 13:58:25, 13:59:25, 14:01:25, and 14:02:12 UTC+8, repeatedly around a minute apart. The app-server also receives repeated thread/read and thread/resume requests via remote connection IDs during this period, while a local native thread is in progress. Separately, thread_history logged dropping turn-scoped item for unknown turn id during local thread/resume; we cannot establish whether that warning causes the mobile refresh issue.

    In the version-matched public client_tracker.rs code, the normal Remote Control client inactivity expiry is 10 minutes, not one minute. This indicates that a freshly connecting remote client stream is getting closed or replaced, rather than naturally reaching the documented idle sweep threshold. The host WebSocket heartbeat problem and the remote-client-stream closure may be two distinct symptoms. We have not yet isolated whether mobile-client routing, the relay, server-side handling, or oversized thread history is the trigger; there is no verified local fix. No raw logs or personal/session identifiers are being posted.

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

    CLIbugconnectivityremote

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions