Agent code changes are automatically deleted

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

The agent will fix a bug (found during Agent Review), and then the code is immediately deleted. I can actually see the code change, and then see it almost instantly disappear. It is almost as if it is reloading the file …maybe

Steps to Reproduce

I don’t know, does not seem deterministic. If I close the file it is editing, and ask it to redo the edit, then the edit saves and is not deleted.

Expected Behavior

I would expect the agent to make the change and then it would be there for my review, it would not be deleted.

Operating System

Linux

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.3.38
VSCode Version: 1.105.1
Commit: 5d361ec90febc2eee7d3a0c5c8c6567985977500
Date: 2026-01-15T18:25:49.175Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Linux x64 6.17.9-76061709-generic

For AI issues: which model did you use?

Composer 1 and GTP 5.2 codex

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the report. This is a known issue, a bug caused by a conflict between the Agent Review Tab and file editing.

A similar case is described here: AI code changes immediately revert on specific files

It happens when the same file is open in both the Agent Review Tab and a regular editor tab. The AI applies changes, but they immediately get reverted.

Workaround:

  • Close the Agent Review Tab before the agent makes edits
  • Or close the file in the regular editor if you need to work via the Review Tab

Can you check if this workaround helps? Also, it’d be useful to know if this happens when you click an issue in Agent Review, then use “fix in chat” or normal chat while the Review Tab is still open.

The team is working on a fix.

Yes that is correct. I now realize that agent review will undo any ‘unaccepted’ changes. Very frustrating.

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