Repository navigation
Commit a387257
committed
fix: skip stdin read when positional message provided
`!process.stdin.isTTY` alone is too broad — it matches not just
"someone piped input in" but also "the parent process inherited
stdin from somewhere upstream and never closed its end." In the
second case, `Bun.stdin.text()` waits forever for an EOF that
never arrives. The process sits at 0% CPU with no session
created, no log activity, no error — a silent hang.
This surfaces in every subprocess invocation pattern that passes
a positional message and inherits stdin: Claude Code's Bash tool,
Python `subprocess.run(..., stdin=None)`, CI runners, plugin
hosts that don't pin stdin to `/dev/null`. Downstream callers
have been working around it with `stdio: "ignore"` on spawn
(see e.g. altimate-opencode-plugin
`plugins/altimate-code/index.ts:28`), but anything that forgets
to do that still hits the wedge.
Fix: only read stdin when no positional `message` was provided.
Matches conventional CLI semantics (positional overrides stdin)
and unblocks every subprocess caller. Pipe-only invocations
without a positional arg continue to work unchanged.
Closes #9341 parent 146acea commit a387257
1 file changed
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
430 | 430 | | |
431 | 431 | | |
432 | 432 | | |
433 | | - | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
434 | 443 | | |
435 | 444 | | |
436 | 445 | | |
| |||
0 commit comments