fix: keep hook stdin-fallback timer ref'd so it fires on Windows by tanish19078 · Pull Request #812 · DietrichGebert/ponytail · GitHub
Skip to content

fix: keep hook stdin-fallback timer ref'd so it fires on Windows - #812

Open
tanish19078 wants to merge 1 commit into
DietrichGebert:mainfrom
tanish19078:fix-790-hook-fallback-unref
Open

fix: keep hook stdin-fallback timer ref'd so it fires on Windows#812
tanish19078 wants to merge 1 commit into
DietrichGebert:mainfrom
tanish19078:fix-790-hook-fallback-unref

Conversation

@tanish19078

Copy link
Copy Markdown

Fixes #790 (follow-up to #443; related open PR #806).

The 1s stdin-fallback timer in hooks/ponytail-mode-tracker.js was .unref()'d, so in exactly the stdin-swallow scenario it guards, the fallback cannot fire and the hook falls through to Claude Code's 5s hook watchdog instead of the intended ~1s worst case.

  • Removed .unref() on the fallback timer in ponytail-mode-tracker.js (and updated the stale comment claiming unref avoids latency).
  • Same fix in hooks/ponytail-subagent.js, which shares the identical fallback pattern.

Verification: node --test tests/*.test.js — 84/84 pass, including ponytail-mode-tracker self-exits when stdin never closes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UserPromptSubmit hook still hangs to full timeout on Windows — #443 fix's setTimeout is unref'd

1 participant