Skip to content

Checking unexpected file changes step force resets all unrelated changes elsewhere #6187

Closed

Description

@guidedways

What version of Codex is running?

v0.54.0-alpha.2

What subscription do you have?

Pro

Which model were you using?

gpt-5-codex-high

What platform is your computer?

macOS

What issue are you seeing?

With other AI tools and CLIs I've got a habit of:

  • Instructing the CLI to perform a task
  • 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.

Additional information

No response

Activity

  1. github-actions commented on Nov 4, 2025

    @github-actions
    Contributor
  2. guidedways commented on Nov 4, 2025

    @guidedways
    ContributorAuthor
    - 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.

  3. tamasarpad commented on Nov 8, 2025

    @tamasarpad

    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"

  4. etraut-openai commented on Nov 11, 2025

    @etraut-openai
    Contributor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingmodel-behaviorIssues related to behaviors exhibited by the model

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions