Stuck on a thinking loop forever

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

  1. App freezes when closing (or after some time). UI becomes unresponsive; sometimes need to force quit.
  2. Chat gets stuck in a thinking loop (endless “thinking” / retry). Happens even with Auto off and non-thinking model selected sometimes.

Already tried:

  • Moved Cursor.app to Applications (off read-only volume)
  • ai.thinkingEnabled: false in project .vscode/settings.json and in user settings
  • New chat, full quit (Cmd+Q), restart
  • Full clean profile: moved ~/Library/Application Support/Cursor to Cursor_backup, started fresh — issue came back
  • Launched with extensions disabled — still happens

Logs: main.log from a session with freeze shows:

  • UpdateService error: read-only volume (before move)
  • Many [storage state.vscdb] SQLITE_MISUSE: Database is closed
  • [storage main] detected slow close() operation: Time: 122295ms, DB size: 96478056448b (~96GB), large keys including aiCodeTrackingLines

Steps to Reproduce

Freeze
Use Cursor for a while (open a project, use chat/composer, maybe a few sessions).
Quit Cursor (Cmd+Q) or leave it open for a long time, then quit.
Expected: App closes (or stays responsive).
Actual: App freezes — UI stops responding, sometimes need to force quit. Logs show [storage state.vscdb] SQLITE_MISUSE: Database is closed and [storage main] detected slow close() operation: Time: 122295ms, DB size: 96478056448b (close takes ~2 minutes, very large DB).
Thinking loop
Open Cursor, open a chat (Composer or Chat).
Leave model on Auto (or pick a thinking/reasoning model if you can).
Send a message.
Expected: Model answers and stops.
Actual: “Thinking” spinner never ends, or it finishes and immediately retries in a loop. Stopping and sending again can trigger the same loop.

Freeze is more likely after long use and on quit (big state DB).
Thinking loop is intermittent; disabling thinking (ai.thinkingEnabled: false) and using a non-thinking model (e.g. Claude Sonnet) avoids it.
Repro may be easier with a large/corrupted state DB; we saw ~96 GB state.vscdb and very large keys like aiCodeTrackingLines.

Screenshots / Screen Recordings

Operating System

MacOS

Version Information

Version: 2.4.28 (Universal)
VSCode Version: 1.105.1
Commit: f3f5cec40024283013878b50c4f9be4002e0b580
Date: 2026-02-03T00:56:18.293Z
Build Type: Stable
Release Track: Default
Electron: 39.2.7
Chromium: 142.0.7444.235
Node.js: 22.21.1
V8: 14.2.231.21-electron.0
OS: Darwin arm64 25.2.0

For AI issues: which model did you use?

ALL/Auto sonnet we tried it all

For AI issues: add Request ID with privacy disabled

76bb3f1b-5be4-4e86-9da1-f0ffedd2fbe5

Does this stop you from using Cursor

Yes - Cursor is unusable

Hey, thanks for the detailed report. I see the issue. The logs show state.vscdb has grown to 96 GB, which causes SQLITE_MISUSE errors and a 2-minute freeze on exit.

Workaround for the freeze:

  1. Fully close Cursor (force quit if needed)
  2. Delete the database file (make a backup first):
    rm ~/Library/Application\ Support/Cursor/User/globalStorage/state.vscdb*
    
  3. Restart Cursor. The database will be recreated

This should fix the freeze on exit. The DB shouldn’t be 96 GB. Something is going wrong with the aiCodeTrackingLines key and analytics.

About the thinking loop:

Can you share exact steps to reproduce? We need to understand:

  • What prompt triggers the loop
  • Context size (how many files in the project, are you using @-mentions)
  • Logs from when it happens (CMD + Shift + P > Developer: Toggle Developer Tools > Console tab)

Let me know if the DB deletion workaround helped.

1 Like

Thank you so much Dean for your reply I appreciate it it tried the steps above, saved several backup copies but unfortunately it didnt work spent the last 6+ hours debugging until now I redownloaded the previous Cursor version 2.3 and all issues disappeared I wasnt able to open the workspace with all the chat history but a new one is working for now while I try to recover the previous workspace. The thinking loop is gone too.

1 Like

Glad the downgrade to 2.3 helped fix both issues.

About restoring the workspace with chat history, try this:

  1. Fully close Cursor 2.3
  2. Find the backups you made (Cursor_backup or other copies of ~/Library/Application Support/Cursor)
  3. From the backup, copy only the history folders:
    ~/Library/Application Support/Cursor/User/workspaceStorage/
    
  4. Launch 2.3 again

Let me know if you’re able to restore the workspace.

Hi Dean, sadly I wasnt able to restore the workspace I backed up, it remained in loading status for hours.

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