What version of the Codex App are you using (From “About Codex” dialog)?
23.35.950
What subscription do you have?
Plus
What platform is your computer?
Microsoft Windows NT 10.0.22631.0 x64
What issue are you seeing?
When Codex Desktop is installed on Windows and WSL mode is enabled, the WSL app-server inherits the Windows CODEX_HOME (C:\Users\<user>\.codex) instead of using a WSL-native home directory.
As a result, worktrees are resolved under /mnt/c/Users/<user>/.codex/worktrees/... even when the repository itself lives entirely inside WSL, for example under /home/<user>/Development/....
This causes two classes of problems:
- Worktrees are created on the Windows-mounted filesystem instead of native WSL storage, which makes Git operations much slower.
- The desktop app can keep stale references to Windows-side worktree paths even after the real worktree exists in WSL, which breaks branch/worktree/Git features intermittently.
During debugging I also saw related failures such as:
WSL mode is enabled but no eligible distro is available
SqliteError: database is locked
failed to read CODEX_HOME ... os error 161 when trying to move the entire desktop CODEX_HOME to a WSL UNC path
What steps can reproduce the bug?
- Install Codex Desktop from the Microsoft Store on Windows.
- Enable WSL mode and select an Ubuntu distro.
- Keep the repository inside WSL, for example
/home/<user>/Development/Monest/monest-prompts.
- Open that repository in Codex Desktop.
- Use a Git feature that relies on worktrees, such as creating a worktree or selecting a Codex-managed branch/worktree.
- Observe that the worktree path is resolved under
/mnt/c/Users/<user>/.codex/worktrees/... instead of a WSL-native path.
- In some cases, after restarting the app or moving state around, Git features start failing and the UI may still try to access the old Windows path even though the actual worktree is already in WSL.
What is the expected behavior?
When WSL mode is enabled, the WSL app-server should use a WSL-native Codex home/worktree root by default, separate from the Windows desktop app state.
Expected behavior:
- Worktrees should be created on the Linux filesystem, not under
/mnt/c/..., when the repo is inside WSL.
- The app should not keep stale references to previous Windows-side worktree paths.
- Windows desktop state (for example SQLite/UI state) and WSL worktree storage should be handled separately so that fixing worktree location does not require moving the entire desktop database into WSL.
Additional information
Relevant paths from my machine:
- Repository root:
/home/matheuspimenta/Development/Monest/monest-prompts
- Legacy Windows-side worktree path that the app still referenced:
/mnt/c/Users/matheus.pimenta/.codex/worktrees/a923/monest-prompts
- Actual WSL worktree path that worked correctly:
/home/matheuspimenta/.codex-app/worktrees/a923/monest-prompts
What I found while debugging:
- The desktop WSL app-server was launched with
CODEX_HOME=/mnt/c/Users/matheus.pimenta/.codex.
- The reliable workaround was to override
CODEX_HOME inside WSL only for Codex Desktop, using a conditional export in ~/.profile keyed on CODEX_INTERNAL_ORIGINATOR_OVERRIDE=Codex Desktop.
- After that, the WSL app-server used
/home/matheuspimenta/.codex-app and worktrees resolved correctly on the Linux filesystem.
- I still needed a compatibility symlink for an old path because the desktop app had cached/referenced
/mnt/c/Users/matheus.pimenta/.codex/worktrees/a923/monest-prompts.
This looks like the root issue:
- In WSL mode, the desktop app should not blindly propagate the Windows
CODEX_HOME into the WSL runtime.
- The WSL runtime should choose a Linux-native default for worktrees and internal state, or at least split WSL worktree storage from Windows desktop state explicitly.
What version of the Codex App are you using (From “About Codex” dialog)?
23.35.950
What subscription do you have?
Plus
What platform is your computer?
Microsoft Windows NT 10.0.22631.0 x64
What issue are you seeing?
When Codex Desktop is installed on Windows and WSL mode is enabled, the WSL app-server inherits the Windows
CODEX_HOME(C:\Users\<user>\.codex) instead of using a WSL-native home directory.As a result, worktrees are resolved under
/mnt/c/Users/<user>/.codex/worktrees/...even when the repository itself lives entirely inside WSL, for example under/home/<user>/Development/....This causes two classes of problems:
During debugging I also saw related failures such as:
WSL mode is enabled but no eligible distro is availableSqliteError: database is lockedfailed to read CODEX_HOME ... os error 161when trying to move the entire desktopCODEX_HOMEto a WSL UNC pathWhat steps can reproduce the bug?
/home/<user>/Development/Monest/monest-prompts./mnt/c/Users/<user>/.codex/worktrees/...instead of a WSL-native path.What is the expected behavior?
When WSL mode is enabled, the WSL app-server should use a WSL-native Codex home/worktree root by default, separate from the Windows desktop app state.
Expected behavior:
/mnt/c/..., when the repo is inside WSL.Additional information
Relevant paths from my machine:
/home/matheuspimenta/Development/Monest/monest-prompts/mnt/c/Users/matheus.pimenta/.codex/worktrees/a923/monest-prompts/home/matheuspimenta/.codex-app/worktrees/a923/monest-promptsWhat I found while debugging:
CODEX_HOME=/mnt/c/Users/matheus.pimenta/.codex.CODEX_HOMEinside WSL only for Codex Desktop, using a conditional export in~/.profilekeyed onCODEX_INTERNAL_ORIGINATOR_OVERRIDE=Codex Desktop./home/matheuspimenta/.codex-appand worktrees resolved correctly on the Linux filesystem./mnt/c/Users/matheus.pimenta/.codex/worktrees/a923/monest-prompts.This looks like the root issue:
CODEX_HOMEinto the WSL runtime.