Skip to content

Codex Mobile restores stale revoked Mac connection and fails with 403 #23290

Open

Description

@djalmirmariano

What version of the Codex App are you using (From “About Codex” dialog)?

26.513.31313

What subscription do you have?

Pro

What platform is your computer?

Darwin 25.4.0 arm64 arm

What issue are you seeing?

Summary

Codex Mobile restores an old revoked Mac connection and cannot load messages. The iPhone app shows the old Mac connection automatically, but opening any thread fails with 403.

Environment

  • Codex Desktop: 26.513.31313
  • macOS: 26.4.1
  • iPhone: ChatGPT/Codex mobile app with Codex Mobile enabled
  • Connection shown on iPhone: MacBook-Air-de-Djalmir.local

Error

On iPhone, opening a thread shows:

Error loading messages: There is a problem with your request. (403, e7fec3e2-e528-4110-929b-909d742fd708)

What happened

  1. iPhone was connected to Codex Desktop.
  2. The connection had issues.
  3. I revoked the iPhone from Codex Desktop.
  4. I tried to reconnect using "Manage connections" / "Add device" on Desktop.
  5. Desktop shows a QR code.
  6. Scanning the QR code sends me to the iPhone app.
  7. The iPhone app immediately restores the old Mac connection instead of creating a clean new connection.
  8. The old connection lists chats, but opening any chat fails with 403.

Things already tried

  • Quit/reopened Codex Desktop.
  • Revoked the iPhone from Desktop.
  • Deleted and reinstalled the iPhone app using Delete App, not Offload App.
  • Reset local Desktop remote/mobile state.
  • After reset, Desktop generated a new local environment_id, but iPhone still restored the stale old connection.
  • The Codex Desktop UI only lets me generate a QR code; iPhone UI does not offer a way to delete/remove the stale Mac connection.

Expected behavior

After revoking a device, the iPhone should either remove the old Mac connection or allow me to delete it, and scanning a new QR code should create a fresh working connection.

Actual behavior

The iPhone restores the old connection and every thread fails with 403.

Request

Please provide a way to clear stale Codex Mobile / remote-control enrollments, or fix backend cleanup after revoke.

What steps can reproduce the bug?

  1. Connect an iPhone to Codex Desktop using Codex Mobile / Manage connections.
  2. Revoke the iPhone from Codex Desktop.
  3. On Codex Desktop, open Manage connections and click Add device.
  4. Scan the new QR code with the iPhone.
  5. The iPhone app opens and immediately restores the old Mac connection instead of creating a clean new connection.
  6. Open any thread from that restored Mac connection.
  7. The iPhone app fails to load messages with a 403 error.

What is the expected behavior?

No response

Additional information

No response

Activity

  1. added
    bugSomething isn't working
    iOSIssues related to the Codex iOS app
    authIssues related to authentication and accounts
    on May 18, 2026
  2. djalmirmariano commented on May 18, 2026

    @djalmirmariano
    Author

    Possibly related to #23110.

    One extra detail that may help triage: this does not look like only a local Desktop cache issue. After clearing local Desktop remote/mobile state, Codex Desktop generated a new local environment_id, but the iPhone still restored the stale old Mac connection.

    Expected behavior:

    • Revoking the iPhone from Codex Desktop should remove or invalidate the mobile-side connection.
    • The iPhone app should expose a way to remove/reset a stale Desktop connection.
    • Scanning a new QR code should either create a new working pairing or show an explicit error.

    Additional information:

    • The stale connection is partially restored: the iPhone can list chats from the old Mac connection, but opening any thread fails with 403.
    • Deleting and reinstalling the iPhone app with “Delete App” did not clear the stale connection.
  3. fiigmnt commented on May 18, 2026

    @fiigmnt

    I tried this gist: https://gist.github.com/sirmalloc/fefef0b65729d9644794a3c67d1a28b9

    but every time I open codex desktop it recreates the deleted session.

  4. JesseZhang97 commented on May 19, 2026

    @JesseZhang97

    Had the same problem, need a clean unbind&rebind logic when have connection problems at least.

  5. JesseZhang97 commented on May 21, 2026

    @JesseZhang97

    The detail that Desktop generated a new local environment_id while iPhone restored the old Mac connection is the key discriminator here.

    That suggests the stale state may not be only a Desktop local-cache issue. There may be an account-side or mobile-side association that survives local reset and wins over the newly generated desktop environment.

    I would try to capture which identity appears in the failing 403 path:

    • old environment / connection id that was supposed to be revoked;
    • new environment id generated after Desktop reset;
    • mobile-side device/client id after reinstall;
    • request id from the failed message-load call.

    If the 403 references the old connection, the fix is likely clean unbind/rebind with a tombstone or generation counter so mobile cannot resurrect revoked hosts. If it references the new environment, the problem is closer to auth/permission propagation for the fresh pairing.

    Thanks for the clarification! The issue was resolved by:

    1. Revoking device access for the Codex app
    2. Deleting the remote environment
    3. Reinstalling the ChatGPT app
  6. BuildMyIO-C commented on Jun 13, 2026

    @BuildMyIO-C

    Adding another data point because I think I’m hitting the same class of issue, though my setup is Mac Codex app -> Windows Codex Desktop instead of iPhone -> Mac.

    In my case this did not start as a normal Windows/Mac networking problem. The Windows host was still able to reach chatgpt.com, remote control showed Connected, and the Windows remote_control_enrollments row kept refreshing with new environment/server ids. But the Mac client either failed to connect or appeared to use stale state before it ever reached the Windows host cleanly.

    The sequence that seemed to make it worse:

    1. Mac had a saved Windows host connection.
    2. Remote file browsing started acting odd: folder tree showed, but files would not load.
    3. I removed the connection on the Mac.
    4. It did not clearly disappear on the Windows side, so I revoked it from Windows.
    5. After that, trying to add/reconnect kept failing or behaving inconsistently.

    The interesting part: Windows logs showed the host enrollment continuing to refresh, but Mac-side state still had stale remote-control environment ids in ~/.codex/.codex-global-state.json. The selected remote host id and auto-connect entries pointed at older remote-control:env_... values, while Windows had already rotated to a newer environment id. So the client looked like it was trying to restore or target stale remote-control state instead of creating a clean new connection.

    This makes me think the root issue may be stale remote-control auth/enrollment state after revoke, not a platform-specific Windows/Mac problem. It would be helpful if Codex exposed a supported way to clear stale remote hosts / revoked remote-control enrollments without deleting the whole .codex folder or risking local sessions.

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

    appIssues related to the Codex desktop appauthIssues related to authentication and accountsbugSomething isn't workingiOSIssues related to the Codex iOS appremote

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions