Bug Report: Recurrent Chat Panel Freezes with Tool Timeouts and Memory Leaks in Cursor 1.6.5, and all versions

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Bug Report: Recurrent Chat Panel Freezes with Tool Timeouts and Memory Leaks in Cursor 1.6.5

Date: September 12, 2025
Author: Guizmo
Environment: Windows (10/11, specify if possible), Cursor 1.6.5, C#,Python/Unity project with Poetry
Priority: Critical (makes workflow unusable, terminal essential)


Summary

Cursor 1.6.5’s chat panel consistently freezes when using multiple active panels, especially with workflows involving terminal commands (e.g., poetry run <project> validate compilation).
The freezes are caused by:

  • Tool timeouts (notably runTerminalCommandV2Params)
  • Memory leaks (175+ listeners detected)
  • Aborted AI streams (ConnectError: [canceled])

Temporary resets (clear chats, restart Cursor) only help for 5–30 minutes before the issue returns, making terminal-based development workflows impractical.
This bug affects all AI models (Gemini, Claude, GPT) and persists across updates.


Technical Context

  • Cursor Version: 1.6.5 (latest stable as of September 10, 2025)
  • OS: Windows (logs show paths like C:\Users\<user>\...)
  • Project: Anonymous Python CLI (Typer 0.17.4, Poetry) integrated with Unity, using pytest and async services
  • Workflow: Heavy use of terminal commands (poetry run <project> validate compilation) via chat panel Agent mode for code validation/editing
  • Setup: Multiple chat panels (1–2, sometimes detached across monitors), complex prompts mixing Python code + terminal execution
  • AI Models: All affected (Gemini 2.5 Pro, Claude 3.5 Sonnet, GPT-4o)
  • Dependencies: Poetry, pytest, Typer, no VPN/Zscaler detected

Problem Description

Symptoms

  • Panels freeze after 5–20 prompts, especially with terminal commands.
  • With 2+ panels (split or detached), freezes happen almost immediately.
  • Symptoms include:
    • Sudden AI stop (e.g., “Stopped Thinking” or truncated response).
    • No code/diff generation or terminal execution.
    • Developer Tools show repeated errors.

Temporary resets (clear chats, restart Cursor) restore function for 5–30 min, but freezes return faster with multiple panels.

Impact: Since the terminal is central to workflows (e.g., build validation via CLI), Cursor becomes unusable.


Reproduction Steps

  1. Open Cursor 1.6.5 on Windows.
  2. Load a Python project with Poetry (e.g., files like src/cli/commands/validate/cli.py).
  3. Open 2 chat panels (main + detached).
  4. In one panel, run:

Execute `poetry run <project> validate compilation` and validate code in src/cli/commands/validate/cli.py

  1. Repeat similar prompts (edit code + run terminal) 5–10 times.

Result: Panel freezes, AI stops, errors appear in logs.


Errors from Developer Tools

Example logs (Sept 12, 2025):


\[composer] No code block with diff found for URI: file:///c%3A/.../tests/conftest.py
\[composer] No code block with diff found for URI: file:///c%3A/.../src/cli/commands/validate/cli.py
\[ToolV2Service] Error executing tool 15 (runTerminalCommandV2Params): Object
\[ToolV2Service] ToolCallError details: Object
ERR Tool call errored or timed out: Error: Tool call errored or timed out
at AbortSignal.<anonymous> (...)
\[SUMMARIZATION-DEBUG] Stream processing ERROR: ConnectError: \[canceled]
\[017] potential listener LEAK detected, having 175 listeners already.
Error
at p8l.create (...)
at trn.\_event \[as onDidChangeGates] (...)


Error Analysis

  • Composer Errors: "No code block with diff found" → Composer fails to parse AI output or target files (cli.py, conftest.py), triggering retries and overload.
  • ToolV2Service Timeout: runTerminalCommandV2Params (e.g., Poetry commands) times out after ~5–30s, followed by an AbortSignal → AI stream blocked.
  • ConnectError: AI stream canceled due to tool timeout, cutting AI responses.
  • Listener Leak: 175+ listeners accumulate (linked to onDidChangeGates), causing memory leaks and unstable panels. Multi-panels worsen the issue.

Steps Already Tried (No Lasting Fix)

  • Clear All Chats: Temporary improvement (5–30 min).
  • Restart Cursor: Same temporary effect, shorter with multi-panels.
  • Clear Cache: Deleted %APPDATA%\Cursor\Cache and UserData → brief improvement.
  • Simpler Prompts: Fewer tool calls reduce frequency but don’t fix (terminal essential).
  • Incognito/Safe Mode: (cursor --disable-extensions, --incognito) → no difference.
  • API Keys/Quotas: Not related (all models affected).
  • Update: 1.6.5 is latest stable; no improvement from earlier 1.6.x.

Root Cause Hypothesis

A cascading error cycle:

  1. Tool call (runTerminalCommandV2Params) times out (e.g., heavy Poetry commands).
  2. Composer fails to parse diffs → retries triggered.
  3. AI stream aborted (ConnectError: [canceled]).
  4. Each cycle adds listeners (onDidChangeGates) → memory leak (175+).
  5. Multiple panels multiply listeners/queues → guaranteed freezes.

Aggravating Factors:

  • Multiple active panels → focus loss, extra queues.
  • Heavy project (C# + Python + Unity) → large file scans.
  • Windows → Electron socket/thread handling less robust than macOS.
  • Terminal-intensive workflow → Poetry commands exceed timeouts.

Why resets help temporarily: They clear queues/listeners, but accumulation resumes immediately.


Workflow Impact

Terminal usage is central to the workflow (e.g., CLI tests for Unity builds). Freezes:

  • Interrupt code editing/validation.
  • Make chat panels unusable after 5–20 prompts.
  • Force frequent resets → break productivity.
  • Affect all AI models → no workaround by switching providers.

Fix Suggestions for Cursor Team

Tool Timeouts

  • Increase default timeout for runTerminalCommandV2Params (currently ~5–30s).
  • Allow user-configurable timeout (e.g., Settings > Tools > Timeout).
  • Detect slow commands (Poetry) → run async with UI feedback (“Running…”).

Listener Management

  • Add aggressive GC for onDidChangeGates and other listeners.
  • Cap listener count (e.g., max 50) with auto-reset/alert when exceeded.

Multi-Panel Stability

  • Prioritize one active panel for AI streams (disable concurrent queues).
  • Fix focus loss in detached panels (esp. multi-monitor).

Composer Robustness

  • Handle "No code block with diff found" gracefully (avoid infinite retries).
  • Optimize URI/file scanning for large projects (e.g., restrict to open files).

Logs & Diagnostics

  • Provide clearer logs for aborts (reason for ConnectError).
  • Add UI to monitor listener/queue counts in real time.

Additional Information

  • VPN/Zscaler: None used.
  • Logs: Included above (Sept 12, 2025 extract).
  • Screenshots/Videos: Available on request (can record via OBS).
  • Frequency: Near 100% with multi-panels; ~50% with single panel after 10–20 prompts and sommetime less.
  • Workarounds Tried:
    • Disabling tools/composer → reduces frequency but unacceptable (terminal essential).
    • Clearing cache → only temporary.
    • Incognito/Safe mode → no durable effect.

Request to Cursor Team

  • Priority: Critical — makes Cursor unusable for terminal-heavy workflows (CLI/Unity dev).
  • Temporary Fix: Provide a hotfix/beta (e.g., 1.6.6) for timeouts/listener leaks.
  • Configuration Option: Allow increasing tool timeouts or limiting listener counts.
  • Follow-Up: Please confirm receipt and provide ETA for a patch.

:folded_hands: Thanks for your work on Cursor. This bug is a major blocker, but with these details I’m confident you can resolve it quickly.

Steps to Reproduce

Operating System

Windows 10/11

Current Cursor Version (Menu → About Cursor → Copy)

Version: 1.6.6 (user setup)
VSCode Version: 1.99.3
Commit: 9455eaa4c87f2bad91eda3f2bc9b42b16eae1080
Date: 2025-09-11T01:16:54.096Z
Electron: 34.5.8
Chromium: 132.0.6834.210
Node.js: 20.19.1
V8: 13.2.152.41-electron.0
OS: Windows_NT x64 10.0.26100

For AI issues: which model did you use?

api gemini-2.5-pro

Does this stop you from using Cursor

No - Cursor works, but with this issue