Skip to content

Commit 4993197

Browse files
committed
🤖 fix: add timeout to SSH background spawn to protect against connection hangs
1 parent c14210c commit 4993197

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

‎src/node/runtime/SSHRuntime.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,10 +376,11 @@ export class SSHRuntime implements Runtime {
376376
});
377377

378378
try {
379-
// No timeout - the spawn command backgrounds the process and returns immediately,
380-
// but if wrapped in `timeout`, it would wait for the backgrounded process to exit
379+
// The spawn command backgrounds the process and returns immediately with the PID.
380+
// Timeout protects against SSH connection hangs (network issues), not the spawned process.
381381
const result = await execBuffered(this, spawnCommand, {
382382
cwd: "/", // cwd doesn't matter, we cd in the wrapper
383+
timeout: 30, // Generous timeout for SSH connection + shell startup
383384
});
384385

385386
if (result.exitCode !== 0) {

0 commit comments

Comments
 (0)