Files
codex/codex-rs/hooks
jif 885113aa1d Prevent command hooks from hanging on blocked stdin (#44288)
## Why

Writing hook input before draining output can deadlock when pipe buffers fill. Stdin writes also ran outside the hook timeout, allowing hooks that never read input to hang indefinitely.

## What changed

Write stdin concurrently with draining stdout and stderr, and apply the configured timeout to both input delivery and command completion. Preserve handling of broken pipes and distinct stdin and wait errors.

## Testing

Add a regression test that sends a large input to a hook that fills stdout and stderr without reading stdin. Verify that output drains and the hook reports its configured two-second timeout.

GitOrigin-RevId: 48cf33a2acfebbc5122a4522660d7a6b3fb1e9b0
2026-09-09 19:49:47 +00:00
..