Skip to content

Windows Codex Desktop rewrites threads.cwd to \\?\-prefixed paths on startup, splitting one workspace into two and hiding thread history #19128

@moguuu21

Description

@moguuu21

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    appIssues related to the Codex desktop appbugSomething isn't workingsessionIssues involving session (thread) management, resuming, forking, naming, archivingwindows-osIssues related to Codex on Windows systems

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions