Codex shows no diffs when files edited by python script

v. 0.153.3

Since Astra (medium) I catch agents responding that they changed files and yet I see no diffs. Turns out that’s because they use python scripts in bash to edit files. I assume that apply_patch passes changes to diff viewer functionality and that’s the root cause. Screenshot is from GUI but cli behaves the same way.

Have you guys had that issue?

I’d first check git status and git diff from the same repository. If Git shows the Python script’s changes correctly but Codex shows no diff, that strongly points to the Codex UI/review layer. On Windows, there have also been cases where Codex constructed the Git path incorrectly, causing diffs to fail.

A useful workaround for now is to verify the changes with git diff after the script runs and restart/reload the Codex review view. It would be good for Codex to handle externally modified files more reliably, especially since Python scripts and formatters commonly modify files outside the agent’s direct edit flow.

For now I slopped up a solution. Can’t share the code here unfortunately, but astra should be able to recreate it with the steps:

1. Gets a hook on python file i/o operations, locally. Gets the path.
2. Makes a file snapshot before, compares with after.
3. Passes it further like apply_patch (codex tool for file editing) does.

and it works so far, although I do have to start chatgpt app with different codex path in env.

Edit: Almost the same can be done for node (astra feeling fancy today)

Edit2: Haha no way, I give up. Nevermind the untracked/out of repo files, I don’t care anymore. Git it is.

Hey @Mattzq, thanks for flagging this.

To build on @ethanAI’s Git suggestion, run git status and git diff from the same repository/worktree Codex used. For staged changes, use git diff --cached. In the app, also check the matching Unstaged or Staged view. The official Code review guide explains what each view includes.

There have been several Codex updates since your post, including fixes for some blank-diff issues. Could you try the latest app and CLI versions and let me know whether Python-script edits are still missing? The official changelog has the release details.

If it’s still happening, please share your current versions, OS, and whether Git shows the changes that Codex is missing.

– Simar