mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-05-14 08:30:36 +00:00
fix: add keepalive to fly ssh + stop suppressing install output (#1641)
Two fixes for "session forcibly closed" during openclaw install: 1. The openclaw install command piped all output to /dev/null, so flyctl saw zero bytes flowing and killed the session. Removed the >/dev/null 2>&1 redirect. 2. Added a background keepalive to runServer that prints a dot to stderr every 10s. This prevents flyctl from tearing down silent SSH sessions even if the command itself produces no output for a while. Co-authored-by: lab <6723574+louisgv@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
09d9f597ac
commit
a2dfddec3d
1 changed files with 6 additions and 1 deletions
|
|
@ -630,7 +630,12 @@ export async function runServer(
|
|||
const fullCmd = `export PATH="$HOME/.local/bin:$HOME/.bun/bin:$PATH" && ${cmd}`;
|
||||
const flyCmd = getCmd()!;
|
||||
|
||||
const escapedCmd = fullCmd.replace(/'/g, "'\\''");
|
||||
// Wrap command with a background keepalive that prints a dot to stderr every
|
||||
// 10s. Without this, flyctl tears down silent SSH sessions ("session forcibly
|
||||
// closed") when no data flows for too long (e.g. during bun install).
|
||||
const wrappedCmd = `(while true; do sleep 10; printf '.' >&2; done) & _ka=$!; (${fullCmd}); _rc=$?; kill $_ka 2>/dev/null; wait $_ka 2>/dev/null; exit $_rc`;
|
||||
|
||||
const escapedCmd = wrappedCmd.replace(/'/g, "'\\''");
|
||||
// Use fly ssh console (WireGuard) instead of fly machine exec (HTTP) to avoid
|
||||
// 408 deadline_exceeded on long-running commands.
|
||||
const args = [flyCmd, "ssh", "console", "-a", flyAppName, "-C", `bash -c '${escapedCmd}'`];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue