When agent works in a worktree and writes to a file, the changes are not actually saved on the disk.
In the screenshot below agent created new files: Organization and CurrencyConverter and modified User file. On disk both organization and currencyconverter files are empty and user file does not contain the changes agent made.
I must go through all the changed files, save them manually and then the files are modified on the disk.
The problem is when agent tries to run a test in the worktree, it fails because no changes are actually there, unless I manually save them.
I believe this should not be the case.
I have also experienced this problem today when first trying agents with worktrees. The agent modified an existing file alright, but it created 5 new files (as planned), but no matter how much I pushed Apply All, Reapply, Create PR (went through github merge pull request) - the files stayed empty. I had to manually copy the contents from Cursor to physical files to apply edits.
when clicking “apply all”, not all of the modified files are moved over (there is a selection between “pending changes” and “all changes” to be moved from the worktree and in my experience both of these fail to move over all the changes)
when agent modifies a file within the worktree, it is not actually written to the file on disk and only visible within cursor ide → this is a problem because i might task the agent to create tests in the worktree, it writes them and when it tries to run the tests within the worktree to verify they are correct → they do not work because they are empty files
on top of that, if im not mistaken, once i accept the changes from the worktree to be moved over, i have the option to revert but after reverting no option to apply again and also once i apply changes, the “review changes” button disappears from the chat so unless i kept the review tab open, i have no option to revert or review changes that were made
this is the stupidest bug… literally nothing actually commits the work… who wrote this BS? its completely broken… cursor is completely unusable in with this “feature”….. you need to fix this ASAP
That’s not how Cursor used to work before this change - I want the changes visible as the files are edited without having to apply. It’s buggy AF at the moment.
Yup, I’ve got the same issue. What I’ve discovered happens:
You need to run a multi-agent scenario using worktree.
When the agents are finished, they create empty files for the work. They then add the code to the files in the IDE, but do not save the changes to those files (respective to each individual worktree)
When you click Apply, it copies across the BLANK files, and so in my case using Node + NextJS, it breaks the app.
To solve this:
You must first make sure the changes are NOT applied (or unapply the changes if you applied them)
Save all the files open in the IDE. (You can individually go through and save 1 by one, or choose save all.) I usually choose to save all, then close all, to make sure I know I’ve got everything saved.
Now you can go ahead and click “Apply”, and the it will copy the fully coded file as expected.
If you want to make any follow up changes to a particular agent
You have to first click unapply, otherwise it changes the local and then the unapply button disappears
Once the change is made, you will again see a number of unsaved files in the IDE.
Save these files again (You can individually go through and save 1 by one, or choose save all.) OR IT WILL NOT update.
Now you can click Apply again and it will apply the latest changes.
Either there is a setting I’m unaware of to autosave the changes from the agents into the worktrees, or this is a bug. If it is the latter, it would be great if this is fixed, because I often forget to save first when I’m doing follow up minor changes, and it’s highly frustrating!