mirror of https://github.com/garrytan/gstack.git
Codex review on the prior commit flagged the pull-based Readable.toWeb approach: when the child writes more than the OS pipe buffer (~16-64 KB depending on platform) and the consumer awaits proc.exited before reading stdout, the buffer fills, the child blocks in write(), and exit never fires. browser-skill-commands.ts hits exactly this pattern when a spawned skill produces non-trivial output. Replace toWeb with eager-drain-then-replay: stdout and stderr are read into in-memory chunk arrays via 'data' events the moment the child starts, so pipes never back-pressure. proc.exited now resolves only after both exit and the drain have completed, so consumers reading stdout AFTER awaiting exit always see the full output. Consumers reading BEFORE awaiting exit still get the full output too — the replayed ReadableStream's start() awaits the drain before enqueueing. Adds a regression test that writes 1 MB to stdout — pre-fix this hangs forever, post-fix it returns in <500 ms. Removes the now-unused stream.Readable require. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| bin | ||
| scripts | ||
| src | ||
| test | ||
| PLAN-snapshot-dropdown-interactive.md | ||
| SKILL.md | ||
| SKILL.md.tmpl | ||