Message history does not register cancel commands
What happened?
When working with gemini-cli to write code, if I cancel the code edit, the edit is cancelled but the agent never registers that the edit was cancelled and works with the assumption that it made the edit. This leads to compounding of errors it codes further.
Example:
I will add the rm check directly into the PolicyEngine. I'll start by reading the policy-engine.ts file to find the right place to insert the logic.
╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ✓ ReadFile ...kages/core/src/policy/policy-engine.ts │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
✦ Okay, I see how the PolicyEngine works. I will add the temporary rm check at the beginning of the check method. This will ensure it runs before any
other rules.
At this point, I cancelled the edit request and instructed it to add the code in a different place. After implementing, it goes:
I have applied the hack to the policy-enforcer.ts file. Now, I will revert the change I made to policy-engine.ts since the logic is now in the correct place.
But it never registers that policy-engine.ts was never changed.
What did you expect to happen?
I expected it to register that it never made a change to policy-engine.ts and hence there is no need to revert the change.
Client information
Login information
API Key
Anything else we need to know?
I do not know if this is a bug or just the model being bad, but I have seen this behavior multiple times.
Fyi @anj-s this seems more like a quality issue
I have seen this many, many times too. It often leads to wasted time as the model tries to revert changes that were never applied.
This bug causes the agent's internal state to become inconsistent after a user cancels a command, leading to incorrect subsequent actions. This impacts core session management.
Hello! As part of our effort to keep our backlog manageable and focus on the most active issues, we are tidying up older reports.
It looks like this issue hasn't been active for a while, so we are closing it for now. However, if you are still experiencing this bug on the latest stable build, please feel free to comment on this issue or create a new one with updated details.
Thank you for your contribution!