fix: drain piped stderr in CLI installers and uploadFile to prevent deadlock (#1922)

PR #1920 fixed pipe buffer deadlock in runServerCapture and
waitForCloudInit but missed 6 other locations where Bun.spawn uses
"pipe" for stderr without draining it before await proc.exited.

When a child process writes >64KB to a piped stderr, the OS pipe
buffer fills, the child blocks on write(), and the parent blocks on
exited — classic deadlock.

Fix: change stderr from "pipe" to "inherit" in all 6 locations since
the stderr output is never read programmatically. This also lets
users see installation errors and SCP errors in real time.

Affected functions:
- fly.ts ensureFlyCli()
- sprite.ts ensureSpriteCli()
- gcp.ts ensureGcloudCli()
- hetzner.ts uploadFile()
- digitalocean.ts uploadFile()
- aws.ts uploadFile()

-- refactor/code-health

Agent: code-health

Co-authored-by: B <6723574+louisgv@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
A 2026-02-25 06:26:27 -08:00 committed by GitHub
parent b279cc7c8b
commit 2907ff6068
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 11 additions and 11 deletions

View file

@ -1,6 +1,6 @@
{
"name": "@openrouter/spawn",
"version": "0.10.10",
"version": "0.10.11",
"type": "module",
"bin": {
"spawn": "cli.js"

View file

@ -1091,8 +1091,8 @@ export async function uploadFile(localPath: string, remotePath: string): Promise
{
stdio: [
"ignore",
"ignore",
"pipe",
"inherit",
"inherit",
],
},
);

View file

@ -1053,8 +1053,8 @@ export async function uploadFile(localPath: string, remotePath: string, ip?: str
{
stdio: [
"ignore",
"ignore",
"pipe",
"inherit",
"inherit",
],
},
);

View file

@ -325,8 +325,8 @@ export async function ensureFlyCli(): Promise<void> {
{
stdio: [
"ignore",
"ignore",
"pipe",
"inherit",
"inherit",
],
},
);

View file

@ -352,7 +352,7 @@ export async function ensureGcloudCli(): Promise<void> {
stdio: [
"ignore",
"inherit",
"pipe",
"inherit",
],
},
);

View file

@ -619,8 +619,8 @@ export async function uploadFile(localPath: string, remotePath: string, ip?: str
{
stdio: [
"ignore",
"ignore",
"pipe",
"inherit",
"inherit",
],
},
);

View file

@ -153,7 +153,7 @@ export async function ensureSpriteCli(): Promise<void> {
stdio: [
"ignore",
"inherit",
"pipe",
"inherit",
],
},
);