From 2b84cc066ba6253f15092e2915f128ddac0b562d Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Sat, 20 Jun 2026 16:39:06 -0700 Subject: [PATCH] Normalize SSH timeout targets Co-authored-by: codex --- packages/ssh/src/command.test.ts | 7 +++++-- packages/ssh/src/command.ts | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/ssh/src/command.test.ts b/packages/ssh/src/command.test.ts index fdc2fe6020..f87bc527d2 100644 --- a/packages/ssh/src/command.test.ts +++ b/packages/ssh/src/command.test.ts @@ -236,7 +236,7 @@ describe("ssh command", () => { Effect.result( runSshCommand( { - alias: "devbox", + alias: " ", hostname: "devbox.example.com", username: "julius", port: 2222, @@ -252,7 +252,10 @@ describe("ssh command", () => { assert.isTrue(Result.isFailure(result)); if (Result.isFailure(result)) { - assert.equal(result.failure.message, "SSH command timed out after 1ms for devbox."); + assert.equal( + result.failure.message, + "SSH command timed out after 1ms for devbox.example.com.", + ); } }).pipe(Effect.provide(processLayer)); }); diff --git a/packages/ssh/src/command.ts b/packages/ssh/src/command.ts index 2e5559ad28..8086b9e907 100644 --- a/packages/ssh/src/command.ts +++ b/packages/ssh/src/command.ts @@ -305,7 +305,7 @@ export const runSshCommand = Effect.fn("ssh/command.runSshCommand")(function* ( (input.preHostArgs?.length ?? 0) + 1 + (input.remoteCommandArgs?.length ?? 0), - target: target.alias || target.hostname, + target: target.alias.trim() || target.hostname.trim(), timeoutMs: input.timeoutMs ?? DEFAULT_SSH_COMMAND_TIMEOUT_MS, }); }),