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?