Skip to content

VS Code Codex diff fails to load full file content #23709

@Redbird10

Description

@Redbird10

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcode-reviewIssues relating to code reviews performed by codexextensionIssues related to the VS Code extension

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions