Codex Diff resolves missing review artifacts and crashes in editor-diff-page

Open
#36,839 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
git, vscode
Domain
desktop, devtools

Research direction

Start at the editor-diff-page error boundary and trace how review artifacts under .git/refs/codex/turn-diffs/captures/... and checkpoints/... are resolved and read through fs/readFile. Reproduce the missing-artifact case in both workspace contexts; done means the diff renders when possible or shows a recoverable missing-review state instead of crashing.

Written by the indexing model from the issue text.

Description

bug code-review extension session

Summary

Codex Diff fails to load in the VS Code/VSCodium extension because the review view attempts to read a missing internal file/artifact, then crashes in editor-diff-page.

The visible failure pattern is:

  • Request failed ... method=fs/readFile ... \"No such file or directory (os error 2)\"
  • followed immediately by an editor-diff-page error boundary

This appears to be a review-artifact / thread-state resolution bug. Multi-root workspaces seem to make it easier to trigger, but I also reproduced the same failure from a single-folder workspace window.

Environment

  • Codex VS Code extension: openai.chatgpt@26.721.30844
  • IDE: VSCodium 1.126.04524
  • Platform: Linux x64

What issue are you seeing?

Opening Codex Diff / Review changes can fail completely.

Instead of rendering the review diff, the extension logs a failed internal file read and the diff webview crashes. This makes the review flow unusable even though Git itself is fine.

I also observed that chats are not repo-specific: the same chat can be reopened from another folder/window. That may be relevant, because the failing diff looks like it is being resolved against stale or mismatched thread/workspace state.

Steps to reproduce

I have seen this in both of these situations:

Path A: multi-root trigger
  1. Open a VS Code/VSCodium workspace with more than one root folder.
  2. Use the Codex extension normally.
  3. Make or review a change.
  4. Open Codex Diff / Review changes.
  5. Observe that the diff fails to load and the review view crashes.
Path B: single-folder window after thread reuse
  1. Open a single-folder workspace/window.
  2. Reopen or continue an existing Codex chat.
  3. Open Codex Diff / Review changes.
  4. Observe the same fs/readFile failure and editor-diff-page crash.

Expected behavior

Codex Diff should either:

  • render the review diff successfully, or
  • show a recoverable error if the underlying review artifact is missing

It should not crash the entire review view.

This is especially important because the IDE docs describe Codex as letting users review changes beside your code.

Actual behavior

  • Codex Diff fails to load
  • extension logs fs/readFile with No such file or directory (os error 2)
  • the diff UI crashes in editor-diff-page

Log evidence

Repeated failures of the same kind:

Request failed conversationId=none ... error={"code":-32603,"message":"No such file or directory (os error 2)"} ... method=fs/readFile

Immediately followed by:

error boundary ... editor-diff-page ...

I also saw a later Git watcher failure under Codex's own review/checkpoint refs:

[git-repo-watcher] Git repo watcher failed errorCode=ENOENT errorMessage=\"ENOENT: no such file or directory, scandir '.../.git/refs/codex/turn-diffs/checkpoints/...'\"

That makes it look like the diff/review flow is referencing a missing internal checkpoint artifact, not just a normal workspace file.

Additional observations

  • Multi-root workspace support is already a known weak area in the extension.
  • However, this specific bug is not cleanly explained as multi-root only, because I also saw the same crash from a single-folder window.
  • The more precise pattern seems to be:
    • chat/thread context can be reopened across workspace/folder boundaries
    • Codex Diff then tries to load review artifacts that do not exist in the current context
    • missing artifact -> fs/readFile failure -> editor-diff-page crash

I also saw signs of thread/UI state drift in logs during the same general period, including:

  • conversations being resumed in different workspace contexts
  • later Item not found in turn state errors in the same extension family of session problems

That may be related, although the core bug here is the deterministic Codex Diff crash on missing review artifacts.

Why this seems like a state-resolution bug

This does not look like normal Git diff failure.

The extension is using its own internal review/checkpoint storage under:

  • .git/refs/codex/turn-diffs/captures/...
  • .git/refs/codex/turn-diffs/checkpoints/...

Those refs exist on disk, but the extension later attempts to read or watch checkpoint content that is missing. Combined with the non-repo-specific chat reuse behavior, this strongly suggests the diff viewer is resolving against stale or mismatched review/thread/workspace state.

Expected fallback behavior

If the backing review artifact is missing, the extension should not crash the diff page. It should instead show a clear recoverable state such as:

  • review artifact missing, please reopen review
  • chat/workspace context changed, regenerate review
  • this review is no longer available for the current workspace

Related reports

  • #35058 Codex Diff crashes with Oops, an error has occurred in VS Code on macOS
  • #2909 Support for multi-root workspaces
  • #35073 VS Code extension crashes in multi-root workspaces on Windows
  • #24263 Renderer reload / turn-state desync causing Item not found in turn state

This report is closest to #35058 because the log signature matches exactly, but I am including the workspace/thread-context observations because they may help explain why the missing file lookup happens.

Dominant language
Rust
Stars
125k
Forks
19.5k
Avg merge
1m
Merged PRs (30d)
1k

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openai/codex

All issues in openai/codex

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.