Repository navigation
Description
Symptom
Cursor provider threads (especially GPT-5.6 Sol High) keep showing the #314 watchdog banner: "No output from the cursor CLI for 10 min — the turn may be hung." Users Stop and retry. The queued follow-up sits behind the hung turn.
This is not a one-off. Live store forensics today: 11 Cursor stall events on 4 threads. Two current Sol High threads stalled 2x and 5x respectively this morning.
What the transcripts show
Two stall shapes, both Cursor-specific:
- After an assistant line, no next tool_call. The CLI stays alive until Stop.
sessionIdis never persisted (we only write it on exit 0), so retry cannot--resume. - During / between Task calls. Some of those later resume on their own after ~10–14 min (false hung). Others the user kills. Several Task/Shell cards stay OPEN forever next to a second card with the same
call_idmarked done.
checkStalls is doing what #314 asked: it is advisory and does not kill. The banner is correct that stdout is quiet. The CLI is often blocked before the next tool_call.started, so Solenta has nothing to stamp.
Root cause
Cursor -p suppresses thinking events, so long model think is already silent. On top of that, Solenta injects --plugin-dir for #686 (solenta-pin-task-parent). The hook script waits for stdin end before writing {permission:"allow"}.
Cursor hook docs: command hooks get JSON on stdin and must reply on stdout. Tests drive the hook with execFileSync({input}), which closes stdin. Live Cursor may write one JSON object and keep the pipe open. Then:
- hook never replies
- Cursor blocks in
preToolUse(matcherTask|Agent) - no
tool_call.startedis emitted - last visible event is the previous assistant / completed Task
- 10 min later the watchdog fires
That matches the after-assistant stalls (next tool never appears) and the stalls that later resume (platform hook timeout, fail-open).
Related Solenta bugs that make the same hang worse:
- Cursor
call_idiscall_…\nfc_…. We store the whole thing. Duplicatestartedevents overwritetoolMsgByIdand leave the first card OPEN. AskQuestionis treated as a normal tool. It completes with empty output (--force/ no TTY). The user never sees a question card. Not the 10-minute block itself, but the Screenify-shaped "I'll show you mockups" turn started from an unanswered question.
Fix
- Pin-task hook: reply as soon as one JSON object is parseable. Do not wait for EOF. Fail-open on a short timeout. Set
timeoutonhooks.json. - Persist
sessionIdfromsystem/init, not only on successful exit, so Stop+retry can--resume. - Normalize Cursor
call_idto the first line and ignore duplicatestartedevents.
Do not weaken checkStalls by treating leftover OPEN tools as liveness — those leftovers are the pairing bug.
Test plan
- Hook: write JSON to stdin and do not close the pipe; expect
{permission:"allow"}promptly. - Cursor run:
system/initstoressessionIdwhile status is stillworking; Stop keeps it. - Duplicate
tool_call.startedwith the same (newline)call_idproduces one done tool card, not an OPEN leftover.
Activity
currentbits commentedon Aug 24, 2026
Implemented on this branch. Live store had 11 Cursor stall events (4 threads); two Sol High threads stalled 2x and 5x this morning.
What landed:
hooks.jsontimeout 5s.sessionIdis written fromsystem/init, so Stop+retry can--resume.call_idis normalized to the first line; duplicatestartedevents do not leave an OPEN leftover card.Verified:
node --test electron/test/cursor-pin-task-parent.test.js electron/test/cursor-parse.test.js electron/test/cursor.test.js— 45 pass / 0 fail.Still open, not this PR: Cursor
AskQuestioncompletes with empty output under--forceand never becomes a question card. Separate from the 10-minute block.currentbits commentedon Sep 6, 2026
Shipped. electron/cursorPinTaskParent.js replies as soon as one JSON object parses, with a 2s fail-open; it no longer waits for stdin EOF. The file cites this issue in the comment at the hook.