I am dealing with the same problem and think I can add some information.
For me, this problem allways occurs when I open files that dont belong to the current workspace.
In that case. Composer and Chat provide two options, both with the same path E.g. /path/to/foreign/file. However one will grab the correct (global) path, and the other will simply create a new file in the opened workspace. E.g. workspace/path/to/foreign/file
This is really annoying since this can not be undone! If I reject the file and re-apply the changes, it will still apply them to the wrong directory, with no option to change the directory. The only way to bypass this is to generate new changes through prompting, and then hoping cursor grabs the correct path that time.
Workspace support is not yet available in Cursor, as our codebase indexing relies heavily on everything being in the same folder, but I’m hoping we can add workspace support in a future release so this kind of workflow works!
i.e. I have files A.txt, B.txt, C.txt in the weird box that I can not remove files from. File D.txt is added to context. In file E.txt I select code and press CMD+I, I see E.txt(50-60) added to context. I ask to change a line of code expecting it to change file E.txt. Cursor completes the request and suggest a change in B.txt. Hheee?
This is still an issue and it’s really frustrating
In my case, I have the original file in src/components/file.jsx
It applies changes to a new directory entirely like
path=src/components/file.jsx
and I have to manually copy these changes into the right file and its not a full rewrite of the code so I have to find particular lines affected which is not a good user experience.
For some context, it started when I rejected some changes, I also might have been editing it while it was editing or something. Ever since then, that file appears in the “Review next file” flow, without any changes, and I can’t reject nor accept the file, and if I try to get the agent to change the file, it chooses the wrong file. Deleting and building the index fixed that issue, but then caused the chat to get… funky. Like reporting it did things when it didn’t, making changes I didn’t ask for, the kind of stuff you get at the end of the context window.