Codex Desktop thread list flips between symlink and realpath workspace projects
What version of Codex is running?
Codex Desktop / 0.122.0-alpha.1
What platform is your computer?
macOS / Darwin arm64
What issue are you seeing?
Codex Desktop appears to treat a symlinked workspace path and its resolved realpath as two different visible projects, while different code paths seem to update or filter threads using different path identities. This can make chats/threads appear to disappear from one project and reappear in the other when opened.
The chats are not deleted, but project/thread assignment becomes unstable and confusing.
Steps to reproduce
- Have an existing Codex Desktop project rooted at a path like:
``text``
/path/to/workspace-a
- Move the contents of that folder to a different path, e.g.:
``text``
/path/to/workspace-b
- Replace the original folder path with a symlink to the new path:
``text``
/path/to/workspace-a -> /path/to/workspace-b
- Open Codex Desktop using the old symlink path and/or create/open a second Codex project at the resolved destination path.
- Observe the thread list for both project entries.
Observed behavior
The thread list can appear to move between the two visible project entries:
- The old symlink-path project may initially appear to have lost its chats.
- Opening the realpath project can show the chats.
- Clicking/opening chats can cause them to disappear from one project list and reappear in the other.
- Reopening the same chats can cause another apparent reassignment.
Local state inspection suggests the underlying data is still present, but path identity is inconsistent:
- The mutable thread index can store affected threads under the resolved realpath.
- Desktop/global workspace state can simultaneously contain both saved workspace roots: the symlink path and the resolved realpath.
- The raw rollout/session metadata for an affected thread can still show the original symlink path as
cwd, while the thread index shows the resolved realpath.
This suggests at least two Codex Desktop layers disagree about path identity:
- UI/project state keyed by the user-selected path string.
- Runtime/thread indexing keyed by canonical/resolved realpath.
Expected behavior
Codex Desktop should handle symlinked workspace roots consistently. Possible acceptable behaviors:
- Canonicalize workspace roots everywhere and avoid showing duplicate projects for symlink and realpath.
- Preserve the user-selected path everywhere and avoid rewriting thread/project assignment to the realpath.
- Detect that two saved project roots resolve to the same canonical directory and warn/merge/ask the user which identity to keep.
It should not allow two visible projects pointing to the same canonical directory to split, move, or reclassify the same chat/thread list when a thread is opened.
Additional information
This is probably an uncommon workflow, but it is easy to hit when moving an active workspace and leaving a symlink behind for compatibility with old paths. The current behavior can look like data loss at first because one project suddenly appears to have no chats, even though the transcripts still exist in Codex app state.
3 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
I reviewed the auto-suggested possible duplicates.
\\?\path forms rather than macOS symlink/realpath.The closest issue I found is actually #15448, which also describes symlink path vs resolved realpath mismatch on macOS. This report may still add a distinct repro detail: if both the symlink path and realpath are present as visible projects, opening a thread can cause it to move between project lists, so the same thread history appears to “flip” between the two workspace identities.
If maintainers prefer to consolidate, #15448 seems like the best parent issue, but I’m leaving this open because the duplicate visible-project/thread-flipping behavior is a more specific failure mode.
I hit a similar Codex Desktop path identity problem on macOS with Codex Desktop 0.130.0-alpha.5.
A thread originally tied to an old workspace path kept reappearing under the stale project after restart, even after the real folder/symlink no longer existed and the active clean workspace was opened correctly.
Observed layers disagreed:
~/.codex/state_5.sqlitehad the threadcwdcorrected to the new real workspace path.~/.codex/.codex-global-state.jsonwas rewritten on app restart with the old thread marked projectless, an old workspace-root hint, and stale writable roots.cwd, which appeared to help re-poison app state on startup.Workaround that finally held:
~/.codex/.codex-global-state.json,~/.codex/state_5.sqlite, and the affected rollout/session JSONL..codex-global-state.jsonworkspace roots / project order / active roots / thread root hints / projectless thread ids / heartbeat permissionsstate_5.sqlitethreadcwdand sandbox policycwdIt would help if Codex Desktop had a supported “Relink/Normalize Project Path” action and consistently canonicalized or compared realpath/symlink paths across sidebar state, thread DB, heartbeat permissions, and session metadata.