Problem
Since PR #1244 (shipped in v3.2.4), killing an agent with Ctrl-C Ctrl-C no longer restarts it. The intended UX for double Ctrl-C is restart fresh — it's how users recover a wedged agent. Instead the session now ends cleanly and stays dead, requiring a manual respawn.
Root cause
PR #1244 (bugfix #1241) added exit classification so a deliberate quit (typing exit / /quit) stops auto-restarting the agent. The classifier is:
// shellper-protocol.ts:128
export function isDeliberateExit(exit) {
if (exit.code !== 0) return false;
return !exit.signal; // (null/undefined/''/'0')
}
The Claude CLI traps SIGINT and exits code 0 on a double Ctrl-C — indistinguishable, at the exit-status level, from a typed quit. So the double-Ctrl-C path is now classified deliberate → no restart. The #1241 test matrix covered typed quits and crash exits but not the double-Ctrl-C recovery gesture.
Expected behavior
Implementation hint (not prescriptive)
Exit status alone can't discriminate the two gestures. One candidate: the shellper/PTY layer sees the raw input stream — recent ^C (0x03) bytes in the input immediately preceding the exit could mark the exit as Ctrl-C-driven and therefore restartable. Another: check whether the Claude CLI distinguishes these cases in any observable way (exit code, stderr, tty state) before inventing input-sniffing. Verify against the real CLI, not assumptions.
Notes
Regression is live in published v3.2.4 — fix likely warrants a fast-follow patch release.
Problem
Since PR #1244 (shipped in v3.2.4), killing an agent with Ctrl-C Ctrl-C no longer restarts it. The intended UX for double Ctrl-C is restart fresh — it's how users recover a wedged agent. Instead the session now ends cleanly and stays dead, requiring a manual respawn.
Root cause
PR #1244 (bugfix #1241) added exit classification so a deliberate quit (typing
exit//quit) stops auto-restarting the agent. The classifier is:The Claude CLI traps SIGINT and exits code 0 on a double Ctrl-C — indistinguishable, at the exit-status level, from a typed quit. So the double-Ctrl-C path is now classified deliberate → no restart. The #1241 test matrix covered typed quits and crash exits but not the double-Ctrl-C recovery gesture.
Expected behavior
exit//quitin the agent → session ends cleanly, no restart (the shellper/launch loops: auto-restart should only trigger on unnatural exits — a deliberate quit should end cleanly #1241 fix — keep this).Implementation hint (not prescriptive)
Exit status alone can't discriminate the two gestures. One candidate: the shellper/PTY layer sees the raw input stream — recent
^C(0x03) bytes in the input immediately preceding the exit could mark the exit as Ctrl-C-driven and therefore restartable. Another: check whether the Claude CLI distinguishes these cases in any observable way (exit code, stderr, tty state) before inventing input-sniffing. Verify against the real CLI, not assumptions.Notes
Regression is live in published v3.2.4 — fix likely warrants a fast-follow patch release.