codex - 💡(How to fix) Fix Windows Codex Desktop rewrites threads.cwd to \\?\-prefixed paths on startup, splitting one workspace into two and hiding thread history [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#19128Fetched 2026-04-24 06:00:22
View on GitHub
Comments
1
Participants
2
Timeline
7
Reactions
0
Author
Timeline (top)
labeled ×4cross-referenced ×2commented ×1

Root Cause

This causes thread history to appear missing in the UI because the app only shows one group depending on which path form is currently used.

RAW_BUFFERClick to expand / collapse

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

26.421.11020

What subscription do you have?

ChatGPT Plus

What platform is your computer?

Microsoft Windows NT 10.0.26100.0 x64

What issue are you seeing?

On Windows, Codex Desktop rewrites workspace paths in local state to \\?\-prefixed paths and treats the same physical directory as two different workspaces.

For my project:

  • C:\01subject\03design\01do\movie\UI_prototype
  • \\?\C:\01subject\03design\01do\movie\UI_prototype

These both point to the same directory, but Codex stores them separately in C:\Users\XTIA\.codex\state_5.sqlite under threads.cwd.

This causes thread history to appear missing in the UI because the app only shows one group depending on which path form is currently used.

I also found that session_index.jsonl had missing thread index entries, but I repaired that locally. That repair is stable.

The unstable part is threads.cwd: every time Codex Desktop starts, it rewrites rows back to the \\?\ form. So local repair is only temporary.

Current findings:

  • config.toml is normalized and stable
  • session_index.jsonl is repaired and stable
  • state_5.sqlite -> threads.cwd is rewritten by Codex Desktop at runtime and splits one workspace into two

This makes history look lost even though the raw session files still exist under:

  • C:\Users\XTIA\.codex\sessions
  • C:\Users\XTIA\.codex\archived_sessions

What steps can reproduce the bug?

  1. On Windows, use Codex Desktop with a workspace that already has thread history stored under a normal path, for example: C:\01subject\03design\01do\movie\UI_prototype

  2. Quit Codex Desktop completely.

  3. Inspect C:\Users\XTIA\.codex\state_5.sqlite, table threads.

  4. Normalize the workspace path by stripping any \\?\ prefix from threads.cwd.

  5. Start Codex Desktop again.

  6. Reinspect threads.cwd.

Observed result:

  • Codex Desktop rewrites the same workspace back to: \\?\C:\01subject\03design\01do\movie\UI_prototype

This splits one physical workspace into two logical workspace keys and thread history appears missing in the UI.

I reproduced this across three repair rounds:

  • Round 1: repaired 493 \\?\ rows -> restart -> issue returned
  • Round 2: repaired 164 \\?\ rows -> restart -> issue returned
  • Round 3: repaired 164 \\?\ rows -> restart -> issue returned immediately

For the affected project, 99 threads were split across the two path forms before repair and then rewritten back after launch.

I also repaired session_index.jsonl separately:

  • index size went from 93 to 898 entries
  • affected project coverage went from 2/99 to 99/99

That fix stayed stable, but threads.cwd still gets rewritten by Codex Desktop on startup.

What is the expected behavior?

Codex Desktop should normalize Windows workspace paths to a single canonical form before persisting them to local state.

For the same physical workspace, these path forms should be treated as identical and must not create separate workspace identities:

  • C:\01subject\03design\01do\movie\UI_prototype
  • \\?\C:\01subject\03design\01do\movie\UI_prototype

Expected results:

  • only one logical workspace entry exists for the project
  • threads.cwd is stored consistently in one canonical format
  • thread history remains visible across restarts
  • launching Codex Desktop does not rewrite existing thread rows into a different path form
  • the UI shows the full history for the workspace instead of splitting threads across two path variants

Additional information

No response

extent analysis

TL;DR

Codex Desktop may need a configuration change or code update to normalize Windows workspace paths to a single canonical form, preventing the splitting of thread history.

Guidance

  • Verify that the issue is indeed caused by the \\?\ prefix in the workspace paths by checking the threads.cwd table in state_5.sqlite before and after restarting Codex Desktop.
  • Consider manually normalizing the workspace paths in state_5.sqlite to a single canonical form (e.g., without the \\?\ prefix) to see if this resolves the issue temporarily.
  • Investigate if there are any configuration options or environment variables that can be set to influence how Codex Desktop handles Windows workspace paths.
  • Check for any existing issues or pull requests in the Codex App repository that may address this specific problem.

Notes

The issue seems to be specific to Windows and the use of the \\?\ prefix in workspace paths. The fact that manually normalizing the paths provides a temporary fix suggests that the issue is indeed related to path normalization.

Recommendation

Apply a workaround by manually normalizing the workspace paths in state_5.sqlite to a single canonical form until a more permanent fix is available. This may involve scripting the normalization process to automate it.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix Windows Codex Desktop rewrites threads.cwd to \\?\-prefixed paths on startup, splitting one workspace into two and hiding thread history [1 comments, 2 participants]