The Cursor LLM that interprets and applies code changes does not work...ever

I’ve noticed that regardless of whichever LLM you use in chat, the code that’s provided does not get applied correctly to your files. I’m assuming the code revisions are handled in a separate step by a cheaper/faster (possibly proprietary) model from cursor… which almost always fails to actually apply the code reasonably. It deletes relevant code unnecessarily, ignores important changes nearly all the time, and butchers whatever actual output the model you’re working with produces. Are there fixes in the works for this or is this just the reality of the cursor platform? If so, we’re probably better off just using a separate LLM and applying the code changes ourselves… but that defeats the entire purpose of cursor.

1 Like

I wasn’t sure how to DM you @danperks on this forum, but were you able to boot T1000? If so, thank you! Exhausting…

Hey, it would be great if you could share any specific cases where Apply has got things obviously wrong. Request IDs are best, as it lets us figure out whats going on behind the scenes:

I can share examples/code, but it’s pretty much all over the board. What I’m noticing is that if the LLM doesn’t provide clear in-line context with comments about what code to keep/skip, etc., the cursor system (whatever handoff from the base model to whichever model applies the code) has no idea how to do it. It ends up deleting tons of relevant code or just getting confused how to make the changes. While the response from the LLM (in most cases I’m using Claude-3.5-sonnet) is spot on, once it’s translated to the actual code by “applying it” it’s, unfortunately pretty useless and just destroys all the code.

I think the issue may be with the system prompts for the LLM that’s handling chat. It needs a system message to instruct it to add comments like “// … rest of existing method remains unchanged …” … otherwise the cursor system just blows the code out of the water and deletes hundreds of lines of code because it’s being to literal.

You are right that we specify a format that your “main” model should return with in order for the apply model to parse the changes effectively, and if this stops working, the apply functionality will be all over the place!

While rare, the LLM can get itself in this state and it usually will not recover, so you may find it useful to start a new Composer session, where the LLM will start fresh regarding the format it should output in.