[Windows][WSL] 26.721.3404 marks valid WSL repositories as non-Git and reports "Git is unavailable"
Codex App version
- Microsoft Store package:
OpenAI.Codex_26.721.3404.0_x64__2p2nqsd0c76g0 - App server:
0.146.0-alpha.3 - Previous working package:
26.715.10079.0 - Previous working app server:
0.145.0-alpha.30
Platform
- Windows 11 + WSL2 (Ubuntu)
- Repository is on the WSL ext4 filesystem:
/home/<user>/<repo> - Codex agent environment: WSL
Problem
Immediately after the Microsoft Store update from 26.715.10079.0 to 26.721.3404.0, the Desktop Git worker began returning:
worker_rpc_response_error errorMessage="Git is unavailable" method=turn-diff-capture-start workerId=git
The same repository is then returned by the Desktop project API as:
isGitRepository: false
Adding the project again creates a second project entry for the same normalized Linux path, also with isGitRepository:false. Native worktree-thread creation is therefore unavailable.
Git inside WSL remains healthy:
git --versionsucceeds (2.43.0)git rev-parse --show-toplevelreturns the expected repository rootgit statussucceeds and the worktree is cleangit fsck --connectivity-onlysucceeds
The repository directory is writable ext4. Inside the Codex workspace-write sandbox, .git is mounted read-only as documented, but all read-only Git commands still work, so that protected mount does not explain why Desktop classifies the project as non-Git.
Regression timeline
- Before the update, Codex Desktop successfully created WSL-native worktree threads under
/home/<user>/.codex/worktrees/...; the most recent was created the previous evening. - At startup,
26.715.10079.0detected and downloaded Store package26.721.3404.0. - About two minutes later,
26.721.3404.0launched with app server0.146.0-alpha.3. - Within four minutes, the first
Git is unavailableerror appeared and then repeated for every diff-capture attempt. - Existing worktree directories and Git metadata remain intact.
Additional diagnostics
The WSL runtime inherits:
CODEX_HOME=/mnt/c/Users/<user>/.codexCODEX_INTERNAL_ORIGINATOR_OVERRIDE=Codex DesktopWSLENVincludesCODEX_HOME/p
The same values were present in earlier successful worktree sessions, so this appears to be a regression at the 26.721 Desktop Git-worker / WSL handoff boundary rather than a new local configuration change.
The new Desktop log also records:
bundled_executable_relocation_failedfor the packaged WSLbwrapresource- repeated
primary_runtime_update_poll_failedarchive extraction errors
The updater currently sees manifestBuildVersion=26.721.3996.0, but reports hasUpdate=false / NoUpdates.
Steps to reproduce
- Open Codex Desktop
26.721.3404.0on Windows with the agent environment set to WSL. - Add a valid Git repository located under
/home/<user>/.... - Open the project or try to create a native worktree thread.
- Observe
Git is unavailablein Desktop logs andisGitRepository:falsein the project record. - Run the Git commands above in WSL and observe that the repository is healthy.
Expected behavior
A valid Git repository on the WSL Linux filesystem should be detected as Git, associated with a single project entry, and support native Codex worktree threads.
Related issues
- #35088 (same Desktop/app-server versions; project/thread catalog regression)
- #35073 (26.715 works, 26.721 broken)
- #14182
- #13762
- #13618
26 Comments
Facing the same issue here. Git repos in windows filesystem do get recognized but the ones from WSL does not.
Same. I'd like to add that this isn't repo specific. If I'm using ChatGPT Desktop, go into Settings->Worktrees, it says "No worktrees yet"(although I had plenty before the update). It says "Worktrees created by ChatGPT will appear here".
If I press the refresh button, it will say "Fetching worktree details.." then turn to "Unable to load worktrees", and "Git is unavailable" in the card. This absolutely broke on this build, as everything was fine just before I did the update.
I've uninstalled it, reinstalled it, wiped out my .codex folders to start from complete scratch, and the issue remains on a completely fresh install.
I had Codex self-reflect on ChatGPT Desktop and it was able to make a copy and self-repair. I'm not posting their source here, but can say it's basically trying to parse a Windows-type path within the WSL platform and that's blowing up a precheck probe. There is no workaround. I sent the details to their support, but I don't know if it will get here. If someone from OpenAI wants the details please reach out to me.
experiencing the same thing feedback id:
019f8fb2-6d1b-7511-bbc7-884242272cd3Confirming this regression on the current Windows package
26.721.4979.0(internal app release26.721.41059) with Windows 11 + WSL2 (Ubuntu).The problem affects multiple repositories stored on the WSL ext4 filesystem. Git remains healthy inside WSL:
git --versionsucceeds (2.43.0)git rev-parse --show-toplevelreturns the expected repository rootgit statussucceedsCodex Desktop still does not show the active branch or offer native worktree creation. Fully quitting the app, normalizing the persisted project roots to Linux POSIX paths, rebuilding the local project registry, and restarting did not change the result.
The current Desktop logs contain the same signature reported here:
They also show recommended-skills Git operations failing with
git fetch failed: Git is unavailable.The CLI continues to recognize and operate on the same repositories correctly. This appears to confirm that the regression persists in
26.721.4979.0and is isolated to the Windows Desktop Git worker / WSL handoff rather than repository state.Confirming this regression on the Microsoft Store package
26.721.4979.0(internal app release26.721.41059, bundled CLI/app-server0.146.0-alpha.3.1) with Windows 11 + WSL2.I isolated the failure to the Desktop Git worker's preliminary Git-availability check, rather than repository detection or Git itself. In WSL mode that check obtains
codexHome,platformFamily, andplatformPath, then probesgit --versionwith a working directory derived from those values. Static inspection indicates a Windows/WSL path mismatch in this precheck. When the probe fails, the worker short-circuits later operations asGit is unavailable.For an A/B validation, I tested an isolated copy of the same app bundle where only the three duplicated availability-check call sites were bypassed. I did not change
git rev-parse, status, diff, branch, repository, or worktree logic.Results after bypassing only that precheck:
2.43.0./mnt/c/...and the WSL ext4 filesystem are returned asisGitRepository:true.isGitRepository:false.Git is unavailable.This strongly suggests the official fix should normalize/translate the probe cwd before spawning Git, or make the availability probe independent of a
codexHome-derived cwd. The unconditional bypass was used only as local A/B validation; it is not a suggested production implementation.It's time for you to get serious about fixing problems with WSL. For both TUI and App. It has been impossible to use for months.
@etraut-openai @jmalmo
I'm eagerly awaiting a resolution to this issue, but it's disappointing that OpenAI doesn't seem very interested in Windows support.
I've now given up and am using the Codex App via WSLg (but it's unstable).
Confirming the same regression on Windows ARM64 + WSL2 Ubuntu ARM64, so this is not limited to the x64 packages already reported here.
Environment
OpenAI.Codex_26.721.11231.0_arm640.146.0-alpha.3.1aarch64/home/<user>/code/<repo>\\wsl$\Ubuntu\home\...Windows path, with the Codex agent environment set to WSLSplit detection result
Git and the WSL-side Codex agent recognize the repository correctly:
git --versionsucceeds (2.34.1)git rev-parse --show-toplevelreturns the expected Linux pathgit statussucceedsgit worktree list --porcelainsucceedsHowever, the Desktop project API returns the same project as:
Consequently, the review panel and native worktree controls are unavailable.
The Desktop startup log includes:
Historical logs from the same installation also show the Windows-side
git-repo-watcherreceivingEISDIRwhile watching\\wsl$\Ubuntu\...\.gitdirectories.The path itself is translated successfully: the running agent's cwd is the correct
/home/<user>/code/<repo>Linux path. This appears to be the same Desktop Git-worker availability/precheck failure described above, rather than a bad project path or repository state.One potentially relevant ARM64-specific detail: static inspection of the installed runtime manifest lists Windows/Linux
x86_64primary-runtime artifacts but no Windows/Linux ARM64 artifact. Since the externally visible failure matches the x64 reports exactly, that may be incidental, but ARM64 is definitely affected as well.This bug is still present in the latest version,
26.727.40816.For a temporary workaround, here is a prompt you can give to GPT-5.6-Sol (High) that will create a copy of the installation with the bug fixed.
Before you launch the fixed version, make sure you have completely exited the other one. Check the system tray because it "closes" to there.
Does it work?
Just want to also flag that I've been avoiding Codex Desktop for months due to issues with WSL2 git worktrees.. Plus far too much latency when it tries to write across the Windows-WSL2 bridge. Only running codex from within the CLI in WSL2 even though the desktop app's sidebar and UX would benefit me and my workflow.
I can't justify reinstalling Desktop, the mode/UX I'd prefer, until I'm confident WSL2 is well supported and works as expected.
019fa84a-6bfa-7ce2-b8b4-a22900eb4950 ID trace
I've uninstalled ChatGPT desktop app and went back to CLI because of this issue. Unbelievable the lack of support for windows and wsl features and bugs
Confirmed this persists on Microsoft Store package
26.730.8199.0with app-server0.147.0-alpha.1.2on Windows + WSL.This reproduction uses a repository under
/mnt/c/...(the Windows-mounted filesystem), so it is not limited to WSL ext4 paths.Desktop logs show both:
But Git is healthy in the same WSL environment:
git --versionsucceeds (2.43.0)git rev-parse --show-toplevelsucceedsgit worktree list --porcelainsucceedsgit worktree add -b <branch> <sibling/.worktrees/path> origin/mainsucceeds and creates a clean worktree trackingorigin/mainSo the failure remains isolated to the Desktop Git worker / WSL handoff, rather than Git, repository health, or worktree configuration.
Confirming that this remains reproducible on a much newer Windows Store build, with one additional cwd-level A/B result that may help narrow the precheck failure.
Environment
OpenAI.Codex_26.803.5235.0_x640.147.0-alpha.6.52.43.0/home/<user>/<repo>The repository is clean, its branch has a valid upstream, and the following all succeed in WSL:
Desktop still reports:
This persists after fully restarting Windows, WSL, Explorer, and Codex Desktop.
Additional precheck/cwd evidence
Static inspection of the installed Desktop bundle shows that the Git availability precheck obtains
codexHome,platformFamily, andplatformPath, derives a probe cwd fromplatformPath.parse(codexHome).root, and then sends the command through the Windows-to-WSL spawn wrapper.That wrapper falls back to
.when the derived cwd is empty and constructs a command equivalent to:On this installation, the cwd behavior is:
The
--cd .case fails before/bin/shor Git starts. Replaying the packaged Git availability script with a valid absolute cwd such as/returns exit 0.This is consistent with a Windows/WSL path-family mismatch producing an empty root for the availability probe, followed by the wrapper substituting a relative
.thatwsl.exe --cdrejects.Suggested fix
For WSL spawns, normalize the probe cwd to an absolute Linux path before constructing
wsl.exe --cd. If no absolute cwd can be derived, use/,~, or omit--cdinstead of passing..No repository-specific configuration appears involved; CLI Git continues to work normally on the same checkout.
One useful connection to the existing cwd diagnosis: this issue and #32323 are caused by two independent defaults in the same Windows-to-WSL argument builder.
For this issue, the Git availability precheck combines a Windows-form
codexHomewith the POSIX path parser selected for WSL. Parsing that value can produce an empty root; the wrapper then substitutes.and invokes:I reproduced the packaged invocation from Windows Node with the Codex Desktop installation directory as the inherited Windows cwd.
--cd .fails inwsl.exewithWsl/E_INVALIDARGbefore the shell or Git starts; changing only the cwd to/makes the unchanged Git probe returngit version 2.53.0and exit 0.The production fix should therefore make the precheck cwd absolute and valid for the selected execution host, and the WSL wrapper should never synthesize
--cd .: use an absolute Linux cwd, or omit--cdwhen none is available. Bypassing the Git precheck is not necessary.Separately, the same builder uses bare
--to delimit the command. At that boundary literal GraphQL$variablesare expanded away, causing #32323;--execpreserves them. These should be fixed together in the shared WSL spawn path, while keeping the two failure modes independently testable.Confirming this still reproduces on Codex Desktop package
26.803.5235.0with Codex CLI0.147.0, Windows 11, and WSL2 Ubuntu.The same healthy WSL repository is misclassified by Desktop in two user-visible ways:
Git works normally in WSL, and native Git is also installed on Windows. Desktop logs repeatedly show:
This blocks both the PR workflow and native Desktop worktrees, despite the repository and Git installations being healthy.
Same issue here. Repositories in windows filesystem get recognized but the ones in WSL do not.
Following up on my previous reproduction: this remains reproducible on the much newer Microsoft Store package
OpenAI.Codex 26.814.5167.0, using Windows 11 + WSL2 Ubuntu.The issue affects multiple valid repositories stored on the WSL ext4 filesystem under
/home/<user>/....Current evidence
Git remains healthy inside WSL:
I also extracted and replayed the exact Git availability probe used by the installed Desktop bundle. When executed from the absolute WSL cwd
/, it succeeds in approximately0.01swith exit code0.Despite this, the Desktop project API reports multiple valid WSL repositories as:
The fresh Desktop logs continue to show:
The logs also still contain
bundled_executable_relocation_failedfor the packaged WSLbwrapresource. As a controlled test, I placed a verified copy of the systembwrapbinary at the expected relocation target, restarted Desktop completely, and reproduced the same Git failure. The test file was removed afterward, indicating that the missing relocation target is not the cause of the Git-worker failure.Recovery attempts performed
wsl --shutdownNone changed the result.
This now blocks Desktop worktrees and worktree-backed scheduled automations. Five affected automations remain paused to avoid running them against the wrong working directory or mixing changes into the main checkout.
This additional reproduction supports the existing diagnosis that the failure is in the Desktop Git worker / Windows-to-WSL spawn boundary, rather than Git, repository state, or the WSL installation.
I have a sanitized diagnostic bundle containing the relevant log excerpts, exact packaged probe output, automation state, and environment details available if maintainers would like it.
Confirmed the root cause and a fully working local fix (Store package 26.814.5167.0, 2026-08-18)
Same regression here. This comment documents (1) what did NOT help, (2) the exact root cause found by
inspecting the installed bundle, (3) a verified patch that restores Git detection and the PR/worktree
flows, plus a healthy app-server handshake, and (4) a suggested official fix.
Environment
OpenAI.Codex_26.814.5167.0_x64__2p2nqsd0c76g0config.toml:[desktop] runCodexInWindowsSubsystemForLinux = true)git --version-> 2.43.0,git rev-parse --show-toplevel,git statusall fine/home/<user>/Codes/...) and/mnt/c,/mnt/daffectedzsh(/etc/passwd:/usr/bin/zsh)— this turned out to be relevant (see "second failure" below)
Symptoms (all identical to the thread)
git fetch failed: Git is unavailable(recommended-skills)Failed to apply worktree shell environment config ... errorMessage="Git is unavailable"isGitRepository: false, PR/worktree UI goneCodex app-server initialize handshake timed outevery start(app-server: "state db backfill is running at /mnt/c/Users/<user>/.codex; waiting up to 30s ..."),
and
bundled_executable_relocation_failed ... bwrap ... ENOENTWhat I tried that did NOT help
Reset-AppxPackage/ full reinstall from Store — no change.codex-global-state.json/runcodexinwindowssubsystemforlinux— on a clean install that key does not even exist in
.codex-global-state.json;the real switch lives in
config.toml [desktop], and disabling it only avoids WSL — it does not fix itwsl --shutdown, full Windows restart, repairing the app through Windows Settings, clearing~/.codex/etc/wsl.conf, distro list, git installs on both sides — all healthyRoot cause (from the installed bundle,
resources/app.asar)The Windows-side git worker builds every WSL spawn like this (
worker.js):The Git availability probe passes
cwd: platformPath.parse(codexHome).root. SincecodexHomeis theWindows path
C:\Users\<user>\.codex, parsing it with the POSIX parser yields an empty root, and thespawn falls back to
.:The resulting command is
which fails with
Wsl/E_INVALIDARG(exit 255) before the shell or git ever starts — reproduceddirectly:
Second, independent failure on machines with a non-bash default shell:
wsl.exe ... --routes the remainder through the user's default Linux shell. My login shell iszsh, and crossing that shell mangles the probe script (command substitution comes back empty):So even fixing the cwd alone still fails here; the probe must also avoid the default-shell detour
(
--exec). (This is the same flag userFreefor100correctly identified for #32323.)Replaying the full packaged probe with the fixed argv:
The fix that works (verified)
The runtime reads
resources/app.asardirectly (extracting toresources/app/without the asar filedoes not boot on this Chromium-based shell), so I:
C:\Users\me\CodexDesktop-Fixed.vite/build/worker.jsand.vite/build/src-DY9Aq019.js),5 string sites total:
e.cwd ?? '.'->e.cwd ?? '/'and'--'->'-e'(worker.js
BW, src-DY9Aq019.jsnO)cwd: n ? cW(n) : '.'(worker.js),cwd: r ? wD(r) : '.'and
cwd: e.repoRoot.trim().length>0 ? wD(e.repoRoot) : '.'(src-DY9Aq019.js) — all to'/'app.asarwith@electron/asar, keeping the unpacked natives(use
--unpack '**/node_modules/**'; the CLI only honors the LAST--unpackflag,so a single wide glob is needed)
app\ChatGPT.exefrom the copyResult (fresh desktop logs):
initialize_handshake_result durationMs=821 outcome=success— was a 30 s timeout beforeGit is unavailable— 0 occurrences (was every start)git ... config --get remote.origin.url, etc.;[git-repo-watcher] Starting git repo watcherwsl.exe -d Ubuntu --cd /home/... -e /usr/bin/bash -lc ...(absolute cwd,--exec)bwraprelocation error did not reappearCaveats for anyone doing this: the copy has no MSIX identity, so the in-app auto-updater is disabled
(intentional; a future fixed Store release will need reinstalling, which is fine). Run only ONE copy at
a time — both share
<USERPROFILE>\.codex. Keep the originalapp.asarfor rollback.Suggested official fix (same conclusion as the other comments)
In the shared Windows -> WSL spawn builder:
--cd .: use an absolute Linux cwd, or fall back to/(or omit--cd) when none can be derived--execinstead of bare--; without it, users with non-bash default shells (e.g. zsh) hit asecond failure even after #1 is fixed
---
Anyway, you can dump the above diagnosis and solutions into Codex CLI or anything else to see if it can help.
Confirmed on current Windows package 26.814.5167.0 — root cause isolated and locally patched successfully.
Environment:
Windows 11 x64
WSL2 / Ubuntu
Codex package: OpenAI.Codex_26.814.5167.0_x64__2p2nqsd0c76g0
Agent runtime: WSL
Integrated terminal shell: WSL
Reproduction:
With Agent runtime = Windows, both PowerShell and WSL terminals work.
With Agent runtime = WSL, both PowerShell and WSL terminal options cause the bottom terminal panel to flash and immediately close.
I instrumented the shipped 26.814.5167.0 renderer and terminal session manager.
The immediate panel close is only cleanup. The actual failure is a terminal-host error:
Git is unavailable
The renderer receives the terminal error event, calls deleteSessionMapping(sessionId), the terminal session disappears from the conversation snapshot, and the bottom-panel cleanup then removes the terminal tab and closes the empty panel.
Importantly, Git itself is available inside the WSL terminal:
DISTRO=Ubuntu
/usr/bin/git
git version 2.43.0
I isolated the failing call in the main-process Terminal Manager initialization. The terminal receives a getWorktreeShellEnvironmentForCwd callback equivalent to:
async t => {
let r = await e.gitManager.getWorktreeRepository(n.ho(t), s);
return r == null ? null : n.X(r);
}
When getWorktreeRepository() throws Git is unavailable, this optional Git/worktree environment lookup aborts terminal creation.
I changed only this callback to fail open:
async t => {
try {
return (t = await e.gitManager.getWorktreeRepository(n.ho(t), s)) && n.X(t);
} catch {}
}
No renderer cleanup changes, routing changes, or terminal-session hacks are required.
After applying only this change to the original 26.814.5167.0 ASAR:
WSL Agent runtime works
integrated WSL terminal stays open
PTY is actually running inside Ubuntu/WSL2
uname, pwd, filesystem operations and /usr/bin/git all work normally
So for this reproduction, the terminal is being killed by an optional Git/worktree shell-environment lookup that throws instead of degrading to null.
This may also be related to #35119 (Git is unavailable in valid WSL repositories) and the older symptom report #25256.
A likely upstream fix is to make getWorktreeShellEnvironmentForCwd fail-open when Git/worktree detection is unavailable, rather than failing terminal creation.
Confirming that the second WSL spawn failure still reproduces on the newer Microsoft Store package
OpenAI.Codex_26.818.3698.0_x64.Environment
Ubuntu24/usr/bin/zsh/usr/bin/git, version2.43.0/home/...The installed bundle still builds WSL commands in this form:
I replayed the exact packaged Git availability probe through the Windows Node runtime with an absolute, valid cwd (
--cd /), so this A/B is independent of the previously diagnosed--cd .failure:Capturing the target process argv shows the premature expansion directly. A simplified requested command:
arrives at the intended target as:
For the full packaged probe, the target receives the equivalent of:
This confirms that bare
--allows an earlier/default-shell expansion before the intended/usr/bin/bash -lcand inner/bin/shrun. Fixing only the cwd is therefore insufficient on this setup.The shared WSL argument builder should use
--exec(or-e) instead of bare--:Microsoft documents
--execas executing the specified command without using the default Linux shell:https://learn.microsoft.com/en-us/windows/wsl/release-notes#build-18305
The same failed availability probe still causes the integrated terminal to abort before PTY creation, matching #37962. No Windows Git, WSL Git, PATH, or repository-health issue is involved.
Current Store build
26.818.5229.0: WSL spawn boundary is still unfixedCross-linking the exact downstream terminal failure trace in #37962 and adding evidence from a newer installed package.
I inspected an isolated copy of
OpenAI.Codex_26.818.5229.0_x64__2p2nqsd0c76g0(app.asarSHA-256C5D839BC9B122B7EF2A2F0F45186B3E5895923DE5B6CEF5253C936FE670C0479). The two duplicated shared WSL builders still construct the equivalent of:The relevant builders still use bare
--; they do not use--exec/-e. Thecwd ?? '.'fallback also remains in both bundled copies.The Git availability caller has gained a partial cwd fallback equivalent to:
However, that does not fix the independently reproduced default-shell expansion problem documented above on
26.818.3698.0. The current26.818.5229.0builder still crosses the same bare---boundary, so users whose default WSL shell alters the nested probe can still receiveGit is unavailableeven with an absolute/cwd.The clean fix remains:
--cd .;--exec/-eand preserve argv boundaries;The last point is tracked with an exact failure chain, local A/B validation, production-style pseudocode, and requested regression coverage here: https://github.com/openai/codex/issues/37962#issuecomment-5391032851
This is a shared shipped Windows/WSL adapter defect, not a repository-health or Git-installation problem. Please link the internal fix/owner and identify the first Microsoft Store build expected to contain it.
I can no longer reproduce the WSL repository misclassification reported here with Microsoft Store package
OpenAI.Codex_26.820.9563.0_arm64__2p2nqsd0c76g0.Environment:
/bin/bash/home/<user>/...Results:
isGitRepository: true./home/<user>/.codex/worktrees/....Git is unavailableandisGitRepository:falseboth had zero occurrences.I have not tested this build with
zshas the default WSL login shell. Because later comments report a separate failure affectingzshconfigurations, this result only confirms the/bin/bashenvironment described above.