Pull request diff shows large deletions for large file (structure.sql)

Resolved 💬 1 comment Opened Dec 11, 2025 by barelyknown Closed Mar 29, 2026

What version of Codex is running?

Curent Codex Cloud (2025-12-11)

What subscription do you have?

Pro

Which model were you using?

gpt5-codex-max (I think!)

What platform is your computer?

Codex Cloud

What issue are you seeing?

Steps to reproduce:

  • Run a task using Codex Cloud that modifies a very large file (in my case db/structure.sql over 100,000 lines).
  • Once the task completes successfully, use Codex Cloud to create a pull request for the changes.
  • Observe the pull request diff on GitHub – the diff shows that virtually all lines from the large file are deleted except for the new lines that were added by the task.
  • Download the generated patch file for the PR and inspect it – the patch is correct and only includes the intended changes.

Expected behavior:
The pull request diff should reflect the correct changes (i.e., only the actual modifications in db/structure.sql), not show that the entire file was deleted and re‑added.

Actual behavior:
The diff on GitHub shows that almost all lines of the large file were removed, which is incorrect. The patch file is correct, so something is going wrong during the process of creating the pull request for a very large file.

Additional context:
The file db/structure.sql in my repository is over 100 000 lines long. The task added just a few lines, but the GitHub diff indicates that the entire file was removed and then the new lines were added. This made the PR appear to remove everything except the new lines. The patch downloaded from the CLI, however, reflects the correct changes.

What steps can reproduce the bug?

Steps to reproduce:

  • Run a task using Codex Cloud that modifies a very large file (in my case db/structure.sql over 100,000 lines).
  • Once the task completes successfully, use Codex Cloud to create a pull request for the changes.
  • Observe the pull request diff on GitHub – the diff shows that virtually all lines from the large file are deleted except for the new lines that were added by the task.
  • Download the generated patch file for the PR and inspect it – the patch is correct and only includes the intended changes.

What is the expected behavior?

The pull request diff should show only the actual modifications in the large file (db/structure.sql) rather than marking the entire 100k+ line file as deleted and re ad .

Additional information

The db/structure.sql file is over 100 000 lines long. When creating the PR using Codex Cloud, the diff on GitHub erroneously reported that the whole file was deleted except for the new lines added. However, downloading the patch file showed the correct changes, indicating the issue might be with how the PR diff is generated for very large files.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗