fix: handle stdin error in ponytail-mode-tracker to avoid uncaught crash (#147)#150
Open
Lakshya77089 wants to merge 2 commits into
Open
fix: handle stdin error in ponytail-mode-tracker to avoid uncaught crash (#147)#150Lakshya77089 wants to merge 2 commits into
Lakshya77089 wants to merge 2 commits into
Conversation
The headline benchmark is single-shot completions; a Notes bullet generalized 'the cost gap widens further in ponytail's favor' to real sessions. Independent multi-turn Cursor-SDK A/B (DietrichGebert#121) shows that on large completion-forced tasks ponytail ON can raise tool calls and tokens (more reading before writing) while shrinking output — net cost either way; the win is clearest on snowball-prone/blocked tasks. Scope the single-shot claim and add a 'saves vs. costs' section, plus the skillCount-is-availability-not-usage clarification.
…ash (DietrichGebert#147) Register a process.stdin 'error' handler so an abnormal stdin close (broken pipe, parent crash) exits cleanly instead of throwing an uncaught exception. process.exit(0) preserves the hook contract: always exit 0, never block session start.
5d47ad2 to
1054075
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #147.
hooks/ponytail-mode-tracker.jsregisteredstdin.on('data')andstdin.on('end')but nostdin.on('error')handler. When stdin closes abnormally (broken pipe, parent crash), Node emits anerrorevent on the stream; with no listener this surfaces as an uncaught exception, crashing the hook with a non-zero exit code.Fix
Register an
errorhandler that callsprocess.exit(0)before thedata/endlisteners. This preserves the hook contract — always exit 0, never block session start.Notes
hooks/, so no other files need the same change.