You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Checking unexpected file changes step force resets all unrelated changes elsewhere #6187
Unrelated to the task, I continue making changes to some other portion of code, but related to the current changeset I'm working on
Codex performs a Checking unexpected file changes step after it's done and completely wipes out my changes made elsewhere
In very strong words, I've instructed codex to never git checkout a file with changes unrelated to the current task (in AGENTS.md) but it completely ignores these instructions.
Please either disable this feature or allow us to disable it. This happens so often and at times changes I made elsewhere is hours of work that I am otherwise not ready to commit, but Codex wipes them out.
What steps can reproduce the bug?
Ask codex to fix a known bug
While it does this, go to an unrelated file and start making edits, such as improving the documentation
Codex will reset your changes when it's done
What is the expected behavior?
Codex should leave anything that was NOT part of its changes absolutely alone. If it's making edits in FileABC.swift it should never be concerned about changes (past or present or future) in FileXYZ.swift especially when Codex never read it, never saw it, was never asked to change it.
- While you are working, you might notice unexpected changes that you didn't make. If this happens, STOP IMMEDIATELY and ask the user how they would like to proceed.
- **NEVER** use destructive commands like `git reset --hard` or `git checkout --` unless specifically requested or approved by the user.
I see this in codex-rs/core/gpt_4_codex.prompt.md but clearly codex is ignoring this instruction including similar ones I've added to my AGENTS.md - it continues to destroy any and all edits made elsewhere, which can be very desruptive.
Many times as Codex is working and creating new files, I go around adding them manually to the Xcode project only to have the xcode project get RESET after codex is done working, undoing all my changes and in the process at times corrupting the project as it tried to make edits to the same project too.
maybe related, maybe not: It also routinely does git checkout to files when I tell it that it made a mistake in the last change and it reverts all the changes made to that file by doing a git checkout --.
Despite clear instructions in AGENTS.md marked as the "most important rule"
Thanks for the bug report. We've shared the feedback with the team members who are responsible for training our codex models. We're tracking this feedback and similar reports so we can make the model more robust in future iterations.
If you see other model behavior that you'd like to report, please use the recently-added /feedback command in the CLI. That will provide us with additional details including logs and conversation text.
Activity
github-actions commentedon Nov 4, 2025
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
guidedways commentedon Nov 4, 2025
I see this in codex-rs/core/gpt_4_codex.prompt.md but clearly codex is ignoring this instruction including similar ones I've added to my
AGENTS.md- it continues to destroy any and all edits made elsewhere, which can be very desruptive.Many times as Codex is working and creating new files, I go around adding them manually to the Xcode project only to have the xcode project get RESET after codex is done working, undoing all my changes and in the process at times corrupting the project as it tried to make edits to the same project too.
tamasarpad commentedon Nov 8, 2025
maybe related, maybe not: It also routinely does git checkout to files when I tell it that it made a mistake in the last change and it reverts all the changes made to that file by doing a git checkout --.
Despite clear instructions in AGENTS.md marked as the "most important rule"
etraut-openai commentedon Nov 11, 2025
Thanks for the bug report. We've shared the feedback with the team members who are responsible for training our codex models. We're tracking this feedback and similar reports so we can make the model more robust in future iterations.
If you see other model behavior that you'd like to report, please use the recently-added
/feedbackcommand in the CLI. That will provide us with additional details including logs and conversation text.