codex - 💡(How to fix) Fix Codex Desktop caches stale large-diff result after bad empty-tree snapshot is removed [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#18891Fetched 2026-04-22 07:51:03
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
labeled ×4
RAW_BUFFERClick to expand / collapse

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.

extent analysis

TL;DR

The issue is likely due to a stale cache in Codex Desktop, which can be resolved by clearing the cache or resetting the application's state.

Guidance

  • Try restarting Codex Desktop and check if the issue persists, as this may help to clear any temporary cache.
  • Verify that the CODEX_HOME directory is correctly configured and that the application has the necessary permissions to access the repository.
  • Check for any other stale references or objects in the Git repository that may be causing the issue, and remove them if necessary.
  • Consider resetting the Codex Desktop application to its default state, which may help to clear any cached data that is causing the issue.

Example

No specific code example is provided, as the issue appears to be related to the application's cache and configuration rather than a specific code snippet.

Notes

The issue may be specific to the user's environment and configuration, and further troubleshooting may be necessary to resolve the issue. Additionally, the fact that the repository is located in WSL and CODEX_HOME points to a Windows directory may be contributing to the issue.

Recommendation

Apply a workaround by clearing the cache or resetting the application's state, as the root cause of the issue is likely related to a stale cache or configuration issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix Codex Desktop caches stale large-diff result after bad empty-tree snapshot is removed [1 participants]