Files
claude-mem/plugin
yczc3999 ddc25372c1 fix(linux): buffer stdin in Node.js before passing to Bun (#646) (#977)
On Linux, Bun's libuv calls fstat() on inherited pipe file descriptors
and crashes with EINVAL when the pipe originates from Claude Code's hook
system. This causes all PostToolUse hooks to fail silently, preventing
observations from being recorded.

The fix reads stdin entirely in the Node.js parent process (bun-runner.js)
before spawning Bun, then writes the buffered data to a fresh pipe created
by Node's child_process.spawn(). Bun receives a standard pipe that it can
fstat() without errors.

Changes:
- Add collectStdin() to buffer piped input in Node.js with 5s safety timeout
- Change stdio from 'inherit' to ['pipe'|'ignore', 'inherit', 'inherit']
- Write buffered stdin to child.stdin then close for proper EOF signaling
- Handle edge cases: TTY stdin, no stdin, read errors

Fixes #646

Co-authored-by: yczc3999 <zxfgds@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 00:30:42 -05:00
..
2026-02-06 02:40:14 -05:00
2026-02-04 19:58:02 -05:00
2026-02-16 00:17:34 -05:00