Skip to content

Android Codex Remote disconnects before thread/resume responses reach client on Windows host #39931

Open

Description

@SpammkingTCG

Codex Remote on Android 16 cannot reliably maintain a session with my Windows ChatGPT/Codex host.

Feedback ID:
01a01fa0-40fd-7532-a1a5-7e12d30a87e8

Environment:

  • Windows package: OpenAI.Codex_26.818.3698.0
  • App-server build: 26.818.31338
  • Android 16
  • Samsung SM-S938B
  • Android client: codex_chatgpt_android_remote

Symptoms:

  • QR pairing succeeds.
  • Android can discover the Windows host, projects and recent threads.
  • Opening Codex threads often remains indefinitely on grey loading placeholders.
  • Remote cycles through Connecting, Looking for ChatGPT desktop, Reconnecting, and Failed to connect to ChatGPT desktop.
  • Reproduces across multiple threads and both Wi-Fi and 5G.

Local diagnostics:

  • Android reaches the host and sends thread/resume requests.
  • All 35 local transcript files exist.
  • Thread-state and log databases pass integrity checks.
  • 46 Android Remote client connections closed within one hour.
  • 27 host responses were dropped after the corresponding client connection had already disconnected.
  • Host logged: "Dropping message for disconnected connection".
  • Main Remote WebSocket also reset once without a closing handshake.
  • No relevant Windows crashes, proxy, authentication errors, or missing-thread errors.

Troubleshooting already performed:

  • Latest Windows and Android apps
  • Phone reboot
  • Force stop / cache clear
  • Android sign-out/sign-in
  • Wi-Fi and 5G testing
  • Fresh revoke + QR pairing
  • Windows desktop restart
  • Full Windows ChatGPT uninstall/reinstall
  • Multiple Codex threads tested

Likely failure sequence:

  1. Android opens a Remote connection and sends thread/resume.
  2. That connection disconnects or is replaced.
  3. Windows completes the request against the old connection ID.
  4. The host drops the response because the connection no longer exists.
  5. Android remains on loading placeholders and starts reconnecting.

Failure window:
21 August 2026, approximately 12:46–12:51 UTC, continuing afterwards.

Please investigate Android Remote connection churn and stale connection-ID response routing/replay after reconnect, and correlate against the Feedback ID above.

Activity

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

    @SpammkingTCG
    Author

    The duplicate detector surfaced #39913 and #39860, both of which appear closely related.
    #39913 is particularly similar: successful Windows/Android pairing followed by Remote client disconnects and task-loading failures.
    #39860 also demonstrates a Remote failure associated with larger thread/list payloads.
    In my reproduction, local host logs additionally show Android sending thread/resume, followed by the logical Remote connection closing before the host response is delivered. The host then logs Dropping message for disconnected connection.
    During the observed hour there were 46 Android Remote client closures and 27 dropped host responses.
    My Feedback ID is:
    01a01fa0-40fd-7532-a1a5-7e12d30a87e8
    I’m leaving this issue open for now because the diagnostics may help correlate whether this is the same outbound-queue/payload boundary or a related stale connection-ID routing/replay problem.

  3. oysOYSoys commented on Aug 21, 2026

    @oysOYSoys

    My symptoms are very similar, but the Android client initially shows only the latest partial messages. Loading older messages fails repeatedly, then the conversation title changes to “Remote” and the composer/input field disappears. Retrying does not recover it. New responses may still appear when a message can be sent. Windows loads the same thread history normally. This reproduced on two Android devices, including cellular data, after app data reset, reinstall, restart, re-login, and Remote re-pairing. Android 1.2026.230 / Windows Desktop 26.818.31338. This looks like the same thread/resume response loss or Remote client hydration failure.

  4. adamczhang commented on Aug 21, 2026

    @adamczhang

    Same symptoms. Please help

  5. ibdafna commented on Nov 21, 2026

    @ibdafna

    We hit what looks like the same bug, with an app-server log showing the reply dropped on a connection whose socket stayed open.

    Version: codex-cli 0.171.0 (codex app-server --listen ws://127.0.0.1:0), Linux x86_64, musl build from @openai/[email protected].

    What happens

    A client opens a websocket connection to codex app-server and sends initialize. The app-server handles it, then logs that it's dropping the reply because the connection is disconnected. The client's socket never closes, so it waits for a reply that will never come. Another client connected about 90 ms earlier initializes normally. Rare: about 1 in 50 CI runs, under CPU contention.

    App-server log (RUST_LOG=info,codex_app_server=debug), times in UTC:

    15:40:01.749199Z  INFO codex_app_server_transport::transport::websocket: websocket client connected peer_addr=127.0.0.1:54982
    15:40:01.750173Z  INFO app_server.request: codex_app_server::app_server_tracing: new          (initialize, ConnectionId 0)
    15:40:01.835220Z  INFO app_server.request: codex_app_server::app_server_tracing: close time.busy=84.9ms
    15:40:01.836368Z  INFO codex_app_server::message_processor: <- notification: JSONRPCNotification { method: "initialized" }
    15:40:01.841047Z  INFO codex_app_server_transport::transport::websocket: websocket client connected peer_addr=127.0.0.1:54986
    15:40:01.844320Z  INFO app_server.request: codex_app_server::app_server_tracing: new          (initialize, ConnectionId 1)
    15:40:01.844505Z  INFO app_server.request: codex_app_server::app_server_tracing: close time.busy=101µs
    15:40:01.849862Z  WARN codex_app_server::transport: dropping message for disconnected connection: ConnectionId(1)
    

    There's nothing else in the log for ConnectionId(1): no websocket receive error, no disconnecting slow connection, no websocket control queue full. Ten seconds later the app-server was idle. Every thread was in futex_wait_queue or ep_poll, memory pressure was 0 and IO pressure under 2%. The client's socket was still open: it received no close frame or error in that time.

    What we read in the source (rust-v0.171.0)

    • codex-rs/app-server/src/transport.rs, route_outgoing_envelope, logs the warning when the connection id isn't in the router's map. For a websocket (can_disconnect()), send_message_to_connection removes the entry without logging when writer.try_send returns Closed.
    • codex-rs/app-server-transport/src/transport/websocket.rs awaits ConnectionOpened before spawning the inbound and outbound tasks, so registration can't lose the race to the first request.
    • So the connection's outbound writer seems to have gone away within about 5 ms of the connection opening, with no log saying why, while the TCP connection stayed up.

    Possibly related: #18860.

    Expected: the initialize reply reaches a connected client. Or, if the server tears the connection down, the socket closes, so the client can tell.

    Workaround we ship: if initialize gets no reply in 10 s on a fresh connection, close it and initialize once more on a new connection.

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

    appapp-serverbugconnectivityremotewindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions