From 2bc894719b4c18bdd8f83c4b9b7f194c3c9fa4e2 Mon Sep 17 00:00:00 2001 From: Lakshya77089 Date: Thu, 18 Jun 2026 15:57:04 +0530 Subject: [PATCH] fix: guard final writeHookOutput against stdout EPIPE in ponytail-activate (#149) The final writeHookOutput('SessionStart', ...) call was the only operation in the file outside a try/catch. writeHookOutput ends in a bare process.stdout.write, so a closed stdout / broken pipe (EPIPE) at hook exit throws uncaught and crashes the hook with a non-zero exit code. Wrap it to match the file's existing never-block-session-start posture. --- hooks/ponytail-activate.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hooks/ponytail-activate.js b/hooks/ponytail-activate.js index 9610721..6bbeada 100644 --- a/hooks/ponytail-activate.js +++ b/hooks/ponytail-activate.js @@ -69,4 +69,8 @@ if (!isCodex) try { // Silent fail — don't block session start over statusline detection } -writeHookOutput('SessionStart', mode, output); +try { + writeHookOutput('SessionStart', mode, output); +} catch (e) { + // Silent fail — stdout closed/EPIPE at hook exit must not surface as a hook failure +}