Codex Desktop Review uses Git empty tree as diff target on Windows/WSL

Open 💬 2 comments Opened Jun 2, 2026 by venc
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

Summary

Codex Desktop on Windows with WSL mode enabled can show extremely large bogus Review diffs because the Review summary runs git diff against Git's empty tree object (4b825dc642cb6eb9a060e54bf8d69288fbee4904) instead of the current working tree / HEAD.

This makes the Review pane report the whole repository as deleted and can make the app very slow.

Environment

  • Product: Codex Desktop
  • Windows package observed: OpenAI.Codex_26.527.3686.0_x64__2p2nqsd0c76g0
  • Platform: Windows 11 + WSL
  • Codex config:
  • runCodexInWindowsSubsystemForLinux = true
  • integratedTerminalShell = "wsl"
  • Reinstall/reset attempted:
  • Microsoft Store uninstall/reinstall
  • Full user-state reset / reinstall
  • Issue reproduced after reset

Symptoms

  • Review pane shows tens or hundreds of thousands of deleted lines.
  • The reported deletion count matches a diff against Git's empty tree, not the real working tree diff.
  • App responsiveness becomes very poor while Review is open / computing summaries.
  • Local Git status does not match the Review pane magnitude.

Example 1:

Codex Review: ~25k deleted lines
Local reproduction:
git diff --shortstat origin/main 4b825dc642cb6eb9a060e54bf8d69288fbee4904
116 files changed, 25065 deletions(-)

The actual branch diff in that repo was much smaller:

git diff --shortstat origin/main HEAD
17 files changed, 1109 insertions(+), 61 deletions(-)

Example 2:

Codex Review: ~150k deleted lines
Local reproduction:
git diff --shortstat HEAD 4b825dc642cb6eb9a060e54bf8d69288fbee4904
512 files changed, 156757 deletions(-)

The working tree in that repo did not have such a diff:

git status --short --branch
## master...origin/master
?? .agents/
?? .codex
?? tmp/

Local log evidence

The fresh Codex Desktop log shows Review summary invoking Git with the empty tree object as the right-hand side:

warning [git] git.command.complete aborted=true allowedNonZeroExitCodes=0,1 argsCount=11
command="git -c diff.mnemonicPrefix=false -c diff.noprefix=false -c core.quotePath=false -c core.hooksPath=/dev/null -c core.fsmonitor= diff --no-ext-diff --no-textconv --color=never --src-prefix=a/ --dst-prefix=b/ bf21ca3074bd18f25ed7836fc9f36206df143c2b 4b825dc642cb6eb9a060e54bf8d69288fbee4904 --find-renames --numstat -z"
cwd=/mnt/c/<redacted>/agentic-tool-monitor
requestKind=review-summary

In this repo:

git rev-parse origin/main
bf21ca3074bd18f25ed7836fc9f36206df143c2b

So Codex appears to compare origin/main to the empty tree, producing a "delete the entire repo" diff.

Additional WSL / watcher evidence

The same session logs also show the Windows-side git watcher trying to watch WSL /mnt/c/... paths via Node fs.watch, which fails with ENOENT:

warning [git-repo-watcher] Failed to watch git path
errorMessage="ENOENT: no such file or directory, watch '/mnt/c/<redacted>/agentic-tool-monitor/.git'"
path=/mnt/c/<redacted>/agentic-tool-monitor/.git/HEAD

This may be related to the Review metadata becoming stale or incomplete under Windows + WSL path handling.

Expected behavior

  • Review summary should compare the intended base commit/branch against the current working tree, index, or HEAD.
  • It should not use 4b825dc642cb6eb9a060e54bf8d69288fbee4904 unless the repository is actually unborn / initial commit / intentionally comparing against an empty tree.
  • Windows Desktop should not attempt to watch /mnt/c/... paths with Windows Node fs.watch; paths should be normalized or watched inside the WSL context.

Actual behavior

  • Review summary compares a real branch commit to the empty tree.
  • Review shows the whole repository as deleted.
  • App becomes very slow while the huge bogus diff is computed.
  • Full reinstall/reset does not resolve the issue.

Related issues found

This appears related to, but more specific than:

  • #13721 - Review pane can show diffs that Git does not see on Windows/WSL.
  • #24178 / #24364 - Windows/WSL path identity and migration issues affecting Desktop state/session behavior.

I did not find an existing issue that specifically captures requestKind=review-summary invoking git diff <base> 4b825dc642cb6eb9a060e54bf8d69288fbee4904.

View original on GitHub ↗

2 Comments

github-actions[bot] contributor · 2 months ago

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

  • #24681

Powered by Codex Action

entomb · 2 months ago

I can reproduce this in another Windows + WSL setup, and the issue persists after the usual Git/default-branch mitigations.

Environment:

  • Codex Desktop package: 26.602.4764.0
  • Windows + WSL2, Ubuntu 24.04
  • WSL kernel: 6.6.114.1-microsoft-standard-WSL2
  • WSL Git: git version 2.43.0
  • Windows Git: git version 2.49.0.windows.1
  • Repo path is inside WSL: /home/.../..., not under /mnt/c

Observed behavior:

  • Codex Desktop Changes panel shows the whole repo as deleted, with a deletion-only count.
  • The displayed deletion count matches a local empty-tree comparison: git diff --shortstat HEAD $(git hash-object -t tree /dev/null).
  • Both WSL Git and Windows Git report the worktree as clean.
  • Mobile showed a separate stale/wrong comparison earlier against the remote branch, but after syncing the branch the Desktop empty-tree behavior still persists.

Verified clean state:

git status --short --branch
# ## main...origin/main

git.exe status --short --branch
# ## main...origin/main

Things tried that did not fix Desktop:

  • Fully quit and reopened Codex Desktop.
  • Created/opened a fresh thread/environment for the same repo.
  • Ensured the repo is up to date with origin/main.
  • Set repo-local file mode handling: git config core.filemode false.
  • Set the remote default branch ref explicitly: git remote set-head origin main.
  • Verified both Git clients resolve refs/remotes/origin/HEAD -> refs/remotes/origin/main.
  • Set Windows Git new-repo default branch: git.exe config --global init.defaultBranch main.

Current relevant config:

git config --show-origin --get core.filemode
# file:.git/config false

git.exe config --show-origin --get core.filemode
# file:.git/config false

git.exe config --global --get init.defaultBranch
# main

git symbolic-ref refs/remotes/origin/HEAD
# refs/remotes/origin/main

One possibly relevant detail: Windows Git still has system-level core.autocrlf=true from C:/Program Files/Git/etc/gitconfig, but since both git status and git.exe status are clean and the Codex count exactly matches an empty-tree comparison, this does not look like a line-ending or filemode issue.