Code review includes untracked working-tree files (root cause identified but never fixed)
Open 💬 1 comment Opened Apr 8, 2026 by WindChimeRan
What version of Codex CLI is running?
codex-cli 0.116.0
What subscription do you have?
Pro
Which model were you using?
gpt-5.4 xhigh
What platform is your computer?
Darwin 25.4.0 arm64 arm
What terminal emulator and version are you using (if applicable)?
iTerm2
What issue are you seeing?
PR-style code review picks up untracked working-tree files (datasets, plot images, build artifacts, research notes) and reviews them as if they were part of the branch diff. This makes code review unusable in any repo that has local artifacts in the working tree.
This has been reported before
- #8404 identified the exact root cause:
codex-rs/core/src/review_prompts.rsrunsgit diff {mergeBaseSha}(compares merge-base to working tree) instead ofgit diff {mergeBaseSha}...HEAD(compares merge-base to branch HEAD). Closed after 3 months for "no upvotes." - #8548 reported that the agent commits untracked files via
git add -Adespite explicit repo policy. Closed same day as "model behavior."
The first issue is not model behavior. It is a one-line bug in the diff command. The root cause and fix were already identified in #8404.
What steps can reproduce the bug?
- Have any untracked files in your working tree (datasets, figures, build artifacts)
- Run a PR-style review against a base branch
- The review comments on untracked files that are not in the branch diff
What is the expected behavior?
Reviews should only cover git diff <merge-base>...HEAD, i.e. changes introduced by the branch, not the working tree.
Additional information
_No response_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗