Agent changes in non-opened file revert on file open

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

If agent makes some changes in a file that is not currently open, I click “keep”, then open file, all changes are reverted. Very annoying.

Steps to Reproduce

Have agent make some changes in a file that is not currently open;
Accept changes;
Open the file.

Expected Behavior

Changes not reverted

Operating System

Windows 10/11

Version Information

Version: 2.4.23 (user setup)
VSCode Version: 1.105.1
Commit: 379934e04d2b3290cf7aefa14560f942e4212920
Date: 2026-01-29T21:24:23.350Z
Build Type: Stable
Release Track: Default
Electron: 39.2.7
Chromium: 142.0.7444.235
Node.js: 22.21.1
V8: 14.2.231.21-electron.0
OS: Windows_NT x64 10.0.26100

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the report.

This is a known issue. There’s a conflict between the Agent Review tab and the regular editor. If the same file is open in both places, changes can get reverted.

Quick workaround: close the Agent Review tab before opening files, or close the file in the regular editor when you’re working through Review.

Can you confirm if you were using the Review feature when this happened? Here’s a related thread with more details: Agent code changes are automatically deleted

The team is aware of this. Let me know if the workaround helps.

No, I do not use Review. I just ask Agent to make changes and accept them. They when I open the file, I see those changes only if I press Ctrl+Z. So, changes are made, but when file is opened it is reverted to the version before the change. This does not happen if a file is opened in editor.

Thanks for clarifying.

This sounds like a different bug. The agent saves the file, but when you open the IDE it looks like it reloads an older version from disk. The fact that Ctrl+Z brings the changes back suggests they were applied, then got reverted.

Can you check a couple things:

  • Does it happen with all files or only specific ones?
  • Is the file in git? Are there any uncommitted changes before the agent touches it?
  • Which agent mode are you using?
  • Can you reproduce it with a simple test file?

Let me know what you find. If it’s reliably reproducible, we’ll need to file a ticket with the team.

  • Does it happen with all files or only specific ones? - All files AFAICS

  • Is the file in git? Are there any uncommitted changes before the agent touches it? - No, not on git.

  • Which agent mode are you using? - Auto

  • Can you reproduce it with a simple test file? - Yes

It seems the culprit is SFTP extension (from Natizyskunk). When I disable it it works just fine. So, the solution is to deiable/remove SFTP extension. I’m gonna have to find something else instead of it.

1 Like

SFTP Extenstion has “download on open” option, which if enabled overwrites changes made by the agent with the file version from remote source. So there is no need to disable/remove the extension, disabling that option is enough.

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.