Repository navigation
Conversation
Start a bounded stdin-read phase in all four generated hook shims. Settle EOF, timeout, error, and early close once; release stdin handles on failure without forwarding input that has not reached EOF. Preserve post-EOF Socket timeouts and provider stdout, exit, and permission contracts. Add Windows Node subprocess tests covering no-EOF cases, provider responses, UTF-8 chunks, Socket outcomes, and generated shim syntax.
This branch has not been deployed
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.
What & why
Hook shims previously started their Socket timeout only after stdin reached EOF. If a provider kept stdin open, the shim had no deadline of its own and could wait indefinitely. This addresses #278 M4 by bounding the stdin-read phase in all generated shims while preserving post-EOF Socket timeouts and existing provider output, exit, and permission behavior. The
--statuspath retains its shorter timeout, and Antigravity still emits no stdout when an operation is allowed.Type of change
Evidence
Before
Running the new no-EOF regression test against the pre-change shims fails as expected. All nine cases reach the parent watchdog with
hard_timeout=trueandSIGKILL; the test reports 0 passed and 1 failed.After
The same no-EOF test passes. All nine cases exit with code 0 before the parent watchdog, report
hard_timeout=false, and do not forward input before EOF.The generated-shim syntax and provider-contract test also passes for Claude/Codex, Antigravity, Gemini, and Grok.
How I tested it
node --test --test-name-pattern 'stdin without EOF' .\test\hive-hook-stdin-deadline.test.cjsagainst the pre-change shims: 0 passed, 1 failed.node --test --test-name-pattern 'generated hook shims preserve provider output' .\test\hive-hook-stdin-deadline.test.cjs: 1 passed, 0 failed.node --test .\test\hive-hook-stdin-deadline.test.cjs: 6 passed, 0 failed, 0 skipped.npm run typecheck: passed.npm run build: passed.git diff --check: passed.Checklist
npm run typecheckpasses.npm run test:focusedpasses.npm run buildsucceeds.DESIGN.md/tokens.ts. Not applicable; this PR adds no UI.ATTRIBUTION.md. Not applicable; this PR adds no art.