Skip to content

[Windows][Remote Control] Android pairing approval loops to login; host stays 'connection is errored' on CLI 0.158.0 #49132

Open

Description

@rohkorean-stack

What version of the Codex App are you using?

Codex CLI: 0.158.0
app-server: 0.158.0
Managed Codex: 0.158.0
Codex Desktop app installed on Windows 11.

What subscription do you have?

ChatGPT Plus.

What platform is your computer?

Windows 11 Professional, x64.

Mobile client: Galaxy Tab S9 running the ChatGPT Android app.

What issue are you seeing?

Codex Remote Control cannot establish the host connection on Windows even though the local Codex environment, ChatGPT authentication, normal HTTPS reachability, and the generic Responses WebSocket diagnostic all pass.

The host repeatedly reports:

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

And:

{
  "mode": "daemon",
  "status": "connecting",
  "serverName": "<HOSTNAME>",
  "environmentId": "<redacted>",
  "timedOut": true,
  "daemon": {
    "status": "alreadyRunning",
    "backend": "pid",
    "cliVersion": "0.158.0",
    "appServerVersion": "0.158.0"
  }
}

The Android pairing flow can progress surprisingly far:

  1. Generate a manual pairing code with codex remote-control pair.
  2. Enter the pairing code in ChatGPT Android.
  3. Android shows the confirmation screen asking whether this mobile device may access the computer's ChatGPT.
  4. Tap approve.
  5. The mobile app then returns to the generic ChatGPT login/signup screen instead of completing Remote Control attachment.

This creates a loop: pairing appears accepted on mobile, but the Windows host remains in connection is errored.

Diagnostics already performed

codex doctor --all reports:

  • Auth mode: ChatGPT
  • Stored ChatGPT tokens: true
  • No proxy environment variables
  • Responses WebSocket: connected
  • Handshake result: HTTP 101 Switching Protocols
  • Provider endpoints reachable over HTTP
  • app-server daemon: running in persistent mode
  • State database integrity: OK
  • CLI / managed Codex / app-server versions all 0.158.0
  • 0 failures in doctor output

The Remote Control daemon is actually running and its command line is:

codex.exe app-server --remote-control --listen unix:/// --managed-daemon

settings.json contains:

{"remoteControlEnabled": true}

Enrollment anomaly found

The local SQLite database initially had two rows in remote_control_enrollments for the same account, environment, host, and Remote Control websocket URL:

  • one row with app_server_client_name = "Codex Desktop" and remote_control_enabled = 1
  • one row with an empty client name and remote_control_enabled = NULL

The database was backed up first, then Remote Control was stopped and only the rows in remote_control_enrollments were removed.

After confirming:

remaining=0

Remote Control was started again.

The exact same error remained:

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

So stale/duplicate enrollment state was present, but clearing it did not resolve the underlying problem.

Other troubleshooting already performed

  • ChatGPT Android app removed and reinstalled
  • Same ChatGPT account confirmed on PC and tablet
  • Windows and tablet date/time set automatically
  • codex remote-control stop / start repeated
  • Remote Control toggled off/on in desktop UI
  • Codex Desktop signed out and signed back in
  • Remote daemon process verified and restarted
  • Manual pairing-code flow tested
  • Duplicate/stale enrollment rows cleared after backup
  • Generic WebSocket diagnostics remain healthy

Steps to reproduce

  1. On Windows 11 with Codex CLI 0.158.0, authenticate with ChatGPT.
  2. Enable Remote Control in Codex Desktop.
  3. Run:
    codex remote-control start --json
  4. Observe:
    Error: Remote control is enabled on <HOSTNAME> but the connection is errored.
    
    or a prior state of status=connecting, timedOut=true.
  5. Run:
    codex remote-control pair
  6. Enter the generated pairing code in ChatGPT Android.
  7. Approve the mobile device.
  8. Observe that the mobile app falls back to the login/signup screen and the Windows host remains errored.

Expected behavior

After successful pairing and approval, the Windows app-server should establish the Remote Control transport and the Android app should show the host/session as available.

Actual behavior

Pairing can be approved on mobile, but the host never reaches a connected Remote Control state and remains errored/timed out.

Why this may be useful

This case appears different from a basic network failure because:

  • generic WebSocket handshake succeeds with HTTP 101
  • HTTP reachability is healthy
  • no proxy is configured
  • daemon and database integrity are healthy
  • enrollment can be created and pairing RPC works
  • clearing duplicate enrollment rows does not recover connectivity

This looks like a Windows-specific Remote Control enrollment/relay/auth-state issue or a backend state mismatch after pairing.

Related reports with similar symptoms exist for other platforms, e.g. #31695, #44313, #44316, and the stale-session family in #24024, but this reproduction is Windows + Android on 0.158.0 with generic WebSocket diagnostics passing.

Identifiers such as account ID, server ID, environment ID, and hostname are intentionally redacted.

Activity

  1. added
    bug
    CLI
    windows-os
    connectivity
    auth
    on Sep 29, 2026
  2. rohkorean-stack commented on Sep 29, 2026

    @rohkorean-stack
    Author

    Potential duplicates reviewed: #48774, #48777, #48555.

    This report may be in the same Android Remote authorization defect family, but it also reproduces a host-side Windows Remote Control failure: status=connecting, timedOut=true, followed by connection is errored, while codex doctor --all reports HTTP 101 WebSocket success.

    Duplicate local remote_control_enrollments were backed up and cleared, but a fresh enrollment did not recover the host connection.

    Please advise whether this should be consolidated into one of the referenced issues or retained as a Windows host-side variant.

  3. SpenceSellers commented on Sep 29, 2026

    @SpenceSellers

    I have these exact same symptoms on Linux + Android.

    On the Linux (pop-os) side:

    $ codex remote-control
    Starting app-server with remote control enabled...
    Error: Remote control is enabled on pop-os but the connection is errored.
    

    My system:

    $ uname -a
    Linux pop-os 6.17.4-76061704-generic #202510191616~1762410050~22.04~898873a SMP PREEMPT_DYNAMIC Thu N x86_64 x86_64 x86_64 GNU/Linux
    

    codex doctor --all reports no errors and shows the websocket as happily connected.

    On the android side:

    Same exact symptoms of the ticket, I am stuck in a login loop. "Authorize" to connect -> Sign in -> "Authorize" -> Sign in, forever.

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

    CLIauthbugconnectivityremotewindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions