Skip to content

[Remote][Windows/Android] Pairing succeeds and host WebSocket is Connected, but Android attach immediately closes with Transport unavailable #39915

Open

Description

@kevsilve

Summary

Codex Remote on Android can successfully pair with a Windows host, and the Windows host successfully creates a fresh Remote enrollment and reaches Connected on the Remote WebSocket, but the Android client cannot attach to the host. The mobile UI reports Transport unavailable, no chats are accessible, and the Windows logs show repeated Remote client connections being immediately closed.

This began after Remote had previously worked.

Environment

  • Host: Windows
  • ChatGPT Desktop package: OpenAI.ChatGPT-Desktop 1.2026.190.0
  • Codex Desktop client reported in logs: 26.818.31338
  • Remote controller: ChatGPT Android app
  • Remote pairing: succeeds
  • Mobile error: Transport unavailable

Current behavior

The desktop host registers successfully with Remote:

remote control websocket status changed previous_status=Connecting next_status=Connected
connected to app-server remote control websocket

A completely fresh Remote identity was generated and persisted successfully:

has_enrollment=true
server_id=Some("srv_e_...")
environment_id=Some("env_e_...")

However, when the Android client tries to connect, the desktop logs show repeated immediate closures such as:

forwarding remote control connection closed transport event connection_id=ConnectionId(3)
forwarding remote control connection closed transport event connection_id=ConnectionId(4)
forwarding remote control connection closed transport event connection_id=ConnectionId(5)
forwarding remote control connection closed transport event connection_id=ConnectionId(6)

Earlier in troubleshooting, the host Remote WebSocket also logged:

remote control websocket reader disconnected, err: failed to read from websocket: IO error: An existing connection was forcibly closed by the remote host. (os error 10054)

Important diagnostic result

The original Remote enrollment and installation identity were fully rotated to rule out stale local state.

After resetting:

  1. A new installation ID was generated.
  2. The old remote_control_enrollments row was removed.
  3. ChatGPT Desktop created a new server_id and environment_id.
  4. The new enrollment was persisted successfully in state_5.sqlite.
  5. The host Remote WebSocket reached Connected.
  6. Android re-pairing succeeded.
  7. Android still reports Transport unavailable and the client-side Remote connections are immediately closed.

This appears to place the failure after host registration/WebSocket setup, at the mobile-client attach/session transport stage.

Local troubleshooting already performed

  • Restarted ChatGPT/Codex Desktop
  • Restarted Windows
  • Signed out/in
  • Removed and recreated Remote pairing
  • Killed all ChatGPT/Codex processes and recreated local Remote queue/global state
  • Rotated the durable Codex installation_id
  • Removed the persisted remote_control_enrollments entry
  • Verified a brand-new Remote enrollment was subsequently created
  • Verified new server_id and environment_id values were generated
  • Verified host Remote WebSocket reaches Connected
  • Cleared all ChatGPT Android app data
  • Re-authenticated Android app
  • Re-paired Android device successfully
  • Tested Windows host on normal Wi-Fi and on a phone hotspot
  • Result is identical across networks
  • Verified ordinary ChatGPT/Codex HTTPS authentication/API requests return 200 OK

Expected behavior

After successful pairing and after the Windows Remote host reaches Connected, the Android Remote client should attach to the host and display/control supported Codex chats.

Actual behavior

Pairing succeeds, the host is enrolled and connected, but Android cannot attach. The phone reports Transport unavailable, no chats are accessible, and each client connection is immediately closed on the host.

Suspected failure boundary

Observed sequence:

  1. Authentication: works
  2. Host Remote enrollment: works
  3. Host WebSocket connection: works (Connected)
  4. Android pairing: works
  5. Android client attach: fails immediately
  6. Host logs repeated remote control connection closed transport event

This looks distinct from failures where /wham/tasks/list returns 503 or where the host itself cannot establish the Remote WebSocket.

Privacy

Account IDs, installation IDs, server/environment IDs, tokens, cookies, project content, and conversation content have been omitted/redacted. Additional sanitized log excerpts can be provided if needed.

Activity

  1. added
    bug
    app
    windows-os
    connectivity
    on Aug 21, 2026
  2. maitoneriumuxu commented on Aug 21, 2026

    @maitoneriumuxu

    Adding another reproduction with the same failure boundary.

    Environment:

    • Windows host
    • Codex Desktop: 26.818.31338
    • Standalone Codex CLI: updated from 0.144.4 to 0.149.0
    • Android ChatGPT app: current Play Store version
    • ChatGPT Pro

    Observed behavior:

    • QR pairing succeeds and the Android device appears in the Desktop authorized-device list.
    • Android remains on "Waiting for desktop" and eventually reports that it could not connect to the desktop.
    • Revoke + fresh pairing does not help.
    • Full Desktop/Windows restarts do not help.
    • Tested on normal Wi-Fi and with the Windows host connected through the phone hotspot; behavior is unchanged.
    • Ordinary Codex HTTPS/API traffic is healthy (200 OK).

    I also fully reset the local Remote state before re-pairing. After the fresh pairing attempt, the Desktop logs repeatedly show the Remote client connection being created and then immediately closed, e.g.:

    forwarding remote control connection closed transport event connection_id=ConnectionId(3)
    forwarding remote control connection closed transport event connection_id=ConnectionId(4)
    forwarding remote control connection closed transport event connection_id=ConnectionId(5)
    dropping message for disconnected connection: ConnectionId(3)
    remoteControl/status/changed
    

    So this looks consistent with the issue described here: authentication/pairing succeeds, but Android attach/session transport fails immediately after connection creation.

    Additional checks performed:

    • Desktop and Android apps are up to date.
    • Desktop Remote was toggled off/on.
    • Android was logged out/in.
    • Local Remote environment/installation IDs were cleared and regenerated before a new pairing.
    • Standalone CLI was aligned to 0.149.0.
    • codex remote-control start is not a usable workaround on native Windows because it returns: codex app-server daemon lifecycle is only supported on Unix platforms.

    I can provide more sanitized log excerpts if useful.

  3. chadontheroad commented on Aug 21, 2026

    @chadontheroad

    Adding another confirmed reproduction with a slightly different diagnostic path.

    This Windows host had Android Remote working successfully for months before the failure began. The Android phone can still Remote-control other Codex hosts normally, so this is isolated to one Windows host rather than a general mobile/account/network outage.

    Observed state:

    • Android pairing succeeds.
    • Windows host enrollment is enabled and advertised correctly.
    • The desktop host connects successfully to the Remote relay.
    • Android reaches the host and begins initialization.
    • The session then closes before the desktop opens.
    • Android UI explicitly reports Transport unavailable.
    • Host logs show the Remote transport closing immediately after initialization, without a host-side 401/403/409/429/5xx, DNS, TLS, firewall, or relay-worker error.

    An earlier host-side issue was also found during diagnosis: Remote was enabled in persisted state, but the real desktop app-server had not started its Remote worker. Restarting the real app-server and toggling Remote caused the worker to start and the host to connect to the relay, but this did not resolve the Android attach failure. The remaining failure is therefore post-registration/post-relay initialization.

    Troubleshooting already performed:

    • Windows restarted
    • Codex Desktop restarted and updated multiple times
    • Remote disabled/re-enabled
    • Pairing revoked and recreated
    • ChatGPT Android app removed/reinstalled and re-paired
    • Wi-Fi restarted; other Remote hosts continue to work from the same Android device
    • Local Codex remains healthy
    • Local Chrome/Codex integration remains healthy

    Failure boundary from host logs:

    1. Local Codex/authentication: healthy
    2. Host enrollment: healthy
    3. Remote worker: running
    4. Relay connection: healthy
    5. Android connection accepted / initialization begins
    6. Transport closes immediately
    7. Android displays Transport unavailable

    No account IDs, server/environment IDs, installation IDs, tokens, hostnames, or project content included here. Sanitized timestamps/log excerpts are available if maintainers want them.

    One timing detail that may or may not be relevant: this host had previously worked for months, and the failure appeared around the time another Remote host was added to the same account. I do not have evidence that the additional host caused the issue, so treating that only as correlation.

  4. GrowDev1 commented on Aug 24, 2026

    @GrowDev1

    I am seeing the same failure pattern on a Windows host with the ChatGPT mobile app: pairing succeeds, the desktop shows a recent Remote connection/heartbeat, but the phone reports Transport unavailable and cannot access the Codex chats. It reproduces on both the normal Wi-Fi network and a cellular hotspot. Both apps are updated; QR pairing was recreated; no VPN or proxy is in use; the PC remains awake with only the display allowed to turn off. DNS and TCP 443 connectivity to chatgpt.com and ws.chatgpt.com succeed. This appears to be the same post-enrollment mobile attach/transport failure described in this issue.

  5. charles1w commented on Sep 1, 2026

    @charles1w

    I can reproduce this exact failure on newer builds, including after the latest Android update available to me on 2026-08-31.

    Environment:

    • Windows host: ChatGPT/Codex Desktop 26.825.6671.0
    • Android 16, OnePlus CPH2655
    • ChatGPT Android: reproduced on 1.2026.230 (2623032), then updated through Google Play to 1.2026.237 (2623716) and reproduced again
    • ChatGPT Personal/Pro, with the same account and workspace on both devices
    • Tested over good 5G UW cellular with Wi-Fi disabled; also reproduced previously on Wi-Fi

    Observed:

    • Pairing succeeds and the host remains enrolled.
    • The host Remote WebSocket reports Connected.
    • Android stays at Looking for ChatGPT desktop... / Connecting... and then reports Transport unavailable.
    • The Windows host receives a new remote client connection every 30 seconds and immediately closes it. A synchronized sequence from the .237 reproduction (UTC):
    2026-09-01 04:53:50 ... forwarding remote control connection closed transport event connection_id=ConnectionId(<redacted>)
    2026-09-01 04:54:20 ... forwarding remote control connection closed transport event connection_id=ConnectionId(<redacted>)
    2026-09-01 04:54:50 ... forwarding remote control connection closed transport event connection_id=ConnectionId(<redacted>)
    2026-09-01 04:55:20 ... forwarding remote control connection closed transport event connection_id=ConnectionId(<redacted>)
    

    There was no corresponding host crash or general API/network failure during those attempts.

    Troubleshooting already completed:

    • Repeatedly revoked and re-paired
    • Restarted/force-stopped the Android app
    • Verified the same account and workspace
    • Tested Wi-Fi and cellular
    • Updated the Android app from .230 to .237
    • Exempted ChatGPT from Android device-idle restrictions

    The connection worked briefly once, then degraded back into the persistent 30-second attach/close loop.

    User impact:
    This makes long-running Codex tasks inaccessible from mobile. Repeated recovery attempts and the inability to steer, pause, or manage active tasks have wasted substantial usage/tokens. Please treat the mobile attach/session-lifecycle failure as high impact: pairing and host registration are healthy, but the controller cannot keep a transport open.

    I can provide a sanitized logs_2.sqlite query/export with synchronized timestamps if useful. No account IDs, installation/environment IDs, device serials, IP addresses, project paths, task IDs, or task content are included here.

  6. Arbaonwsas commented on Sep 8, 2026

    @Arbaonwsas

    Adding a cross-platform reproduction from a macOS host + Android controller. The user-facing symptom matches this issue: pairing succeeds and the host is shown as ready, but Android remains on "Looking for ChatGPT desktop..." and then reports that it could not connect / Transport unavailable.

    Environment

    • Host: macOS 26.6.2, Apple Silicon (arm64)
    • ChatGPT/Codex Desktop: 26.901.51231
    • Bundled Codex CLI: 0.153.4
    • Controller: ChatGPT for Android (current installed build; exact version not captured)
    • Same ChatGPT account and workspace on both devices
    • MFA enabled
    • Both devices tested with their VPN/proxy in global mode
    • macOS proxy is a Clash-compatible Network Extension in TUN mode

    Observed behavior

    1. Desktop Remote Control enablement succeeds.
    2. QR/manual pairing succeeds.
    3. Android shows the macOS host as ready.
    4. Selecting the host shows "Looking for ChatGPT desktop..." and then fails.
    5. The desktop remains open, awake, and online.
    6. During the Android connection attempt, the macOS desktop repeatedly reports no attached Remote clients:
    refresh_remote_control_completed autoConnectConnectionCount=0 nextConnectionCount=0 previousConnectionCount=0
    

    No Android attach / incoming Remote client event was observed in the macOS desktop logs during the synchronized attempt.

    Network evidence

    The local proxy controller showed active TCP/443 connections for all relevant destinations through the selected proxy node:

    chatgpt.com:443
    ws.chatgpt.com:443
    chat.openai.com:443
    

    The Remote APIs were intermittently slow/unavailable for ~7–15 seconds:

    failed to start remote control pairing ... error sending request
    failed to list remote control clients ... error sending request
    

    However, subsequent retries succeeded:

    remoteControl/pairing/start ... errorCode=null
    remoteControl/client/list ... errorCode=null
    

    Despite successful pairing and client-list calls, the Android attach still never reached the Mac, and the connection counts stayed at zero.

    Troubleshooting completed

    • Updated desktop app
    • Fully quit and restarted ChatGPT Desktop
    • Restarted/force-stopped Android ChatGPT
    • Verified the same account/workspace and MFA
    • Disabled/re-enabled Remote Control
    • Revoked and recreated the pairing
    • Tested both devices with global proxy/VPN routing
    • Verified the Mac remains awake and online
    • Verified ChatGPT HTTPS and WebSocket destinations are routed through the proxy

    There had previously been a separate setup-stage 403 Multi-factor authentication required error (similar to #36450), but that prerequisite was resolved: Remote enablement and pairing now succeed. The remaining failure is specifically after enrollment/pairing, at Android controller attach/relay delivery.

    This suggests the Android attach/session transport problem is not Windows-only. The failure boundary on this Mac is: authentication works, enrollment works, pairing works, Remote API calls work after retry, but the controller attach is never delivered to the host.

    All account IDs, installation/environment/server IDs, request IDs, hostnames, IP addresses, proxy credentials, filesystem paths, and task content have been omitted.

  7. charles1w commented on Sep 10, 2026

    @charles1w

    Follow-up: restored Android task loading after reproducing a host-side scan stall (app-server 0.153.4, Android 1.2026.244).

    Android omits useStateDbOnly on thread/list; Desktop sets it. The host parses rollout previews before rejecting excluded subagents, scanning huge inherited histories unnecessarily. In a controlled copied-data test, phone-style listing exceeded 25 seconds; early exclusion returned the same 50 tasks in 1.15 seconds. Indexed listing took 27 ms; Android's RPC deadline is 30 seconds.

    The live workaround retains old subagent files outside the scan and uses symbolic links at their original paths, preserving contents and database entries. Listing now takes 1.21 seconds, and the phone loads tasks without an app restart or manual network reset.

    Reproduction, source location and fix details. Suggested fix: indexed Remote bootstrap plus early source filtering and bounded preview parsing. This explains this reproduction, not every attach failure reported here.

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

    appbugconnectivityremotewindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions