Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
On Cursor 3.20.21 with a WSL remote workspace, Agent requests can stall indefinitely on Taking longer than expected… and never reach the model.
Client traces show the hang is not network, Grok, or first-token latency. Every sibling context step finishes in 0–2 ms. The only span that never
completes is:
span_started name="gatherTerminalSelections"
# never span_completed
The stuck message stores a live terminal-instance pointer, not just copied text:
uri: vscode-terminal://1
range: lines 7–93
text: ~3609 chars of git status output
After a window reload or wsl --shutdown, the pty host renumbers terminals (old id …-4 → new id 1, later …-2 → new id undefined). The stored URI no
longer resolves. gatherTerminalSelections never times out, so the request is wedged forever.
Worse: the attachment is copied into later bubbles. Sending a new message in the same chat (“just reply OK”, no terminal selected) still hangs in the
same span. Reloading Cursor / shutting down WSL does not unbrick that chat.
A different chat in the same window, with no terminal attachment, recovered after Stop + Reload Window.
Note: This is following up on this discussion with @Colin here: Taking longer than expected in almost every Grok run - #30 by Colin
Steps to Reproduce
Open a WSL remote workspace (Ubuntu 24.04) in Cursor 3.20.21, Agent layout.
2. Open an integrated terminal, run a command with a lot of output (e.g. git status during a merge).
3. Select that terminal text so it attaches to the Agent input (terminal chip / vscode-terminal: URI).
4. Send a prompt.
5. Reload the window, or quit Cursor, run wsl --shutdown, reopen. Persistent terminals revive under new pty IDs.
6. Retry the same chat (or send any new message in that chat).
Expected Behavior
Context gathering should fail fast if the terminal URI is gone, then send the request using the already-stored text / rawText (or drop the
attachment).
• gatherTerminalSelections / buildIdeState should have a timeout and surface an error, not hang the Agent loop forever.
• A later message in the same chat should not inherit a dead terminal URI from history.
Screenshots / Screen Recordings
Operating System
Windows 10/11
Version Information
Version: 3.20.21 (user setup)
VS Code Extension API: 1.128.0
Commit: f09fca384ceca23f7bf21f9c23655b162641d740
Date: 2026-09-13T19:02:51.781Z
Layout: IDE
Build Type: Stable
Release Track: Default
Electron: 42.10.0
Chromium: 148.0.7778.280
Node.js: 24.18.1
V8: 14.8.178.38-electron.0
xterm.js: 6.1.0-beta.291
OS: Windows_NT x64 10.0.26200Version: 3.20.21 (user setup)
VS Code Extension API: 1.128.0
Commit: f09fca384ceca23f7bf21f9c23655b162641d740
Date: 2026-09-13T19:02:51.781Z
Layout: IDE
Build Type: Stable
Release Track: Default
Electron: 42.10.0
Chromium: 148.0.7778.280
Node.js: 24.18.1
V8: 14.8.178.38-electron.0
xterm.js: 6.1.0-beta.291
OS: Windows_NT x64 10.0.26200
For AI issues: which model did you use?
Auto: balance
For AI issues: add Request ID with privacy disabled
All stall in gatherTerminalSelections (same composer 45513b17-ca45-40ac-b401-2e97de461a93):
• e78b2165-77c3-480d-bc65-f39c281d2195
• 17f64942-9aca-429c-8d71-4fc011d9adf4
• 3dcd4a4b-ae82-41fc-ad0a-547d811770b9
• 9ede7ce2-f62f-4b4f-81d1-e7e10f0f54e1
• 1bcefbc2-b89c-4cd2-aea4-1f988d4970e1 (after full WSL shutdown + Cursor restart)
• f714ada1-250d-4a58-a5e6-aa36d1dcebc2 (fresh “just reply OK” in the same chat — still hung)
Related, different composer (74987073-…), no terminal attachment — hung in buildIdeState after a brief Remote Extension Host unresponsive event,
recovered after Stop + Reload Window:
• hung: 5e8a8884-37d4-42a2-bd29-2aef0e36be46
• recovered: 4f129285-7572-40a9-9e77-35eedd3df887 (same chat, after reload; reached networkPhase / rpc.run)
Additional Information
Cursor: 3.20.21 (f09fca384ceca23f7bf21f9c23655b162641d740), Windows client, unified Agent layout
• Remote: WSL Ubuntu 24.04 (wsl+Ubuntu-24.04)
• Model: not Grok. Earlier turns used DeepSeek V4 Pro; later Auto. Provider registration completed in ~1 ms. No HTTP/2 / 503 / transport errors.
• Logs:
• %APPDATA%\Cursor\logs\window1\output_*\cursor.requestTraces.log
• %APPDATA%\Cursor\logs\window1\renderer.log — Extension host (Remote) is unresponsive. around the second hang
• WSL ~/.cursor-server/data/logs//ptyhost.log — Revived process, old id … → new id 1 then Couldn’t get layout info… Could not find pty 2
on pty host
• Persisted state: two bubbles in that composer have context.terminalSelections pointing at vscode-terminal:/home-thibauld-fairmint-v2-api/1.
Composer-level terminalSelections is empty. The poison is in message history, which is why retries keep hanging.
• Workaround that does not work for the poisoned chat: Stop, reload, wsl --shutdown, new message in the same chat.
• Workaround that does work for an unrelated chat: Stop + Reload Window when there is no terminal attachment (the buildIdeState case).
• Workaround that should unbrick the poisoned chat: quit Cursor, strip terminalSelections from those bubbles in state.vscdb, reopen. Do not use
Restore Checkpoint / Revert Files if the workspace has real uncommitted work.
• Prevention: paste terminal output as plain text; do not attach a live terminal selection.
This looks like a missing timeout on buildComposerSelectedContext children. A dead vscode-terminal: URI or a dropped remote-ext-host RPC leaves the
Agent loop waiting forever, and the UI only shows “Taking longer than expected…”.
Happy to share the request-trace files / composer IDs privately.
Does this stop you from using Cursor
Sometimes - I can sometimes use Cursor


