Codex App Git diff panel shows all repository files as deleted even though local and origin branches are identical

Open 💬 6 comments Opened May 2, 2026 by Lianye-Scythe

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

26.429.30905

What subscription do you have?

ChatGPT Plus

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64; repository opened from WSL2: Linux 6.6.87.2-microsoft-standard-WSL2 x86_64 x86_64

What issue are you seeing?

The Codex App Git/diff panel incorrectly shows the repository as having a massive deletion diff.

In the right-side Git panel, the branch comparison shows:

+0 -54,540
main -> origin/main

What steps can reproduce the bug?

  1. Open the repository in Codex App.
  2. Open the right-side Git/diff panel.
  3. Compare main -> origin/main.
  4. Observe that the panel shows a large deletion count, for example +0 -54,540.
  5. Open any file in the diff view.
  6. Observe that the entire file content is shown as red deletions.

I tried restarting Codex App and refreshing the panel, but the issue still appears.

Git CLI shows no actual diff:

git status --porcelain=v1 --branch --untracked-files=all

Output:

## main...origin/main
git diff --shortstat
git diff --cached --shortstat
git diff --shortstat HEAD origin/main

All three commands produce no output.

git rev-parse main origin/main

Output:

a20326600185bcc23357a9ca580a700c8e289aa5
a20326600185bcc23357a9ca580a700c8e289aa5
git rev-parse main^{tree}
git rev-parse origin/main^{tree}

Output:

8abde62245d1a3a2e0a2c71094fc0cac0db0be56
8abde62245d1a3a2e0a2c71094fc0cac0db0be56

<img width="609" height="1008" alt="Image" src="https://github.com/user-attachments/assets/79741c0d-fb3a-43a7-9959-c6d9cbafee08" />

What is the expected behavior?

The Codex App Git/diff panel should show no file changes when main and origin/main point to the same commit/tree.

It should not render every file as deleted when Git CLI reports no diff.

Additional information

This repository was originally created/cloned outside Codex App, likely from VS Code, but it is a normal Git repository.

The repository path is:

/home/po120/Git/OmniGrimoire

The .git path is a normal directory:

git rev-parse --git-dir

Output:

.git

The repository is not a linked worktree:

git worktree list --porcelain

Output:

worktree /home/po120/Git/OmniGrimoire
HEAD a20326600185bcc23357a9ca580a700c8e289aa5
branch refs/heads/main

Remote configuration:

git config --get-regexp '^branch\.main\.|^remote\.origin\.'

Output:

remote.origin.url https://github.com/Lianye-Scythe/OmniGrimoire.git
remote.origin.fetch +refs/heads/*:refs/remotes/origin/*
branch.main.remote origin
branch.main.merge refs/heads/main

Remote check:

git ls-remote origin refs/heads/main

Output:

a20326600185bcc23357a9ca580a700c8e289aa5	refs/heads/main

This looks like the Codex App UI may be failing to read or materialize one side of the comparison tree, causing the diff view to render every file as deleted.

View original on GitHub ↗

6 Comments

wanf425 · 2 months ago

I am seeing the same issue in Codex Desktop App.

Environment

  • Platform: Windows + WSL2
  • Repository path: /home/wangtao/code/express-ai-engineering-suite
  • Branch: master
  • Remote branch: origin/master

Symptom

The Codex Review/Git diff panel shows a very large diff:

+685 -24235
master -> origin/master
.gitignore +0 -37
Large diff detected — showing one file at a time.
SnaiCrys · 1 month ago

Codex Desktop App.

Environment

  • Platform: Windows + WSL2
  • Repository path: /home/kan/project/test
  • Branch: master
  • Remote branch: origin/master

Same problem

icarusnine · 1 month ago

Codex Desktop App.

Environment
Platform: Windows + WSL2
Repository path: /home/nine/ws/system
Branch: main
Remote branch: origin/main
Same problem

wadamczyk-insolutions · 1 month ago

I am seeing what looks like the same bug, but with an important difference from the original report.

Environment

  • Codex Desktop App on Windows
  • Agent environment configured to use WSL
  • Repository is not stored inside WSL
  • Repository path on Windows:

C:\Users\WojtekA.INSOLUTIONS\Documents\Obsidian\Work

  • Same repo as seen from WSL:

/mnt/c/Users/WojtekA.INSOLUTIONS/Documents/Obsidian/Work

Symptom

In the Codex Desktop Git/diff panel, the branch comparison shows a huge diff, currently around:

  • +1930 -411233
  • main -> origin/main

The UI also highlights .gitignore in the diff panel and shows a small per-file diff there (for example .gitignore +0 -32), but Git CLI does not show a real .gitignore diff.

The panel also shows:

  • Large diff detected — showing one file at a time

What Git CLI shows

Both Windows Git and WSL Git show the same sane repository state.

Windows PowerShell git status

Repo is on main, ahead of origin/main by 2 commits, with a small normal working tree:

  • 6 modified tracked files
  • several untracked files
  • no massive deletion diff

WSL git status

Same result as Windows.

So this does not appear to be a case where Windows Git and WSL Git disagree. They agree with each other, and both disagree with the Codex Desktop UI.

Important detail

This repo is opened from the Windows filesystem, not from a WSL /home/... path.

That may mean this is not only a “repo hosted inside WSL” problem. It may be a broader Desktop diff/caching/path-resolution issue in Windows + WSL agent mode.

What I already verified

  • Restarting Codex Desktop did not fix it
  • Windows git status is correct
  • WSL git status is correct
  • git diff / git diff --shortstat from CLI do not show anything close to the huge deletion count shown by the UI
  • .gitignore is not actually modified according to Git CLI

Suspicion

This looks like a Codex Desktop UI/state/cache bug rather than a real repository diff.

Possibly relevant:

  • the Desktop app is running on Windows
  • the agent mode uses WSL
  • the repo itself is on C:
  • Git state in both Windows and WSL is correct, but the Desktop diff panel still materializes a huge fake deletion set

If useful, I can also provide:

  • exact Codex Desktop version from About
  • screenshots of the Codex UI
  • matching Windows PowerShell and WSL git status output
expl0r3rgu1 · 1 month ago

I confirm this happens after fixing codex WSL environment by setting CODEX_HOME to $HOME/.codex within WSL

yeager · 9 days ago

I pushed a candidate fix here: https://github.com/yeager/codex/compare/main...yeager:codex:fix/app-git-diff-identical-tree-empty

It adds a defensive fast path in codex-git-utils: when the selected remote base and HEAD resolve to the same tree and git status --porcelain=v1 --untracked-files=all is clean, gitDiffToRemote returns an empty diff without materializing a patch. The existing diff path is preserved when tracked or untracked changes exist.

Tested with:

cargo test --manifest-path codex-rs/Cargo.toml -p codex-core git_info_tests::test_get_git_working_tree_state -- --nocapture

I tried to open the PR directly from the fork, but GitHub returned: yeager does not have the correct permissions to execute CreatePullRequest.