ControlledExecDisposedError – MainThreadCursor disposed while stream active (after extension host crash)

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Cursor showed this error, and the extension host had just crashed (likely while using Remote-SSH).

Error:
ControlledExecDisposedError: MainThreadCursor disposed while stream 6a5aa3fb-296a-47b8-a71d-9b4020206ab0 was active
at llb.dispose (vscode-file://vscode-app/c:/Users/Asus/AppData/Local/Programs/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:43803:30342)
at nOa.disposeCustomers (vscode-file://vscode-app/…/workbench.desktop.main.js:46644:9828)
at Uid._onExtensionHostCrashed (vscode-file://vscode-app/…/workbench.desktop.main.js:49772:4041)

What happened:
Extension host crashed → during cleanup, MainThreadCursor was disposed while an active stream (stream ID above) was still running → this error was thrown.

Context:

OS: Windows 10 (build 26200)
Scenario: Using Cursor with Remote-SSH (remote host: scheduloid). After the error, SSH reconnected and forwarding worked again.
Request ID: (add from Chat: “…” → Copy Request ID, if the error was tied to a specific chat)
Cursor version: (add from Help → About or Cursor → About Cursor)
Expected:
Cleanup after an extension host crash should not dispose MainThreadCursor while a stream is still active, or streams should be terminated before disposal.

Steps to Reproduce

Use Cursor over Remote-SSH; at some point the extension host crashed and this error appeared in logs/console.

Expected Behavior

Cleanup after an extension host crash should not dispose MainThreadCursor while a stream is still active, or streams should be terminated before disposal.

Operating System

Windows 10/11

Version Information

Latest one, just updated

For AI issues: which model did you use?

ALL MODELS

For AI issues: add Request ID with privacy disabled

Request ID: a61fca6f-435c-40a1-9deb-466b4fb5f18f
MainThreadCursor disposed while stream 6a5aa3fb-296a-47b8-a71d-9b4020206ab0 was active
ControlledExecDisposedError: MainThreadCursor disposed while stream 6a5aa3fb-296a-47b8-a71d-9b4020206ab0 was active
at llb.dispose (vscode-file://vscode-app/c:/Users/Asus/AppData/Local/Programs/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:43803:30342)
at nOa.disposeCustomers (vscode-file://vscode-app/c:/Users/Asus/AppData/Local/Programs/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:46644:9828)
at Uid._onExtensionHostCrashed (vscode-file://vscode-app/c:/Users/Asus/AppData/Local/Programs/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:49772:4041)
at Uid._onExtensionHostCrashed (vscode-file://vscode-app/c:/Users/Asus/AppData/Local/Programs/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:49777:13092)
at Uid._onExtensionHostCrashOrExit (vscode-file://vscode-app/c:/Users/Asus/AppData/Local/Programs/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:49772:3787)
at j2n.value (vscode-file://vscode-app/c:/Users/Asus/AppData/Local/Programs/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:49772:745)
at Qe._deliver (vscode-file://vscode-app/c:/Users/Asus/AppData/Local/Programs/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:55:2962)
at Qe.fire (vscode-file://vscode-app/c:/Users/Asus/AppData/Local/Programs/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:55:3283)
at Nid._onExtHostConnectionLost (vscode-file://vscode-app/c:/Users/Asus/AppData/Local/Programs/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:49776:4162)
at j2n.value (vscode-file://vscode-app/c:/Users/Asus/AppData/Local/Programs/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:49776:3342)
at Qe.deliver (vscode-file://vscode-app/c:/Users/Asus/AppData/Local/Programs/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:55:2962)
at Qe.fire (vscode-file://vscode-app/c:/Users/Asus/AppData/Local/Programs/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:55:3283)
at VAn.fire (vscode-file://vscode-app/c:/Users/Asus/AppData/Local/Programs/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:43785:12180)
at fFy.acceptDisconnect (vscode-file://vscode-app/c:/Users/Asus/AppData/Local/Programs/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:43785:16633)
at WVu (vscode-file://vscode-app/c:/Users/Asus/AppData/Local/Programs/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:48060:47982)
at yt
.gotoPermanentFailure (vscode-file://vscode-app/c:/Users/Asus/AppData/Local/Programs/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:48060:47358)
at yt
.onReconnectionPermanentFailure (vscode-file://vscode-app/c:/Users/Asus/AppData/Local/Programs/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:48060:47233)
at yt
.runReconnectingLoop (vscode-file://vscode-app/c:/Users/Asus/AppData/Local/Programs/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:48060:44814)
at async yt
._beginReconnecting (vscode-file://vscode-app/c:/Users/Asus/AppData/Local/Programs/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:48060:42874)

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the detailed report and stack trace.

ControlledExecDisposedError isn’t really a separate bug. It’s a result of the SSH connection dropping. When Remote-SSH loses the connection, the extension host crashes, and during cleanup Cursor tries to dispose MainThreadCursor while the stream is still active. That’s where this error comes from. It’s expected cleanup behavior, not a standalone issue.

The root cause is an unstable SSH connection to the remote host. A few things that may help:

  • Check your SSH keep-alive settings. In ~/.ssh/config, add ServerAliveInterval 60 and ServerAliveCountMax 3 for the scheduloid host
  • If you’re using a VPN or an unstable network, that’s a common reason for disconnects
  • Make sure you’re using the Anysphere Remote SSH extension, not Microsoft Remote-SSH

Since Cursor recovers after reconnecting and this doesn’t block work, it’s mostly a cosmetic error in the logs. But we do know about agent session stability issues when SSH drops, and the team is aware.

If the extension host crashes often, not only when you clearly lose network, please share your exact Cursor version (Help > About) and the logs from Developer Tools (Help > Toggle Developer Tools > Console) from the moment it disconnects.