codex - 💡(How to fix) Fix VS Code Codex diff fails to load full file content

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…

Error Message

{ oldResult: { type: "error", error: { type: "not-found" } }, newResult: { type: "error", error: { type: "not-found" } } }

Root Cause

The old side appeared to fail because the diff metadata did not include prevObjectId, and the request effectively had:

Fix Action

Fix / Workaround

As a local experiment only, I patched the installed extension to resolve the old side with:

Code Example

Full file content failed to load

---

# https://www.robotstxt.org/robotstxt.html
   +# Site crawler access rules
   User-agent: *
   Disallow:

---

robots.txt
   Full file content failed to load
   <a few diff lines>

---

git.request({
  method: "cat-file",
  params: {
    cwd,
    path,
    oid,
    fallbackToDisk,
    operationSource: "thread_diff"
  }
})

---

diff.name: /private/tmp/codex-review-repro/robots.txt
workspaceRoot: /private/tmp/codex-review-repro

---

robots.txt

---

{
  oldResult: {
    type: "error",
    error: { type: "not-found" }
  },
  newResult: {
    type: "error",
    error: { type: "not-found" }
  }
}

---

/private/tmp/codex-review-repro/robots.txt

---

robots.txt

---

{
  oldResult: {
    type: "error",
    error: { type: "not-found" }
  },
  newResult: {
    type: "success",
    lines: [
      "# https://www.robotstxt.org/robotstxt.html\n",
      "# Site crawler access rules\n",
      "User-agent: *\n",
      "Disallow:\n"
    ]
  },
  nextFallbackToDisk: false
}

---

oid: null
fallbackToDisk: false

---

git rev-parse HEAD:<path>
RAW_BUFFERClick to expand / collapse

What version of the IDE extension are you using?

26.513.21555

What subscription do you have?

Plus

Which IDE are you using?

VS Code

What platform is your computer?

Darwin 25.4.0 arm64 arm (Mac OS)

What issue are you seeing?

In the VS Code Codex diff view, a simple change to a tracked file fails to load the full file content.

The UI shows:

Full file content failed to load

with a Retry button. Clicking Retry does not resolve the issue.

What steps can reproduce the bug?

Feedback ID: 019e45e7-3599-7a50-b966-f908ecaebd35

  1. Open a git repository in VS Code with the Codex extension enabled.

  2. Ask the Codex extension to modify a tracked file. In my repro, the file was robots.txt.

  3. Codex made a simple one-line insertion:

    # https://www.robotstxt.org/robotstxt.html
    +# Site crawler access rules
    User-agent: *
    Disallow:
  4. Open the Codex diff view for that change by clicking the review button in the chat.

  5. Observe that the diff view shows the file header, the full-content load failure, and only a few diff lines:

    robots.txt
    Full file content failed to load
    <a few diff lines>
  6. Click the Retry button.

  7. The same failure remains.

What is the expected behavior?

No response

Additional information

Diagnostic Notes From Local Instrumentation

The following section is based on local instrumentation added by Codex itself while debugging. Please treat it as reference material, not as a definitive fix proposal.

After adding temporary logging to the local installed extension bundle, the failing full-content load appeared to come from the diff webview calling:

git.request({
  method: "cat-file",
  params: {
    cwd,
    path,
    oid,
    fallbackToDisk,
    operationSource: "thread_diff"
  }
})

The debug output showed that the diff metadata used an absolute path:

diff.name: /private/tmp/codex-review-repro/robots.txt
workspaceRoot: /private/tmp/codex-review-repro

But the cat-file request appeared to expect a repository-relative path:

robots.txt

With the absolute path, both sides initially failed:

{
  oldResult: {
    type: "error",
    error: { type: "not-found" }
  },
  newResult: {
    type: "error",
    error: { type: "not-found" }
  }
}

After locally normalizing the path from:

/private/tmp/codex-review-repro/robots.txt

to:

robots.txt

the new side loaded successfully from disk, but the old side still failed:

{
  oldResult: {
    type: "error",
    error: { type: "not-found" }
  },
  newResult: {
    type: "success",
    lines: [
      "# https://www.robotstxt.org/robotstxt.html\n",
      "# Site crawler access rules\n",
      "User-agent: *\n",
      "Disallow:\n"
    ]
  },
  nextFallbackToDisk: false
}

The old side appeared to fail because the diff metadata did not include prevObjectId, and the request effectively had:

oid: null
fallbackToDisk: false

The extension-side cat-file handler appears to return not-found for that combination.

As a local experiment only, I patched the installed extension to resolve the old side with:

git rev-parse HEAD:<path>

and then read that blob with git cat-file. With that local experiment, the full-content load succeeded and the Retry button disappeared.

Possible Cause

Based on the above local investigation, the failure may involve two related issues:

  1. The partial diff metadata may provide an absolute file path where the full-content loader expects a repo-relative path.
  2. The old-side full-content loader may not have a fallback when prevObjectId is missing and fallbackToDisk is false.

Again, this diagnosis was produced from local instrumentation and should be treated as a debugging lead rather than a confirmed root cause.

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