Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
Conversation ID: ec14702a-7125-494b-83b4-9b5b2853c788
[User: attach Request ID from Cursor UI if available]
Environment:
- Cursor Agent mode, Windows 10
- Project: Java/Spring Boot (Maven), refactor plan execution
Issue 1 — Unrequested deletion of existing comments
When executing a structured refactor plan, the agent replaced entire Java
source files via Write tool instead of minimal StrReplace diffs. Collateral
damage included removal of existing JavaDoc on methods/fields and inline
comments (e.g. TcpClientService, AuthService, MessageReplyService). The
user’s plan did not ask to remove documentation.
Issue 2 — File content corrupted with extra blank lines per line
After Write operations, several .java files exhibited an alternating pattern
(every content line followed by an empty line), roughly doubling file length.
Subsequent agent attempts to “fix” this (regex collapse of \n\n and
heuristic re-formatting) removed legitimate blank lines from the original
codebase (e.g. blank lines between @Autowired fields, import groups).
Expected: - Preserve existing comments unless explicitly asked to change them
- Preserve original formatting/blank lines when making logic-only changes
- Prefer surgical edits (StrReplace) over full-file Write for established files
Impact:
User lost significant time reviewing and asking for comment/format restoration
unrelated to the actual protocol alignment task.
Steps to Reproduce
Open a Java project that already has JavaDoc and a consistent blank-line style.
In Agent mode, submit a refactor plan that says: change behavior only; do not remove comments; do not reformat.
Observe the Agent rewriting multiple existing source files with full-file Write instead of small surgical edits.
Inspect the diff:
Issue A: Method/field JavaDoc and inline comments are deleted (not requested).
Issue B: Some files show an alternating pattern (content line + empty line), roughly doubling line count.
Operating System
Windows 10/11
Version Information
Version: 3.17.21 (user setup)
VS Code Extension API: 1.128.0
Commit: 8f2a112cb2845a97b75fd932ea5c470579ca4060
Date: 2026-08-25T01:05:08.089Z
Layout: Agent Window
Build Type: Stable
Release Track: Default
Electron: 40.10.3
Chromium: 144.0.7559.236
Node.js: 24.15.0
V8: 14.4.258.32-electron.0
xterm.js: 6.1.0-beta.291
OS: Windows_NT x64 10.0.22631
Does this stop you from using Cursor
Yes - Cursor is unusable