Codex Desktop thread list flips between symlink and realpath workspace projects

Open 💬 3 comments Opened Apr 18, 2026 by PolymerTheory
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

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

  1. Have an existing Codex Desktop project rooted at a path like:

``text
/path/to/workspace-a
``

  1. Move the contents of that folder to a different path, e.g.:

``text
/path/to/workspace-b
``

  1. Replace the original folder path with a symlink to the new path:

``text
/path/to/workspace-a -> /path/to/workspace-b
``

  1. Open Codex Desktop using the old symlink path and/or create/open a second Codex project at the resolved destination path.
  1. 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.

View original on GitHub ↗

3 Comments

github-actions[bot] contributor · 4 months ago

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

  • #18253
  • #16901
  • #17317

Powered by Codex Action

PolymerTheory · 4 months ago

I reviewed the auto-suggested possible duplicates.

  • #18253 looks closely related: same broad class of path identity mismatch causing thread history to disappear, but on Windows with OneDrive/junction/\\?\ path forms rather than macOS symlink/realpath.
  • #16901 is related to thread visibility after workspace restructuring, but appears broader and may involve pagination/thread-list filtering rather than the specific symlink-vs-realpath duplicate-project behavior.
  • #17317 shares the “threads disappear when clicked” symptom, but bundles several sidebar/state bugs and does not isolate the symlink/realpath project identity issue.

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.

omarpinarecords · 3 months ago

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.sqlite had the thread cwd corrected to the new real workspace path.
  • ~/.codex/.codex-global-state.json was rewritten on app restart with the old thread marked projectless, an old workspace-root hint, and stale writable roots.
  • The old session/rollout metadata also contained the stale original cwd, which appeared to help re-poison app state on startup.
  • The thread data itself was intact; this was routing/sidebar/project assignment, not data loss.

Workaround that finally held:

  1. Quit Codex completely.
  2. Back up ~/.codex/.codex-global-state.json, ~/.codex/state_5.sqlite, and the affected rollout/session JSONL.
  3. Normalize the old path to the real workspace path in:
  • .codex-global-state.json workspace roots / project order / active roots / thread root hints / projectless thread ids / heartbeat permissions
  • state_5.sqlite thread cwd and sandbox policy
  • affected rollout/session metadata containing the stale cwd
  1. Reopen Codex.

It 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.