Codex Mobile restores stale revoked Mac connection and fails with 403
Open 💬 7 comments Opened May 18, 2026 by djalmirmariano
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
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
- iPhone was connected to Codex Desktop.
- The connection had issues.
- I revoked the iPhone from Codex Desktop.
- I tried to reconnect using "Manage connections" / "Add device" on Desktop.
- Desktop shows a QR code.
- Scanning the QR code sends me to the iPhone app.
- The iPhone app immediately restores the old Mac connection instead of creating a clean new connection.
- 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?
- Connect an iPhone to Codex Desktop using Codex Mobile / Manage connections.
- Revoke the iPhone from Codex Desktop.
- On Codex Desktop, open Manage connections and click Add device.
- Scan the new QR code with the iPhone.
- The iPhone app opens and immediately restores the old Mac connection instead of creating a clean new connection.
- Open any thread from that restored Mac connection.
- The iPhone app fails to load messages with a 403 error.
What is the expected behavior?
_No response_
Additional information
_No response_
7 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
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:
Additional information:
I tried this gist: https://gist.github.com/sirmalloc/fefef0b65729d9644794a3c67d1a28b9
but every time I open codex desktop it recreates the deleted session.
Had the same problem, need a clean unbind&rebind logic when have connection problems at least.
The detail that Desktop generated a new local
environment_idwhile 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:
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:
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 showedConnected, and the Windowsremote_control_enrollmentsrow 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:
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 olderremote-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
.codexfolder or risking local sessions.