The 0. 44. 6 update to Cursor causes a file creation failure
I have the same issue - seems the edit tool is being used but the edit tool is no longer working on new files - unfortunate
After some checks, it turns out that the agent relies on edit_files that allows to:
{“description”: “Use this tool to propose an edit to an existing file.\n\nThis will be read by a less intelligent model, which will quickly apply the edit. You should make it clear what the edit is, while also minimizing the unchanged code you write.\nWhen writing the edit, you should specify each edit in sequence, with the special comment // ... existing code ...
to represent unchanged code in between edited lines.\n\nFor example:\n\n\n// ... existing code ...\nFIRST_EDIT\n// ... existing code ...\nSECOND_EDIT\n// ... existing code ...\nTHIRD_EDIT\n// ... existing code ...\n
\n\nYou should still bias towards repeating as few lines of the original file as possible to convey the change.\nBut, each edit should contain sufficient context of unchanged lines around the code you’re editing to resolve ambiguity.\nDO NOT omit spans of pre-existing code without using the // ... existing code ...
comment to indicate its absence.\nMake sure it is clear what the edit should be.\n\nYou should specify the following arguments before the others: [target_file]”, “name”: “edit_file”, “parameters”: {“properties”: {“blocking”: {“description”: “Whether this tool call should block the client from making further edits to the file until this call is complete. If true, the client will not be able to make further edits to the file until this call is complete.”, “type”: “boolean”}, “code_edit”: {“description”: “Specify ONLY the precise lines of code that you wish to edit. NEVER specify or write out unchanged code. Instead, represent all unchanged code using the comment of the language you’re editing in - example: // ... existing code ...
”, “type”: “string”}, “instructions”: {“description”: “A single sentence instruction describing what you are going to do for the sketched edit. This is used to assist the less intelligent model in applying the edit. Please use the first person to describe what you are going to do. Dont repeat what you have said previously in normal messages. And use it to disambiguate uncertainty in the edit.”, “type”: “string”}, “target_file”: {“description”: “The target file to modify. Always specify the target file as the first argument and use the relative path in the workspace of the file to edit”, “type”: “string”}}, “required”: [“target_file”, “instructions”, “code_edit”, “blocking”], “type”: “object”}}
Or described by the agent: “The edit_file tool that I was using is designed to modify existing files, not create new files from scratch. It seems that the workspace environment I’m operating in might not have a dedicated tool for creating new files. This could be an intentional design choice or a limitation of the current setup.”
Reverting to V. 0.44.5 seems to be the wiser choice!
0.44.8 should have the fix for this issue, so updating to that will solve!
Now, in the latest version, when reviewing changes, an error message will be displayed saying that the file cannot be found, but the file has been successfully modified. You can ignore the error message, but it doesn’t feel good.
Do you have a screenshot of what this looks like?
After my test, for example, the name of the file added in the context I am modifying is ztest154. After the modification is completed(in fact, the file has been modified successfully), before accepting or rejecting, double-click ztest154 1/2 or ztest154 2/2, and an error message “The file cannot be found, so the editor cannot be opened”; but once I accept the changes,Repeat the above operation again, and the file can be opened normally; version 0.44.5 does not have this problem, and it appears in subsequent versions.
I also encounter that bug when clicking the file bar in the composer after editing. It says, “File cannot be found.”
It seems the file path is incorrect. My file is located at /home/dev/file.py
, but Cursor tries to open the file at \home\dev\file.py
, which causes the error.
I am using 0.44.8 on Windows 10 with the Remote SSH feature to work on Linux machines.