Commit c0a1b43
authored
Fix subprocess.run() hanging on commands that read stdin (#281)
Commands like `cat > file.py` (without heredoc) block forever waiting
for stdin input when executed via `execute()`. This happens because
subprocess.run() inherits the parent's stdin by default, which in a
server context is a pipe that never sends data.
Adding stdin=subprocess.DEVNULL gives these commands an immediate EOF,
so they return instantly instead of hanging until the timeout kills them.
This is especially important for agent-based workflows where LLMs may
generate `cat > file` commands expecting interactive input that will
never come.1 parent 67be423 commit c0a1b43
1 file changed
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
429 | 429 | | |
430 | 430 | | |
431 | 431 | | |
| 432 | + | |
432 | 433 | | |
433 | 434 | | |
434 | 435 | | |
| |||
0 commit comments