Skip to content

Commit 706155b

Browse files
fix(server): SshDeviceHost checks SshCommandError with Schema.is
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 8b076ea commit 706155b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎apps/server/src/device/SshDeviceHost.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ const bootstrap = (
9090
),
9191
);
9292

93+
const isSshCommandError = Schema.is(SshCommandError);
94+
9395
// cmd expands only %OS% and PowerShell only $env:OS; POSIX shells expand neither to Windows_NT.
9496
const explainWindowsHost = Effect.fn("SshDeviceHost.explainWindowsHost")(function* (
9597
config: SshDeviceHostConfig,
@@ -98,7 +100,7 @@ const explainWindowsHost = Effect.fn("SshDeviceHost.explainWindowsHost")(functio
98100
const cause = error.cause;
99101
// Windows ssh.exe preserves full remote exit statuses such as 9009.
100102
if (
101-
!(cause instanceof SshCommandError) ||
103+
!isSshCommandError(cause) ||
102104
cause.exitCode === null ||
103105
cause.exitCode < 1 ||
104106
(cause.exitCode > 254 && cause.exitCode !== 9009)

0 commit comments

Comments
 (0)