Renderer crashes (code 5) during long agent sessions due to SQLite nested transaction bug

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Renderer crashes (code 5) during long agent sessions. Logs show repeating SQLITE_ERROR: cannot start a transaction within a transaction from AgentAnalyticsOperationsMainService immediately before each crash.

Steps to Reproduce

Run an extended agent session with multiple shell commands and file edits. Renderer becomes unresponsive then crashes. Happened 2-3 times in one session today.

Expected Behavior

Agent session should remain stable through long conversations with many tool calls.

Operating System

MacOS

Version Information

Version: 2.5.20, VSCode Version: 1.105.1, Commit: 511523af765daeb1fa69500ab0df5b6524424610, Date: 2026-02-19T20:41:31.942Z, Stable/Default

For AI issues: which model did you use?

Claude claude-4.6-opus (Agent mode)

Additional Information

[error] [AgentAnalyticsOperationsMainService] SQLITE_ERROR: cannot start a transaction within a transaction (×8)
[error] CodeWindow: detected unresponsive
[error] CodeWindow: renderer process gone (reason: crashed, code: 5)

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

2 Likes

it’s happened 3 more times. (and several yesterday)
this is further review for cursor, not sure if helpful

For the bug report, the key addition is: The main Cursor Electron process (PID 1378) sustains ~120% CPU for the entire session, not just during crashes. This likely causes the renderer to become unresponsive under any additional load (MCP calls, shell output, large file edits), leading to the code-5 crash. The ptyHost heartbeat failures before crash 3 suggest the main process is too busy to respond to keepalive pings.

Hey, thanks for the detailed report and the CPU load analysis. That’s really helpful.

This is a known issue. During long agent sessions, the renderer can crash. The SQLite nested transaction error from AgentAnalyticsOperationsMainService, together with the main process sitting around ~120% CPU, is a clear sign of what’s happening. The main process gets overloaded and stops responding, and then the renderer crashes.

Similar symptoms are described here: Keeps crashing while agent running in long session Keeps crashing while agent running in long session

For now, the best workaround is:

  • Fully restart Cursor every 1 to 2 hours during long agent sessions (fully quit and relaunch, not just Reload)
  • Start new chat threads from time to time instead of keeping one very long session

Let me know if it gets worse, or if you notice any other patterns.