fix(agent-hooks): cap Windows managed-hook stdin stalls at 2s host budget - #13560
fix(agent-hooks): cap Windows managed-hook stdin stalls at 2s host budget#13560brennanb2025 wants to merge 6 commits into
Conversation
Windows managed hooks block until stdin EOF on both more.com drain and curl payload@-; --max-time does not cover body assembly. Batch has no bounded reader without PowerShell startup cost, so lower the host timeout from 10s to 2s near the curl budget while keeping the #8419 more.com full-drain contract and missing-env exit path.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe change documents Windows stdin-draining and timeout behavior for managed hooks. It adds a two-second timeout for Windows Claude hooks and passes the optional timeout through managed-hook installation. Windows tests cover timeout values, environment handling, stdin draining, curl command construction, installed scripts, Devin handling, and temporary-resource cleanup. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
more.comand curlpayload@-can wait indefinitely for stdin EOF; curl--max-timedoes not cover that read.more.com) and the existing form-encoded curl body/token contract. This is a bounded mitigation, not a claim that the underlying batch read is now bounded.Why not replace the reader?
Real Windows probing found no lower-risk batch-only replacement:
curl -T -still exceeded 3 seconds with held-open stdin against a reachable endpoint.EOF, regressing [Bug]: Generated agent hook scripts exit without draining stdin → per-tool-call "failed to write hook stdin: Broken pipe (os error 32)" #8419.Keeping the established readers and narrowing the host backstop avoids routine 10–12 second Claude stalls without adding hundreds of milliseconds to every healthy hook or changing other providers.
Windows evidence
more.com, held-open stdinpayload@-, held-open stdinmore.com, closed stdinIndependent final-head probing also confirmed form success at 79–150 ms, unavailable-endpoint completion at 561–588 ms, exact UTF-8 body fidelity, no writer error for the retained form path, and writer
EOFfor the rejectedcurl -T -alternative.Tests
pnpm tcpassed.AI Review Report
dc6826665cwith an explicit Windows regression assertion.Security Audit
Screenshots
No visual change.
Closes #13285 · STA-3729