Codex Desktop caches stale large-diff result after bad empty-tree snapshot is removed
What version of the Codex App are you using (From “About Codex” dialog)?
26.417.41555
What subscription do you have?
Pro $200
What platform is your computer?
Microsoft Windows NT 10.0.22631.0 x64
What issue are you seeing?
Codex Desktop review/diff pane appears to cache a stale large-diff result and keeps showing whole-repo deletion behavior even after the underlying Git state has been corrected.
The app shows:
Large diff detected -- showing one file at a time
The app appears to think the branch deletes the whole repository. Git itself does not agree.
Local Git consistently reports the real branch diff as small:
git diff --shortstat master...HEAD
Output:
39 files changed, 2210 insertions(+), 27 deletions(-)
GitHub also does not show the huge diff.
What I Tried
I verified the branch and commits directly with:
git status --short --branch
git merge-base master HEAD
git diff --shortstat master...HEAD
git diff --name-status master...HEAD
git cat-file -p <commit>
git diff-tree --stat --summary <parent> <commit>
The rebuilt branch is based directly on master, and the two commits are normal:
673c48b3 SLW-1161 Initial version of federal criminal check
7e58cfd0 Remove reference to 15 year sex offender in scope message
The first commit’s parent is exactly local master:
parent cabedee31dbf5384283141566d9edb5cef389d3d
The merge base is also exactly master:
git merge-base master HEAD
Output:
cabedee31dbf5384283141566d9edb5cef389d3d
I also rebuilt the branch from scratch:
Checked out master.
Created a new branch.
Cherry-picked the two commits.
Verified the diff again.
The app still showed the huge diff.
Suspicious Local Findings
There had been a stale Codex snapshot ref:
refs/codex/snapshots/45325e75ddf31537ae8f7aa7dadd82fab0559c85
It pointed to:
8aa91d72 Codex worktree snapshot: archive-cleanup
That commit had Git’s empty tree:
tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904
Comparing master to that object produced the exact huge deletion diff:
git diff --shortstat master..8aa91d72512643fd29a2d93aa8828d1023fdcdc7
Output:
1782 files changed, 424540 deletions(-)
I deleted the stale refs/codex/snapshots/... ref and quarantined the unreachable loose object. After that:
git cat-file -e 8aa91d72512643fd29a2d93aa8828d1023fdcdc7
Now fails, meaning Git can no longer resolve that bad object.
The app still showed the large-diff mode.
I also found stale .git/info/refs contents advertising old branch SHAs. I regenerated it with:
git update-server-info
Afterward .git/info/refs matched real refs, but Codex Desktop still showed the huge diff.
Expected Behavior
Codex Desktop review/diff pane should invalidate stale diff/cache state when refs or underlying Git objects change.
It should match Git:
git diff --shortstat master...HEAD
Output:
39 files changed, 2210 insertions(+), 27 deletions(-)
It should not continue showing large-diff mode or whole-repo deletion behavior after the bad snapshot ref/object has been removed.
Actual Behavior
Codex Desktop continues to show:
Large diff detected -- showing one file at a time
This still happens after:
deleting the stale Codex snapshot ref,
removing the bad empty-tree object,
regenerating .git/info/refs,
restarting Codex Desktop,
opening a new thread,
creating a new branch at the same commit,
creating a fresh branch from master and cherry-picking the commits.
Why This Seems Like a Cache Bug
The commits and refs are normal according to Git. The only object that produced the app’s huge diff was an old Codex empty-tree snapshot object. Even after that object became unreachable and then unresolvable, the app appears to retain or recompute the same invalid large diff.
This looks like stale review/diff cache state or a bad cached branch-base/snapshot selection in Codex Desktop.
What steps can reproduce the bug?
Uploaded thread: 019d6445-900c-7ef2-b019-29844177e746
Frankly, I'm not sure. At one point I think I manually deleted a worktree -- bad idea I know -- but it should not have a caused this. The git branch in its real state is fine.
What is the expected behavior?
The diff pane which shows the difference from master should show only the 2 new commits, with about 39 files. It should not show 400k lines deleted (basically the entire repo).
Additional information
My repo is in WSL. CODEX_HOME points to a directory under Windows.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗