-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Description
What version of Codex is running?
Codex cloud environment (via ChatGPT UI), no local Codex CLI
What subscription do you have?
ChatGPT Plus (using Codex via ChatGPT UI)
Which model were you using?
Codex default model (via ChatGPT UI)
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What terminal emulator and version are you using (if applicable)?
Codex built-in cloud terminal (Ubuntu-based container)
What issue are you seeing?
When using Codex environments for incremental development on a real, long-lived repository, the environment appears to operate on a snapshot-like git state without proper refs or tracking branches (e.g. missing local main).
Because of this, the agent cannot reliably compute diffs against the existing codebase. As a result, many incremental changes produce pull requests where a large number of files (30–40+) appear as newly created, even though they already exist and were not meaningfully changed.
This makes PRs noisy, increases review cost, and significantly increases credit usage when working iteratively on the same project.
What steps can reproduce the bug?
- Create or use an existing long-lived repository with multiple incremental changes.
- Open the repository in a Codex cloud environment via the ChatGPT UI.
- Ask Codex to implement a small change (e.g. add a button, wire a use case).
- Let Codex generate a pull request.
- Observe the “Files changed” section showing dozens of files marked as new or fully rewritten, even when they were not modified.
This happens consistently across multiple tasks in the same repository.
What is the expected behavior?
Codex should be able to diff against the existing repository state (e.g. the main branch or other tracked refs) and produce pull requests that include only the actual, intentional changes made for the task.
Additional information
I investigated this further and noticed that the Codex environment seems to lack a full git ref graph (no tracking branches like origin/main). Network access is available during setup/maintenance phases but not during interactive sessions, which prevents proper ref reconciliation (e.g. git fetch).
This suggests the environment may be initialized as a snapshot rather than a full clone, which works for short tasks but breaks incremental development workflows.
Happy to provide a minimal reproduction repository or additional details if helpful.