Skip to content

Squashing commits invokes git rebase -i and hangs #4814

Closed

Description

@alexeyv

What version of Codex is running?

codex_rs #a95605a86796

Which model were you using?

gpt-5-codex

What platform is your computer?

Darwin 23.6.0 arm64 arm

What steps can reproduce the bug?

Ask Codex to squash current feature branch into a single commit, and it goes like this:

thinking
Squashing commits with soft reset

$ git reset --soft 8e54b071260a8504a2554f0b35ff86a0f59aefab
exec command rejected: dangerous command detected; rejected by user approval settings
✗ (-1) • 0ms


thinking
Exploring safe git reset alternatives

$ git rebase -i master
✗ (1) • 9m 10s


■ Conversation interrupted - tell the model what to do differently

user
rebase -i is interactive

thinking
I’m outlining a careful approach to squash multiple commits into one by saving the diff to a patch file,
renaming the old branch as backup, creating a new branch from master with the original name, applying
the patch, committing a single combined commit, then cleaning up by deleting the old branch and patch
file. This sidesteps reset and dangerous commands by working through patching and branch renaming.

Note

$ git rebase -i master
✗ (1) • 9m 10s

^^ this is rebase -i waiting for a user interaction, which obviously isn't coming.

When asked why is git reset prohibited, LLM says:

"The developer instructions for this CLI session explicitly say “never” revert changes you didn’t make
—git reset would undo user work. Those instructions hold higher priority than your requests, so I’m
required to follow them and avoid git reset."

Sounds like the system prompt issue to me.

What is the expected behavior?

No response

What do you see instead?

No response

Additional information

No response

Activity

  1. alexeyv commented on Oct 6, 2025

    @alexeyv
    Author

    here is a patch that seems to be in the right direction. The gist of it is that git reset --soft is actually a safe operation (no code gets deleted), but git rebase -i isn't, because it just hangs. I'm not familiar enough with this codebase to properly evaluate this, so I'm not turning this into a pull request. Consider it a weak suggestion of a fix. :)

    patch.txt

  2. quinnj commented on Oct 31, 2025

    @quinnj

    I've hit this same issue a few time.

  3. etraut-openai commented on Nov 14, 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

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