I haven’t found a solution yet. I’ve gotten the Composer Agent to do some wild things all week (props to the Cursor team for making a real agent that can do many steps and reason through them effectively, provided you’re giving the agent enough info and context to work with).
However even in trying to troubleshoot with Claude, we’re unable to figure out why Composer Agent is trying to apply edits before line 1.
Claude also sees the issue in Agent mode, and is unsure why it is trying to do that. A workaround I found was to let it fail, then go into the file git logs and restore all the edits that SHOULD have been present but they don’t show up.
Example:
- I’m on a file that composer is trying to edit. This is a brand new session after restarting my PC and restarting cursor several times.
Here’s the prior composers showing the previous failures:
And yet another composer session where this has been failing. So since edit 3, you can see any number of composers fail:
- Now why do they fail? Let’s take a look:
So couple possible issues I see. Everything seems to apply BEFORE line 1 in the file, seemingly not keying any lines or cursor position. Is the agent trying to apply edits to a cursor position that doesn’t exist or it can’t find?
Secondly, it shows in the git log so that means its applying somewhere. Funny that this issue occurs as I’m working on a quantum sim project with Claude Restoring from the git log seems to work and save the history.
However even when I do that, I see the Applying or Generating status still pending on the files. In fact on my old composer sessions I still see an Applying action event/indicator right now as I’m typing this.
So there’s either some state mismatch or race conditions on states - perhaps its a function of a really large codebase that I’m working in and Claude not having enough time to finish all steps required in its thinking and tool use/computer use? Not quite sure, but I can say with certainty that Claude was able to work for ~30 minutes on its own accord as Agent yesterday for a single turn, with 100+ steps taken, so hope it’s temporary!