fix(cursor): adds SIGKILL follow-up to the status-check spawn

Matches the nudge spawn's existing SIGTERM+SIGKILL pattern so an
unresponsive cursor-agent status check can't leak a lingering
process if it ignores SIGTERM.
This commit is contained in:
Will Gordon
2026-07-31 22:27:40 -04:00
committed by diegosouzapw
parent ab9785d853
commit cd71fe71f3

View File

@@ -83,7 +83,9 @@ export async function checkCursorAgentAvailability(): Promise<{
let result: { stdout: string; stderr: string };
try {
result = await runLockedCursorAgentSpawn("status", () =>
runCursorAgent(binary, ["status", "--format", "json"], CURSOR_AGENT_STATUS_TIMEOUT_MS)
runCursorAgent(binary, ["status", "--format", "json"], CURSOR_AGENT_STATUS_TIMEOUT_MS, {
sigkillFollowupMs: Math.max(1, Math.floor(CURSOR_AGENT_STATUS_TIMEOUT_MS / 2)),
})
);
} catch {
// Spawn itself failed (e.g. binary vanished between resolve and spawn) —