Codex desktop on Windows reports malformed cwd for worktree threads and can target the wrong checkout
Open 💬 4 comments Opened Apr 2, 2026 by cmeeren
What version of the Codex App are you using (From “About Codex” dialog)?
26.325.31654
What subscription do you have?
Pro
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What issue are you seeing?
Session ID: 019d4953-4d9d-7740-b715-ab2a7d189db4
I hit a Windows Codex desktop issue when working in a Git worktree.
Actual behavior after repro below:
- The thread reported an invalid cwd that appeared to concatenate the worktree path and the main checkout path:
C:\Users\cmeer\.codex\worktrees\bbc1\IT6A\?\C:\Users\cmeer\Source\Repos\IT6A
- That path is not valid on Windows.
apply_patchfailed when using the thread’s default workspace context.git worktree listshowed the real worktree existed and was valid:- main checkout:
C:\Users\cmeer\Source\Repos\IT6A - worktree:
C:\Users\cmeer\.codex\worktrees\bbc1\IT6A - Because the default cwd was broken, work had to be recovered manually by extracting the intended edits and replaying them into the real worktree.
Impact:
- Workspace-relative edits can fail.
- The assistant can lose confidence about which checkout is active.
- This increases the risk of applying changes in the main checkout instead of the intended worktree.
Workaround:
- Ignore the broken default cwd.
- Manually verify the real paths with
git worktree list. - Use the real worktree path explicitly for commands until the app/thread is fixed.
Additional note:
- After manually moving the changes into the real worktree, the worktree behaved normally when addressed with its explicit path.
What steps can reproduce the bug?
- Open a repo with a main checkout plus a Git worktree on Windows.
- Start a Codex desktop thread that is supposed to be attached to the worktree.
- Check the thread/environment cwd.
- Observe that the cwd is malformed and includes both the worktree path and the main checkout path.
- Try a workspace-relative edit operation such as
apply_patch. - Observe failure or incorrect workspace targeting.
What is the expected behavior?
- A thread opened for a worktree should use that worktree as its current working directory.
- File edits and workspace-relative tools should target the worktree checkout.
Additional information
_No response_
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗