Cursor restores discarded read-only file edits on startup and triggers mass handleSaveError

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Before closing Cursor, I explicitly selected “Don’t Save” for unsaved edits in several files. These files are not checked out in Perforce and are read-only.

After fully exiting and restarting Cursor, then entering IDE mode, Cursor restores the discarded edit buffers and repeatedly displays save errors such as:
“Unable to save : The file is read-only.”

关闭 Cursor 前,我已对多个未保存文件明确选择“不保存”。这些文件未在 Perforce 中签出,因此为只读。

完全退出并重启 Cursor 后,进入 IDE 模式时,Cursor 又恢复了这些本应丢弃的编辑缓冲,并重复弹出“无法保存,文件是只读的”提示。

Steps to Reproduce

  1. Edit a read-only file in a Perforce workspace.
    在 Perforce 工作区编辑一个只读文件。
  2. Close Cursor and select “Don’t Save” for the unsaved edit.
    关闭 Cursor,并对未保存编辑选择“不保存”。
  3. Fully exit Cursor and confirm no Cursor process remains.
    完全退出 Cursor,并确认没有残留 Cursor 进程。
  4. Restart Cursor and enter IDE mode.
    重启 Cursor 并进入 IDE 模式。
  5. Observe that discarded edits are restored and read-only save errors appear.
    观察到已丢弃的编辑被恢复,随后出现只读保存失败提示。

Expected Behavior

Expected behavior / 预期行为:
After selecting “Don’t Save”, the edit buffers should be discarded permanently. Cursor should not restore them or attempt to save the read-only files on the next startup.
选择“不保存”后,编辑缓冲应被永久丢弃。下次启动时 Cursor 不应恢复这些编辑,也不应尝试保存只读文件。
Actual behavior / 实际行为:
Cursor restores the discarded edit buffers and attempts to save many read-only files.
Cursor 恢复了已丢弃的编辑缓冲,并批量尝试保存多个只读文件。
Additional evidence / 补充证据:

  • Setting files.hotExit and files.autoSave to off does not resolve the issue.
    files.hotExitfiles.autoSave 设为 off 后问题仍然存在。
  • Cursor creates a new Backups directory only after entering IDE mode.
    Cursor 仅在进入 IDE 模式后才重新生成 Backups 目录。
  • In renderer.log, many [text file model] handleSaveError messages occur before the Agent extension starts. This suggests the issue happens during editor/workspace restoration, rather than from a specific Agent request.
    renderer.log 中,Agent 扩展启动前已经出现大量 [text file model] handleSaveError。这表明问题发生于编辑器/工作区恢复阶段,而非特定 Agent 请求。

Screenshots / Screen Recordings

renderer.log (35.9 KB)

Operating System

Windows 10/11

Version Information

Version: 3.12.17 (user setup)
VS Code Extension API: 1.128.0
Commit: 0fb762053c34788bb7760d5673f8a6d4c8589d50
Date: 2026-07-17T02:53:53.006Z
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.256
OS: Windows_NT x64 10.0.19045

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hi @as674876827

Thanks for reporting this! We’re aware of this issue, specifically with Perforce workspaces. I’ve added your report to our existing bug ticket.

One thing worth trying is setting "files.hotExit": "off" in your VSCode settings. This prevents the backup cycle from starting in the first place. You’d lose the ability to restore unsaved changes after a crash, but might eliminate the “Failed to save” errors on reload without requiring a full data wipe (we’ve seen mixed results).