Gemini 2.5 Pro thinks the apply model made incorrect changes, when in fact they were correct

Describe the Bug

A lot of the time, Gemini 2.5 Pro thinks the apply model made incorrect changes, when in fact they were correct.

In this case, Gemini was able to re-read the file and determine the changes were applied correctly. However, a lot of the time you can get into a loop constantly saying that the changes were applied incorrectly and continually trying to re-apply the changes.

Steps to Reproduce

  1. Use Gemini 2.5 Pro as a daily model.
  2. You should eventually encounter this issue.

Expected Behavior

Gemini 2.5 Pro should be able to discern if the apply model made the correct changes properly, instead of misleadingly thinking that they are incorrectly applied.

Screenshots / Screen Recordings

Operating System

Windows 10/11

Current Cursor Version (Menu → About Cursor → Copy)

Version: 1.1.6 (user setup)
VSCode Version: 1.96.2
Commit: 5b19bac7a947f54e4caa3eb7e4c5fbf832389850
Date: 2025-06-25T02:20:02.577Z
Electron: 34.5.1
Chromium: 132.0.6834.210
Node.js: 20.19.0
V8: 13.2.152.41-electron.0
OS: Windows_NT x64 10.0.26100

Additional Information

Message ID: d408b9de-bfd1-44e0-8897-b24c5634b519

Does this stop you from using Cursor

No - Cursor works, but with this issue

Thanks for the report here!

One of three things may have happened here:

  • Gemini was told the edit failed, when it was successful
  • Gemini was told the edit succeeded but misinterpreted it
  • The apply model read the edit suggestion from Gemini, misinterpreted it, and edited the code differently to how Gemini wanted it to be edited

For the first, this would be a bug on our end, but as I have not seen any reports of this recently, I would assume that is unlikely.

The second cause is possible, but Gemini being one of the more advanced models shouldn’t really have such issues.

The final cause is, in my opinion, most likely, but is the hardest to fix. The ‘apply’ model that enables edits of whole files in just a few seconds is its own, standalone model. It gets a set of changes given to it from Gemini, which is basically just a diff of what to remove and what to add, and it then applies that to the whole file. What can happen on occasion is the Apply model doesn’t write the code how Gemini intended it to be written.

Regardless of the cause, it looks like Gemini self-corrected, but I’ll pass this feedback on to the team to see if we can reduce the risk of this happening!

Some important context is the rule he’s likely using, that’s some variation of “High Priority Rule: To prevent errors, if a file editing tool fails or reports no changes were made, you must resynchronize your knowledge by reading the file again before re-attempting the edit. Do not assume your cached version of the file is correct.”

Gemini typically doesn’t reread after failures; it takes specific instruction

This is more of a band-aid fix for the fact that Gemini constantly convinces itself that its own edits are failing, and forcing him to re-read after each edit gets him to move past it. Gemini’s thoughts here probably aren’t super indicative of what’s actually causing him to fail

You’re right, Gemini’s self-correction was due to my custom rule telling it to re-read the file if an apply seemingly failed.

I learnt this after experiencing many times of Gemini constantly being in a loop of trying to fix a “failed apply”. I stopped it and told it to re-read the file, which it then realized the changes were already applied correctly. Hence this lead to creating a rule for this sort of issue, so half the time it’s able to self-correct without manual intervention, but this is not an ideal solution.

This is exactly what happens for me, all the time, in fact. Correct edit in the editor (and in the inline box in the chat area), but Gemini complains it failed and attempts over and over.

Makes Gemini completely unusable.