Codex remote-control pairing reuses cloned Mac installation_id and steals another host's connection

Open
#33,830 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Active
Tech stack
macos, rust, sqlite

Research direction

Start by tracing how ~/.codex/installation_id is used with .codex-global-state.json and state_5.sqlite, especially the remote_control_enrollments row for Codex Desktop. Reproduce the cloned-installation flow and inspect iOS pairing behavior. Done means a migrated Mac gets a distinct remote-control identity without removing chats or workspaces, while the original host remains connected.

Written by the indexing model from the issue text.

Description

app bug remote

Summary

When a Mac has been cloned/migrated from another Mac, Codex/ChatGPT Desktop can reuse the original machine's remote-control identity instead of creating a new host. The iPhone ChatGPT app then shows the new Mac under the old Mac label/connection and effectively steals the old host's connection.

Observed on macOS with ChatGPT Desktop/Codex:

  • Source machine: MBP64
  • Cloned/current machine: MBP16
  • Current host name: Alans-MacBook-Pro-16.local
  • Pairing UI/display still reused the MBP64 connection/display name
  • Local app-server logs previously showed remote-control collision behavior, including the old server/env being reused

Root Cause Found Locally

The durable source was ~/.codex/installation_id, which still contained the original MBP64 installation UUID after the machine clone/migration.

Clearing only these did not work because Codex recreated the same remote-control environment from the old installation ID:

  • ~/.codex/.codex-global-state.json keys:
    • electron-local-remote-control-installation-id
    • electron-local-remote-control-environment-id
    • electron-remote-control-client-enrollments
    • added-remote-control-env-ids
  • ~/.codex/state_5.sqlite table:
    • remote_control_enrollments row for app_server_client_name = 'Codex Desktop'

The identity only changed after also rotating ~/.codex/installation_id.

Local Fix That Worked

  1. Quit ChatGPT Desktop.
  2. Back up ~/.codex/.codex-global-state.json, .bak, ~/.codex/installation_id, and ~/.codex/state_5.sqlite*.
  3. Replace ~/.codex/installation_id with a fresh UUID.
  4. Delete the local global-state keys listed above.
  5. Delete the remote_control_enrollments row where app_server_client_name = 'Codex Desktop'.
  6. Reopen ChatGPT Desktop.

After this, the desktop enrollment changed from the old cloned environment to a new environment for Alans-MacBook-Pro-16.local.

Expected Behavior

Codex/ChatGPT Desktop should detect cloned or migrated installations and avoid reusing another physical Mac's remote-control identity. Pairing from iOS should create a distinct host record for the new Mac instead of updating/replacing the previous Mac's record.

Suggested Product Fix

One or more of:

  • Include a local machine-specific factor in remote-control identity derivation or validation.
  • Detect when ~/.codex/installation_id is reused on a different macOS host/hardware identity and prompt/regenerate.
  • Add a UI action to reset the local remote-control pairing identity without wiping chats/workspaces.
  • During iOS pairing, warn if an existing remote-control host has the same installation identity but a different hostname/hardware context.

Notes

I avoided posting full raw IDs here, but the pattern was clear: the old installation UUID persisted in ~/.codex/installation_id, and the remote-control environment/server IDs were regenerated from it until that file was rotated.

Dominant language
Rust
Stars
125k
Forks
19.5k
Avg merge
1m
Merged PRs (30d)
1k

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openai/codex

All issues in openai/codex

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.