Apply model deleting code, AI not aware until next user message

From what I understand, the AI should immediately have knowledge if the apply model (edit to file) accidently removed any code.

However, most of the time the AI believes everything was applied successfully and nothing was unintentionally removed.

If I do a follow up prompt, it confirms it has access to the file diff result from the apply, and only then, does it correctly recognize the apply model accidently removed code.

This really feels like a bug and not intended behavior. My only other guess is that Cursor sometimes doesn’t give the AI access to the diff result until the next user message.

I would love some insight into to this issue and hoping it can be improved.

Hey, the composer does not currently have any visibility on what changes the apply model made, only if it executed successfully or not.

Can you send a large chunk of your composer chat history, including an example of the bad apply, as this would be helpful to figure out what went wrong here!

Can you validate your statement is true? If you ask the AI to repeat the raw diff result after calling the tool, it is able to do so.

Here I told the AI to make a random test edit that adds and removes something.

Ah, the tool call for applying a change does return the diff, I stand corrected!

I’d have to confirm if the same happens in the chat and normal composer.

My only guess is that the AI’s thinking does not care enough to consider the diff results unless specifically asked.

I’ve found just asking “Did you accidently remove anything unintentionally?” does a great job most of the time, without the need to manually point anything out.

Though I hope it can be improved internally to reduce the need to manually prompt it.