Skip to content

[Android][Remote] "Authorize this phone" loops after the desktop switches ChatGPT accounts: stale cross-account environment, two pending enrollments per attempt #48555

Open

Description

@axusnetworks

Summary

After a desktop app was signed into account B and then back into account A on the same machine, pairing an Android phone with account A loops forever. After scanning the QR code, tapping Authorize this phone and completing the browser sign-in, the app returns to the same "Allow this phone to access ChatGPT on your computer?" screen with no error, and the desktop never receives a claim. This matches #39698 (trigger) and #36268 (symptom); this issue collects all findings in one place.

Environment

  • Desktop: ChatGPT Desktop 26.924.22138 on Linux (Ubuntu 26.04), bundled Codex 0.158.0-alpha.2.1
  • Phone: ChatGPT for Android 1.2026.265 on a Google-certified stock Android 17 phone (Play Integrity is not a factor; ChatGPT itself works normally)
  • Personal accounts; the host's remote-control connection stays connected throughout

Trigger

The desktop app was signed into account B for a while, then signed back into account A (same machine, same Codex home). Phone pairing for account A then looped at "Authorize this phone" (browser sign-in completes, app returns to the same screen, host never sees a claim).

What the backend showed

The desktop's single remote-control installation was registered as an environment under both accounts. Account B still had an offline environment for the same installation ID, left over from when the desktop was signed into B. Account A had its own online environment for that installation. Every failed attempt also left pending_enrollment clients on account A (two per attempt) that never completed.

What was cleared (the loop is not confirmed fixed)

  1. With account B's credentials: DELETE /backend-api/wham/remote/control/environments/{env_id} for the stale environment whose installation_id matched the desktop now used by account A (HTTP 204). GET .../wham/remote/control/environments lists them with installation_id and online.
  2. Removed account B's rows from the desktop's local remote_control_enrollments table (state_5.sqlite in the Codex home), after a backup.
  3. Removed the stale pending_enrollment clients (DELETE .../wham/remote/control/clients/{client_id}).

Ruled out

The number of linked phones (all were removed), DNS filtering and TLS interception, and the host's remote-control connection (connected throughout).

Request to OpenAI

When a desktop installation signs into a different account, the backend (or the app) should retire that installation's environment on the previous account, or the phone authorization should report an explicit account/installation conflict instead of silently looping. Related: #36268, #23112.

Additional technical detail

  • Two enrollments per failed attempt, one per success: every failed "Authorize this phone" attempt creates two pending_enrollment clients about one second apart. Every successful pairing on the same phone, on both accounts, before and after this regression, created exactly one client. This suggests the Android app starts device enrollment twice and then completes (or fails to complete) the wrong one.
  • Silent failure after the security re-check: the Android app (1.2026.265) includes handling for a rejected step-up token during Remote enrollment ("Remote-control enrollment requires interactive password and MFA step-up", a step-up-token-rejected exception, and "device-key challenge does not match local enrollment"). The loop looks like one of these failing without any message to the user.
  • App-link verification: on the affected phone, Android reports the ChatGPT app's tt.chatgpt.com link domain as legacy_failure. All other ChatGPT and OpenAI domains are verified. The browser redirect still reaches the app's WebRedirectActivity and then WebAuthenticationActivity, so the redirect is delivered. Another reporter on [Android] "Authorize this phone" loops forever after ChatGPT app reinstall — web auth completes, app never consumes the approval, host receives zero pairing claims #36268 saw the same state.
  • Host side: the desktop's remoteControl/pairing/start succeeds, and while the QR code is shown the desktop polls remoteControl/client/list about once a second. No enrolled client ever appears, and no pairing claim reaches the host.
  • Second process on the same installation: a headless codex remote-control process sharing the same Codex home was also registered. It stood by with HTTP 409 ("Remote app server already online") while the desktop held the connection. Pausing it during an attempt did not change the result.

Activity

  1. added
    bug
    app
    auth
    on Sep 26, 2026
  2. github-actions commented on Sep 26, 2026

    @github-actions
    Contributor

    Potential duplicates detected. Please review them and close your issue if it is a duplicate.

    Powered by Codex Action

  3. Neo-niu commented on Sep 28, 2026

    @Neo-niu

    Additional reproduction on macOS + Xiaomi Android, with a successful iPhone control test.

    • Android: Xiaomi 2312DRAABC, Android 15; ChatGPT 1.2026.265 (2626526). ADB package metadata reports installerPackageName=com.android.vending.
    • Normal ChatGPT conversations work on Android. The phone and desktop are signed into the same ChatGPT account; MFA is already enabled.
    • An iPhone successfully pairs with the same Mac and account, while Android repeatedly returns to login/authorization and never appears in the desktop's paired-device list.
    • Desktop account history differs slightly from the original report: this Mac previously used account A, then switched to account B. Pairing attempts began after switching to B, rather than after an A → B → A sequence. We have NOT established that stale cross-account registration is the cause.
    • Switching the Android authorization browser from Edge to Chrome did not resolve the loop. Restarting the apps and using a fresh QR code did not resolve it either.
    • A separate desktop proxy connectivity problem affected QR generation earlier. That problem was resolved, but Android authorization still loops. Please do not conflate the two failures.

    ADB logcat observations during a complete reproduction on 2026-09-28 (relative timing; callback URL, credentials and device identifiers omitted):

    1. T+0: Android ActivityTaskManager launches com.openai.feature.auth.impl.web.WebRedirectActivity in com.openai.chatgpt, with com.android.chrome as the caller.
    2. T+0.112s: the redirect is delivered to com.openai.feature.auth.impl.web.WebAuthenticationActivity.
    3. T+13.228s: a new WebAuthenticationActivity is launched as the login/authorization cycle repeats.

    This establishes that Chrome's callback reaches the app; it does NOT establish that the step-up token was accepted or enrollment completed. Release-build logcat did not expose an enrollment HTTP response or a specific token/device-key rejection, so the underlying cause remains unconfirmed.

    pm get-app-links reports tt.chatgpt.com as legacy_failure, while chatgpt.com and the other listed OpenAI domains are verified. The observed callback used the com.openai.chatgpt custom scheme and reached the app, so the tt.chatgpt.com result alone does not explain this reproduction.

    Could maintainers advise how to obtain a sanitized diagnostic for the Android step-up/enrollment result, or check whether account/device enrollment state needs repair? MFA enrollment is not an available workaround for this case because it was already enabled. No raw authentication logs, account identifiers, QR codes, tokens, or serial numbers are attached.

  4. felipesgt commented on Sep 29, 2026

    @felipesgt

    I can reproduce what appears to be the same issue.
    Host

    • Windows 11
    • Codex CLI 0.158.0
    • Remote Control daemon reports connected
    • MFA is already enabled on my OpenAI account
      Failing device
    • POCO X7 Pro (Android / HyperOS)
    • Scan/enter a fresh pairing code
    • Reach “Authorize this phone”
    • Complete the OpenAI authentication/authorization flow successfully
    • Return to the ChatGPT app
    • The app shows “Authorize this phone” again
    • Repeating the authorization results in the same loop
    • Reinstalling the ChatGPT Android app did not resolve it
      Control test
      I generated a fresh pairing code from the same Windows host and tried it on an iPhone 16 Pro. The iPhone paired successfully and Remote Control works normally with the same PC.
      So the host-side Remote Control connection is functional, while the Android enrollment fails to complete.
      I previously verified that the Codex daemon is connected and the Windows host is reachable. During the failing Android attempts, no successfully enrolled Android client appeared.
      I can provide additional logs or reproduce the issue while collecting diagnostics if that would help.
  5. kimbad1992 commented on Sep 29, 2026

    @kimbad1992

    I can reproduce the same enrollment loop on Windows, without relying on the cross-account/stale-environment trigger described in the issue.

    Environment:

    • Host: Windows 11
    • ChatGPT Desktop: 26.924.22138
    • Phone: Xiaomi 17 Ultra (2512BPNDAG)
    • Android 17 / HyperOS
    • ChatGPT Android: 1.2026.265
    • An older Galaxy Fold device had previously enrolled successfully on the same account.

    Observed behavior:

    1. Scan a fresh Remote pairing QR code.
    2. Tap “Authorize this phone.”
    3. Complete the browser authentication and OTP step.
    4. “Pairing…” appears briefly.
    5. The app returns to “Authorize this phone.”
    6. The host receives no pairing claim.

    Each failed attempt creates exactly two pending_enrollment clients approximately two seconds apart.

    I performed two controlled server-side experiments:

    • Deleted the older pending enrollment immediately and preserved the newer one.
    • Deleted the newer pending enrollment immediately and preserved the older one.

    Both variants still returned to “Authorize this phone.” This suggests that duplicate pending rows are a symptom, not merely a backend conflict between the two rows.

    Android ActivityTaskManager logs show that the authentication callback is delivered successfully:

    • Chrome launches WebRedirectActivity.
    • It forwards the callback to the existing WebAuthenticationActivity.
    • Android reports result code=3.
    • Android then logs Duplicate finish request for WebRedirectActivity.
    • MainActivity is displayed again.
    • No crash, KeyMint/keystore error, or explicit enrollment error is logged.
    • The client never transitions to enrolled_device_key.

    Additional controls that did not change the result:

    • Cleared/reinstalled the Android app.
    • Removed all stale pending enrollments before each test.
    • Verified the host environment and WebSocket were healthy.
    • Tested different networks with VPN disabled.
    • Removed Bitwarden as credential provider and used Google Password Manager.
    • Enabled all supported ChatGPT app links.
    • Completed OTP without leaving the authentication flow, using another phone to read the OTP.
    • Tested both the system camera and the in-app QR scanner.

    This reproduction suggests that Android 17/HyperOS exposes an enrollment state/callback lifecycle bug in ChatGPT Android 1.2026.265. The app appears to lose or reject the local enrollment context after the successful step-up callback, before enroll/finish.

    It would help if the app surfaced whether the failure is:

    • step-up-token-rejected,
    • a device-key/challenge mismatch, or
    • missing local enrollment state after the authentication callback.
  6. ohjime commented on Sep 29, 2026

    @ohjime

    Also running into this Issue. Just got a new Android Phone for my ChatGPT Pro 5x Plan. Feeling very disappointed that I can't use the Remote Feature which is why I got the plan in the first place.

  7. 1KOD commented on Sep 30, 2026

    @1KOD

    I'm experiencing the same issue when trying to manage/use OpenAI Codex from a mobile device.

    During the authorization/login process, the authorization page gets stuck in a redirect loop and never completes successfully. Because of this, I'm unable to finish the authentication process from mobile.

    The issue appears to be the same as described here.

    It would be great if the Codex team could investigate this, as being able to authorize and manage Codex from mobile is important for remote usage.

    Device: Android
    Browser / Environment: Mobile browser / ChatGPT mobile environment

    I can provide additional logs, screenshots, or reproduction details if needed.

  8. different55 commented on Sep 30, 2026

    @different55

    Can reproduce on Android with a macOS host.

  9. nickbeth commented on Sep 30, 2026

    @nickbeth

    Can reproduce on Android with a Linux host as well.

  10. zekikaraca commented on Sep 30, 2026

    @zekikaraca

    I am also stuck in the same loop with Android to MacOS.

  11. bautistaib commented on Sep 30, 2026

    @bautistaib

    I’m seeing the same “Authorize this phone” loop on Windows, with the same Android app version reported here.

    Environment

    • Windows package: OpenAI.Codex 26.928.1915.0
    • Internal desktop version reported by diagnostics: 26.928.20755, build 12246, production channel; updater reports up to date.
    • ChatGPT Android: 1.2026.265, versionCode 2626541
    • Phone OS: HyperOS 3.0.302
    • I use a single personal ChatGPT account, confirmed to be the same on desktop and mobile. An account B → account A switch is not a known trigger in my case.

    Reproduction

    1. Scan the QR from desktop Settings → Connections.
    2. Tap “Authorize this phone” in ChatGPT Android.
    3. Complete browser login, authenticator MFA, and the Codex Remote consent screen.
    4. Return to ChatGPT, briefly see “Pairing…”, then return to “Authorize this phone”.
    5. The phone never appears in the connected devices list.

    Local diagnostics

    • Desktop logs show a successful connection to wss://chatgpt.com/backend-api/wham/remote/control/server.
    • remoteControl/pairing/start returns errorCode=null. This establishes that the start RPC succeeds, not that enrollment completes.
    • Android system logs show the browser callback reaching com.openai.feature.auth.impl.web.WebRedirectActivity, then being forwarded to WebAuthenticationActivity. No app crash was recorded.

    Two failed attempts have these callback timestamps:

    • 2026-09-30 00:44:23.551 UTC: callback reaches WebRedirectActivity; forwarded at 00:44:23.569 UTC.
    • 2026-09-30 00:49:34.583 UTC: callback reaches WebRedirectActivity; forwarded at 00:49:34.609 UTC.

    The second attempt used mobile data with Android Private DNS disabled. It produced the same loop.

    Callback delivery is observable, but the captured logs do not establish whether the authorization code/token exchange or enrollment request succeeds.

    Other unsuccessful tests

    • A second phone, with Tailscale disabled on the PC.
    • Temporarily disabling Windows Firewall.
    • A different PC connection via a mobile hotspot.
    • Enabling supported app links and using Chrome.
    • Reinstalling the ChatGPT Android app.
    • Rebooting Windows and signing out/in on desktop.

    I have not verified whether my attempts create duplicate pending_enrollment records or stale cross-account environments.

    Could maintainers correlate the UTC timestamps above with the Remote authentication/enrollment backend? Can the duplicate pending-enrollment condition also occur without an account switch?

  12. 8 remaining items

  13. ohjime commented on Oct 1, 2026

    @ohjime

    @arielgoes Im running Ubuntu as well (26.924.51851). Updating the Android Mobile App is what did it for me.

  14. arielgoes commented on Oct 1, 2026

    @arielgoes

    @ohjime That's weird. I reinstalled both the Desktop and Mobile apps. Same issue. My mobile app was already using the latest version, and so was the Desktop app.

  15. pmackey2 commented on Oct 1, 2026

    @pmackey2

    @arielgoes what version of the mobile app are you using?

    In the Play store, I'm part of the beta program. I'm possibly running a newer version.

  16. arielgoes commented on Oct 1, 2026

    @arielgoes

    @pmackey2 I'm not part of the beta program. My version is 1.2026.265. Your mobile version ends with 272. So, there must be a hotfix that was not yet dispatched from dev to production branch I guess

  17. ohjime commented on Oct 1, 2026

    @ohjime

    Yeah I guess I'm on the beta as well, because my latest version ends with 272.

  18. Dashanchik commented on Oct 1, 2026

    @Dashanchik

    @pmackey2 works with beta Android 17, Macos 27

  19. different55 commented on Oct 1, 2026

    @different55

    Beta works.

  20. zekikaraca commented on Oct 1, 2026

    @zekikaraca

    Beta indeed works for me as well. Just connected.

  21. 1KOD commented on Oct 1, 2026

    @1KOD

    Beta indeed works for me as well. Just connected.

  22. winner1104 commented on Oct 1, 2026

    @winner1104

    Chatgpt Codex & OWL 26.928.21956 on win11 26H2 26300.9457
    Pixel 10 Pro XL Android 17 QPR2 Beta

    when I scan the QR code that chatgpt generated for connecting, my phone just keep looping between authorize this phone >>>log in( I'm using google account for log in) >> authorize >> authorize this phone , nothing like error or something wrong sign shows up during this loop

  23. bautistaib commented on Oct 1, 2026

    @bautistaib

    I’m seeing the same “Authorize this phone” loop on Windows, with the same Android app version reported here.

    Environment

    * Windows package: `OpenAI.Codex 26.928.1915.0`
    
    * Internal desktop version reported by diagnostics: `26.928.20755`, build `12246`, production channel; updater reports up to date.
    
    * ChatGPT Android: `1.2026.265`, versionCode `2626541`
    
    * Phone OS: HyperOS `3.0.302`
    
    * I use a single personal ChatGPT account, confirmed to be the same on desktop and mobile. An account B → account A switch is not a known trigger in my case.
    

    Reproduction

    1. Scan the QR from desktop Settings → Connections.
    
    2. Tap “Authorize this phone” in ChatGPT Android.
    
    3. Complete browser login, authenticator MFA, and the Codex Remote consent screen.
    
    4. Return to ChatGPT, briefly see “Pairing…”, then return to “Authorize this phone”.
    
    5. The phone never appears in the connected devices list.
    

    Local diagnostics

    * Desktop logs show a successful connection to `wss://chatgpt.com/backend-api/wham/remote/control/server`.
    
    * `remoteControl/pairing/start` returns `errorCode=null`. This establishes that the start RPC succeeds, not that enrollment completes.
    
    * Android system logs show the browser callback reaching `com.openai.feature.auth.impl.web.WebRedirectActivity`, then being forwarded to `WebAuthenticationActivity`. No app crash was recorded.
    

    Two failed attempts have these callback timestamps:

    * **2026-09-30 00:44:23.551 UTC**: callback reaches `WebRedirectActivity`; forwarded at `00:44:23.569 UTC`.
    
    * **2026-09-30 00:49:34.583 UTC**: callback reaches `WebRedirectActivity`; forwarded at `00:49:34.609 UTC`.
    

    The second attempt used mobile data with Android Private DNS disabled. It produced the same loop.

    Callback delivery is observable, but the captured logs do not establish whether the authorization code/token exchange or enrollment request succeeds.

    Other unsuccessful tests

    * A second phone, with Tailscale disabled on the PC.
    
    * Temporarily disabling Windows Firewall.
    
    * A different PC connection via a mobile hotspot.
    
    * Enabling supported app links and using Chrome.
    
    * Reinstalling the ChatGPT Android app.
    
    * Rebooting Windows and signing out/in on desktop.
    

    I have not verified whether my attempts create duplicate pending_enrollment records or stale cross-account environments.

    Could maintainers correlate the UTC timestamps above with the Remote authentication/enrollment backend? Can the duplicate pending-enrollment condition also occur without an account switch?

    Since today, it works on beta (wasn't working on beta yesterday)

  24. winner1104 commented on Oct 2, 2026

    @winner1104

    still unable to connect for me.......
    even chatgpt desk had an update to 26.928.40906

  25. ahmadfarisfs commented on Oct 4, 2026

    @ahmadfarisfs

    Atill looping here mac os chatgpt26.930.31428
    With android app latest

  26. abhinavmusrif commented on Oct 4, 2026

    @abhinavmusrif

    Additional Windows + Android reproduction, checked on October 4, 2026.

    Environment:

    • Windows desktop internal version 26.930.31730, build 12947, production channel.
    • Installed Windows package version 26.930.3930.0.
    • Selected Codex CLI reports 0.160.0.
    • ChatGPT Android 1.2026.265, versionCode 2626541.
    • Phone model RMX3471.

    Observed behavior:

    1. Generate a fresh Remote pairing code in desktop Settings → Connections → Control this PC.
    2. Enter the code manually on Android; the app accepts it and proceeds to “Authorize this phone.”
    3. Follow the OpenAI browser authentication/security re-check flow.
    4. Return to ChatGPT, see “Pairing…” briefly, then return to the phone authorization prompt. No usable Remote connection appears.

    Local diagnostic findings (summaries only):

    • Desktop remoteControl/enable and remoteControl/pairing/start RPCs returned success during the attempts; this does not prove enrollment succeeded.
    • Android activity records show WebRedirectActivity and WebAuthenticationActivity during the browser return. Callback delivery is observable, but token acceptance/enrollment completion is not.
    • A bounded search of the captured ChatGPT process logs did not expose an explicit step-up-token-rejected, device-key challenge mismatch, invalid_grant, or enrollment-expiry reason. The underlying rejection is therefore unconfirmed.
    • Android app-link verification reports tt.chatgpt.com as 1024, while the other listed ChatGPT/OpenAI domains are verified. This alone is not established as the cause.
    • An earlier desktop MFA-requirement request returned HTTP 432, “Workspace routing is unavailable.” Later pairing-start RPCs succeeded; we have not established whether the earlier error is related.

    We have not verified duplicate pending enrollments, a stale cross-account environment, or a beta-app workaround on this installation. Recent comments suggest newer Android beta builds help some users; could maintainers confirm the fixed Android version and stable rollout, or provide a supported way to obtain the actual post-callback enrollment rejection?

    No credentials, tokens, pairing codes, account email addresses, device serial numbers, callback URLs, or raw private logs are included.

  27. Peacemaker228 commented on Oct 4, 2026

    @Peacemaker228

    New version available, problem is solved for me. I have OnePlus 15

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

    Linuxappauthbugremote

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions