Skip to content

Codex App worktree creation fails for WSL-backed repos with "Failed to resolve worktree git directory" #13618

Open

Description

@JJLiebig

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

26.304.1528.0 - "About Codex" doesn't seem to exist yet on Windows, this is winget list version

What subscription do you have?

Pro

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64

What issue are you seeing?

When using the Codex App's built-in "create worktree" feature on a repo whose primary checkout lives inside WSL, worktree creation appears to succeed at the Git level, but the app then fails with:

Failed to resolve worktree git directory

In my case:

  • Main repo is in WSL:
    /home/jonat/code/nextide-web
  • Codex worktree target is on Windows under:
    C:\Users\jonat\.codex\worktrees\...
  • Codex App settings is native Windows/PS7, not WSL

Observed output from the app:

[info] Starting worktree creation
Preparing worktree (detached HEAD 3ab150b)
Updating files: 100% (902/902), done.
HEAD is now at 3ab150b gitignore: ignore codex local files
[stderr] Failed to resolve worktree git directory

After this, Git showed a stale/broken worktree registration like:

    prunable: gitdir file points to non-existent location

Important detail from local debugging:

For WSL-backed repos, manual git worktree add works if the target is passed to WSL Git as a WSL path like:
/mnt/c/Users/jonat/.codex/worktrees/...
If the target is handled as C:/Users/... in the wrong context, WSL Git can treat it incorrectly or the app later fails to resolve the .git indirection.

What steps can reproduce the bug?

  1. Open Codex App on Windows.
  2. Set Agent environment to `Windows native"
  3. Open a repo whose main checkout lives in WSL, for example: /home/jonat/code/nextide-web
  4. Use the built-in Codex App worktree creation feature.
  5. Let Codex create the worktree under its default Windows worktree location, e.g.:
    C:\Users\jonat\.codex\worktrees\...
  6. Observe that Git reports the worktree creation succeeded, but Codex App then fails with:
    Failed to resolve worktree git directory

What is the expected behavior?

Codex App should successfully create and open/manage a worktree for a WSL-backed repo, even if the worktree directory is on the Windows filesystem.

Additional information

Notes:

  • This does not appear to be a repo corruption issue.
  • Cleaning up the stale worktree and re-running reproduces the same app-level failure.
  • Manual Git worktree creation from WSL works when using /mnt/c/... target paths.

Per-repo WSL/Windows native settings would be a great feature imo.

Activity

  1. added
    appIssues related to the Codex desktop app
    on Mar 5, 2026
  2. added
    bugSomething isn't working
    windows-osIssues related to Codex on Windows systems
    on Mar 5, 2026
  3. github-actions commented on Mar 5, 2026

    @github-actions
    Contributor

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

    Powered by Codex Action

  4. JJLiebig commented on Mar 5, 2026

    @JJLiebig
    Author

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

    Powered by Codex Action

    Different issue unfortunately.

  5. rippernash commented on Mar 7, 2026

    @rippernash

    This is an application breaking bug that has caused tons of trouble in my repo.

  6. ofek commented on Mar 14, 2026

    @ofek

    I think the root cause is #10347

  7. Madder commented on Apr 4, 2026

    @Madder

    Please this is the hands down the only thing blocking from switching to the codex app now...
    Please note that "Fork into a new Worktree" fails as well for repos that live in the WSL filesystem
    A lot of basic functionalities don't seem to be covered by tests to work under a WSL + Windows combo....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appIssues related to the Codex desktop appbugSomething isn't workingwindows-osIssues related to Codex on Windows systemsworktreesIssues related to worktree management

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions