Stuck session restore reopens old Agent chats and rewrites a closed file after update/logout

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

After updating Cursor (now 3.14.7) and again after logging out/back into macOS, Cursor restores a stale session instead of the current one.

Symptoms:

  1. Previously closed Agent chat tabs reopen. They’re not even the most recent chats — older ones come back.
  2. A tracked Swift file I didn’t edit gets modified on disk: an extra } is appended at EOF. git status was clean before the update/logout; the diff reappeared after restart/login.
  3. Cursor Local History logged the file change as Undo Create Diff at the same timestamp the file was rewritten.
  4. storage.json still points at a backup path under Application Support/Cursor/Backups/… that no longer exists — looks like hot-exit/session restore is stuck on bad state.

Steps to Reproduce

  • Work in a project with Agent chats open; close some older Agent tabs (leave workspace otherwise normal).
  • Confirm git status is clean.
  • Update Cursor and/or log out of macOS and log back in (Cursor relaunches / restores windows).
  • Observe: old closed Agent chats reopen, and an unrelated file can show a new uncommitted diff (in my case, an extra } at EOF on LabTestDetailView.swift).
  • Discard/restore the file with git → quit/relaunch or re-login → same bad file change can come back.

Expected Behavior

  • Closed Agent tabs stay closed.
  • Session restore should use the latest valid session, not stale chats/buffers.
  • Files that weren’t edited shouldn’t be rewritten on disk after update/logout.
  • Missing/corrupt backup folders shouldn’t cause phantom restores.

Operating System

MacOS

Version Information

Version: 3.14.7
VS Code Extension API: 1.128.0
Commit: a758f2241ca99fecf380180b6cbdbbce0f1f42c0
Date: 2026-07-30T06:41:34.009Z
Layout: IDE
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: Darwin arm64 25.5.0

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the detailed report. The Local History label and your note about storage.json really help.

An untouched file getting rewritten on disk after an update or re-login is not intended behavior, and it’s not caused by your settings. Here’s the key model for what’s happening: inline diff is a review overlay on top of changes that are already saved to disk. It lives separately from git, so neither git commit nor git discard clears it. Because of that, a stale state can get restored on restart and then re-save the file again. Reopening old Agent tabs is the same kind of stale session restore. This is a known issue we’re tracking.

How to break the loop:

  • Open the affected file LabTestDetailView.swift in Cursor and click Keep All. This safely removes the overlay. The code is already on disk, so you won’t lose anything. Do not use Undo All, it rolls back real saved code, not just the overlay.
  • Start a new chat. This fully resets the Review list.
  • If you don’t see Keep or Undo buttons due to a stuck state, use this fallback: copy the file contents, press Ctrl+Z until the diff blocks disappear, then paste the contents back. Another option is to rename the file, fully quit Cursor using Cmd+Q not just reloading the window, reopen Cursor, then rename it back.

For the future: before exiting Cursor, make sure you accept or reject all pending agent edits in Review. Unresolved edits are what stick in session state and come back after restart. Since files can be rewritten silently, keep regular git commits as a clean recovery point.

I can’t share an ETA for a fix yet, but it’s on our radar. Let me know if these steps help. If the change still comes back after Keep All and a new chat, send exact repro steps and I’ll take a deeper look.

Thanks Dean. And I’ll pass along the kind words to Grok :wink:

I have come across the stale inline diff bug many times in the past and left other notes about it here on the forum. I have been hitting “keep all” now that I understand it’s just stale noise. I think in this case I just had the agent clear the extra bracket and then check the diff. So I can’t verify that accepting the stale inline diffs would have solved it in this case, but maybe you’re right.

But regarding the chats I had already closed all of them and opened a new one prior to updating the app but they came back again, along with the stale diff. So i thought that odd.

Will try the above steps next time though.