Cursor Deleting Huge Codeblocks When Trying To Add

Is anyone else experiencing this issue… Cursor offers up a code suggestion and won’t add it without wanting to delete mass amounts of code (sometimes all of it). This has been happening more and more in both Chat and Composer contexts–using Sonnet-20241022 .I’m a mac user. Sonoma 14.4.1. Thanks

Cursor Version Current
Version: 0.43.5
VSCode Version: 1.93.1
Commit: 2eaa79a1b14ccff5d1c78a2c358a08be16a8e5a0
Date: 2024-11-27T09:11:51.854Z
Electron: 30.5.1
Chromium: 124.0.6367.243
Node.js: 20.16.0
V8: 12.4.254.20-electron.0
OS: Darwin arm64 23.4.0

2 Likes

Yeah this is pretty common for me. I have to watch him like a hawk. It takes a lot more effort and attention but if you pay attention to these ommisions, you can usually copy them back into composer and say somthing like:

“Explain why you tried to remove these lines from @filename. We need to maintain ALL existing functionality. Only make minimal changes to fix X feature we’re working on”

{ lines of code }

It will then apologize profusely for being stupid and usually write a clean minimally updated version.

You always gotta keep it focused. It’s ADD af

3 Likes

Getting this regularly too, it’s infuriating. Randomly deletes a load of code for absolutly no reason, often not even related to the request / prompt.

I think the issue is that they’re using a mixture of experts approach (which is good) but the handoff from the chat LLM to the separate LLM that applies the code changes is pretty janky. I could be wrong, but I think there’s a “game of telephone” going on between you (the user) → the chat llm → and the application of the code changes by the final LLM call (context issues).

Ya, I can’t get a single response now without it wanting to delete the rest of my file , not sure what happened here, but something definitely changed. It wasn’t like this (at least for me) even so much as a few days ago. Should note too, I am a Business Account user.

want to fix this! would be really helpful if you could share request ids when this happens (and turn off privacy mode for that request) so i can debug further

if you hit cmd-shift-p and type “Developer: Report AI Action”, you can report the apply as a bad request and i’ll take a look on my end!

2 Likes

Yeah this is happening more often. It’s gotten to the point that I have to end every prompt with “Think it through and make changes carefully, do not remove existing features or modify design” Every. Time.

3 Likes

I asked the AI if its cause I’ve made changes to the files and it said it only has the last change/edit that was done by the agent/shared with them - so sometimes I think its deleting stuff because it isn’t actually checking the file before hand.

I’m constantly getting it to revert back (its better for you to undo and tell the agent to check the file, then see if the updates apply)

I’m constantly reminding it not to modify certain files and it does it anyway.

Then it likes to “Do you want me to do this to x file?” While its already done it ha

Try this, let me know if helpful.