Agent keeps applying removed code

Describe the Bug

Agent keeps adding back suggested but deleted code.

Steps to Reproduce

Workflow:

  1. ask agent to make some code change
  2. review code change and removed some code
  3. ask agent to make further changes
  4. agent makes new changes, but adds back the removed code

Expected Behavior

agent only makes new changes

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 0.45.14
VSCode Version: 1.96.2
Commit: 906121b8c0bdf041c14a15dac228e66ab5505260
Date: 2025-02-19T20:36:48.096Z
Electron: 32.2.6
Chromium: 128.0.6613.186
Node.js: 20.18.1
V8: 12.8.374.38-electron.0
OS: Darwin arm64 24.5.0

Additional Information

claude sonnet 4

Does this stop you from using Cursor

No - Cursor works, but with this issue