From f152e1916834c59910fdbb7f5a8b1d9229ab4979 Mon Sep 17 00:00:00 2001 From: Rebecca Sliter <571084+rsliter@users.noreply.github.com> Date: Tue, 18 Aug 2026 13:11:19 -0700 Subject: [PATCH 1/4] refactor(inference): centralize vLLM SSH policy --- scripts/prepare-dual-dgx-station.mts | 79 ++++--------------- .../serving/managed-cluster-ssh-binding.ts | 4 +- .../serving/vllm-ssh-transport-policy.test.ts | 66 ++++++++++++++++ .../serving/vllm-ssh-transport-policy.ts | 60 ++++++++++++++ .../vllm-station-ssh-binding.test.ts | 6 +- src/lib/inference/vllm-station-ssh-binding.ts | 62 +-------------- test/install-station-pair-preparation.test.ts | 39 +++++---- 7 files changed, 174 insertions(+), 142 deletions(-) create mode 100644 src/lib/inference/serving/vllm-ssh-transport-policy.test.ts create mode 100644 src/lib/inference/serving/vllm-ssh-transport-policy.ts diff --git a/scripts/prepare-dual-dgx-station.mts b/scripts/prepare-dual-dgx-station.mts index 4d5f888b544..b101fc76e8d 100755 --- a/scripts/prepare-dual-dgx-station.mts +++ b/scripts/prepare-dual-dgx-station.mts @@ -15,6 +15,7 @@ import { stationKnownHostsDigest, writeDualStationSshBinding, } from "../src/lib/inference/vllm-station-ssh-binding.ts"; +import { strictVllmSshTransportArgs } from "../src/lib/inference/serving/vllm-ssh-transport-policy.ts"; import { type DualStationPreparationDeps, type DualStationResumeState, @@ -378,64 +379,6 @@ function runStreamingCommand( return result.status ?? 1; } -export function strictStationPrepSshTransportArgs(): string[] { - return [ - "-T", - "-o", - "BatchMode=yes", - "-o", - "StrictHostKeyChecking=yes", - "-o", - "VerifyHostKeyDNS=no", - "-o", - "NoHostAuthenticationForLocalhost=no", - "-o", - "NumberOfPasswordPrompts=0", - "-o", - "PasswordAuthentication=no", - "-o", - "KbdInteractiveAuthentication=no", - "-o", - "PreferredAuthentications=publickey", - "-o", - "ConnectTimeout=5", - "-o", - "ConnectionAttempts=1", - "-o", - "ServerAliveInterval=5", - "-o", - "ServerAliveCountMax=1", - "-o", - "ClearAllForwardings=yes", - "-o", - "ForwardAgent=no", - "-o", - "ForwardX11=no", - "-o", - "ForwardX11Trusted=no", - "-o", - "Tunnel=no", - "-o", - "UpdateHostKeys=no", - "-o", - "ControlMaster=no", - "-o", - "ControlPath=none", - "-o", - "PermitLocalCommand=no", - "-o", - "RemoteCommand=none", - "-o", - "ProxyCommand=none", - "-o", - "ProxyJump=none", - "-o", - "KnownHostsCommand=none", - "-o", - "LogLevel=ERROR", - ]; -} - function parseSshConfig(stdout: string): SshConfig { const values = new Map(); for (const rawLine of stdout.split(/\r?\n/)) { @@ -569,7 +512,7 @@ export function inspectPretrustedSshTarget(target: string): PretrustedSshTarget validateStationPeerTarget(target); const configResult = runCommand( "ssh", - ["-G", ...strictStationPrepSshTransportArgs(), "--", target], + ["-G", ...strictVllmSshTransportArgs(), "--", target], "", ); if (!commandSucceeded(configResult, true)) return null; @@ -936,13 +879,13 @@ function assertHelperFile(helperPath: string): Buffer { } } -function sshArgs( +export function stationPrepSshArgs( binding: PretrustedSshTarget, pinnedKnownHostsPath: string, remoteCommand: string, ): string[] { return [ - ...strictStationPrepSshTransportArgs(), + ...strictVllmSshTransportArgs(), "-o", `UserKnownHostsFile=${pinnedKnownHostsPath}`, "-o", @@ -997,7 +940,7 @@ function createRuntimeDeps(options: CliOptions): { parseHostResult( runCommand( "ssh", - sshArgs(binding, pinnedKnownHosts(binding), "python3 -"), + stationPrepSshArgs(binding, pinnedKnownHosts(binding), "python3 -"), STATION_DISCOVERY_PROBE, ), "Peer Station identity probe", @@ -1014,7 +957,11 @@ function createRuntimeDeps(options: CliOptions): { return connectivityMatches( runCommand( "ssh", - sshArgs(binding, pinnedKnownHosts(binding), ["python3", "-", ...args].join(" ")), + stationPrepSshArgs( + binding, + pinnedKnownHosts(binding), + ["python3", "-", ...args].join(" "), + ), CONNECTIVITY_PROBE, ), requests, @@ -1023,7 +970,11 @@ function createRuntimeDeps(options: CliOptions): { runRemoteHelper: (binding, mode) => { return runStreamingCommand( "ssh", - sshArgs(binding, pinnedKnownHosts(binding), buildRemoteHelperCommand(helperSha256, mode)), + stationPrepSshArgs( + binding, + pinnedKnownHosts(binding), + buildRemoteHelperCommand(helperSha256, mode), + ), helperBytes.toString("utf8"), ); }, diff --git a/src/lib/inference/serving/managed-cluster-ssh-binding.ts b/src/lib/inference/serving/managed-cluster-ssh-binding.ts index e0e143008ea..779a1621856 100644 --- a/src/lib/inference/serving/managed-cluster-ssh-binding.ts +++ b/src/lib/inference/serving/managed-cluster-ssh-binding.ts @@ -6,6 +6,9 @@ export type { QualifiedStationSshIdentity as QualifiedManagedVllmSshIdentity, WriteDualStationSshBindingOptions as WriteManagedVllmSshBindingOptions, } from "../vllm-station-ssh-binding.js"; +export { + strictVllmSshTransportArgs as strictManagedVllmSshTransportArgs, +} from "./vllm-ssh-transport-policy.js"; /** * Cardinality-neutral names for the pinned SSH transport shared by managed * vLLM clusters. The legacy Station implementation remains the compatibility @@ -23,6 +26,5 @@ export { loadDualStationSshBindingForStatePath as loadManagedVllmSshBindingForStatePath, loadDualStationSshBindingHandoff as loadManagedVllmSshBindingHandoff, stationKnownHostsDigest as managedVllmKnownHostsDigest, - strictStationSshTransportArgs as strictManagedVllmSshTransportArgs, writeDualStationSshBinding as writeManagedVllmSshBinding, } from "../vllm-station-ssh-binding.js"; diff --git a/src/lib/inference/serving/vllm-ssh-transport-policy.test.ts b/src/lib/inference/serving/vllm-ssh-transport-policy.test.ts new file mode 100644 index 00000000000..8b72dda7ce1 --- /dev/null +++ b/src/lib/inference/serving/vllm-ssh-transport-policy.test.ts @@ -0,0 +1,66 @@ +// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// SPDX-License-Identifier: Apache-2.0 + +import { describe, expect, it } from "vitest"; + +import { strictVllmSshTransportArgs } from "./vllm-ssh-transport-policy"; + +describe("strict vLLM SSH transport policy", () => { + it("returns the exact noninteractive transport boundary (#9519)", () => { + expect(strictVllmSshTransportArgs()).toEqual([ + "-T", + "-o", + "BatchMode=yes", + "-o", + "StrictHostKeyChecking=yes", + "-o", + "VerifyHostKeyDNS=no", + "-o", + "NoHostAuthenticationForLocalhost=no", + "-o", + "NumberOfPasswordPrompts=0", + "-o", + "PasswordAuthentication=no", + "-o", + "KbdInteractiveAuthentication=no", + "-o", + "PreferredAuthentications=publickey", + "-o", + "ConnectTimeout=5", + "-o", + "ConnectionAttempts=1", + "-o", + "ServerAliveInterval=5", + "-o", + "ServerAliveCountMax=1", + "-o", + "ClearAllForwardings=yes", + "-o", + "ForwardAgent=no", + "-o", + "ForwardX11=no", + "-o", + "ForwardX11Trusted=no", + "-o", + "Tunnel=no", + "-o", + "UpdateHostKeys=no", + "-o", + "ControlMaster=no", + "-o", + "ControlPath=none", + "-o", + "PermitLocalCommand=no", + "-o", + "RemoteCommand=none", + "-o", + "ProxyCommand=none", + "-o", + "ProxyJump=none", + "-o", + "KnownHostsCommand=none", + "-o", + "LogLevel=ERROR", + ]); + }); +}); diff --git a/src/lib/inference/serving/vllm-ssh-transport-policy.ts b/src/lib/inference/serving/vllm-ssh-transport-policy.ts new file mode 100644 index 00000000000..59ca7bacdbd --- /dev/null +++ b/src/lib/inference/serving/vllm-ssh-transport-policy.ts @@ -0,0 +1,60 @@ +// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// SPDX-License-Identifier: Apache-2.0 + +export function strictVllmSshTransportArgs(): string[] { + return [ + "-T", + "-o", + "BatchMode=yes", + "-o", + "StrictHostKeyChecking=yes", + "-o", + "VerifyHostKeyDNS=no", + "-o", + "NoHostAuthenticationForLocalhost=no", + "-o", + "NumberOfPasswordPrompts=0", + "-o", + "PasswordAuthentication=no", + "-o", + "KbdInteractiveAuthentication=no", + "-o", + "PreferredAuthentications=publickey", + "-o", + "ConnectTimeout=5", + "-o", + "ConnectionAttempts=1", + "-o", + "ServerAliveInterval=5", + "-o", + "ServerAliveCountMax=1", + "-o", + "ClearAllForwardings=yes", + "-o", + "ForwardAgent=no", + "-o", + "ForwardX11=no", + "-o", + "ForwardX11Trusted=no", + "-o", + "Tunnel=no", + "-o", + "UpdateHostKeys=no", + "-o", + "ControlMaster=no", + "-o", + "ControlPath=none", + "-o", + "PermitLocalCommand=no", + "-o", + "RemoteCommand=none", + "-o", + "ProxyCommand=none", + "-o", + "ProxyJump=none", + "-o", + "KnownHostsCommand=none", + "-o", + "LogLevel=ERROR", + ]; +} diff --git a/src/lib/inference/vllm-station-ssh-binding.test.ts b/src/lib/inference/vllm-station-ssh-binding.test.ts index 5d548b7da94..b4e36773ad8 100644 --- a/src/lib/inference/vllm-station-ssh-binding.test.ts +++ b/src/lib/inference/vllm-station-ssh-binding.test.ts @@ -21,9 +21,9 @@ import { loadDualStationSshBindingHandoff, type QualifiedStationSshIdentity, stationKnownHostsDigest, - strictStationSshTransportArgs, writeDualStationSshBinding, } from "./vllm-station-ssh-binding"; +import { strictVllmSshTransportArgs } from "./serving/vllm-ssh-transport-policy"; const PEER_TARGET = "station@10.10.0.2"; const PEER_HOST = "10.10.0.2"; @@ -162,8 +162,8 @@ exit "${"${NEMOCLAW_TEST_DOCKER_EXIT:-0}"}" const binding = writeBinding(); const args = dualStationPinnedSshArgs(binding); - expect(args.slice(0, strictStationSshTransportArgs().length)).toEqual( - strictStationSshTransportArgs(), + expect(args.slice(0, strictVllmSshTransportArgs().length)).toEqual( + strictVllmSshTransportArgs(), ); expect(args).toEqual( expect.arrayContaining([ diff --git a/src/lib/inference/vllm-station-ssh-binding.ts b/src/lib/inference/vllm-station-ssh-binding.ts index 8b98c8abb62..196ef6ba9df 100644 --- a/src/lib/inference/vllm-station-ssh-binding.ts +++ b/src/lib/inference/vllm-station-ssh-binding.ts @@ -6,6 +6,8 @@ import fs from "node:fs"; import net from "node:net"; import path from "node:path"; +import { strictVllmSshTransportArgs } from "./serving/vllm-ssh-transport-policy.ts"; + export const NEMOCLAW_DGX_STATION_SSH_BINDING_ENV = "NEMOCLAW_DGX_STATION_SSH_BINDING"; const BINDING_SCHEMA_VERSION = 2; @@ -287,64 +289,6 @@ function shellQuote(value: string): string { return `'${value.replaceAll("'", `'"'"'`)}'`; } -export function strictStationSshTransportArgs(): string[] { - return [ - "-T", - "-o", - "BatchMode=yes", - "-o", - "StrictHostKeyChecking=yes", - "-o", - "VerifyHostKeyDNS=no", - "-o", - "NoHostAuthenticationForLocalhost=no", - "-o", - "NumberOfPasswordPrompts=0", - "-o", - "PasswordAuthentication=no", - "-o", - "KbdInteractiveAuthentication=no", - "-o", - "PreferredAuthentications=publickey", - "-o", - "ConnectTimeout=5", - "-o", - "ConnectionAttempts=1", - "-o", - "ServerAliveInterval=5", - "-o", - "ServerAliveCountMax=1", - "-o", - "ClearAllForwardings=yes", - "-o", - "ForwardAgent=no", - "-o", - "ForwardX11=no", - "-o", - "ForwardX11Trusted=no", - "-o", - "Tunnel=no", - "-o", - "UpdateHostKeys=no", - "-o", - "ControlMaster=no", - "-o", - "ControlPath=none", - "-o", - "PermitLocalCommand=no", - "-o", - "RemoteCommand=none", - "-o", - "ProxyCommand=none", - "-o", - "ProxyJump=none", - "-o", - "KnownHostsCommand=none", - "-o", - "LogLevel=ERROR", - ]; -} - type PinnedStationEndpoint = Pick< DualStationSshBinding, "knownHostsFile" | "lookupHost" | "port" | "resolvedHost" | "sshUser" @@ -352,7 +296,7 @@ type PinnedStationEndpoint = Pick< function pinnedOptionArgs(binding: PinnedStationEndpoint): string[] { return [ - ...strictStationSshTransportArgs(), + ...strictVllmSshTransportArgs(), "-o", `UserKnownHostsFile=${binding.knownHostsFile}`, "-o", diff --git a/test/install-station-pair-preparation.test.ts b/test/install-station-pair-preparation.test.ts index 24d888fe94d..6df938508a7 100644 --- a/test/install-station-pair-preparation.test.ts +++ b/test/install-station-pair-preparation.test.ts @@ -24,14 +24,12 @@ import { clearDualStationResumeState, inspectPretrustedSshTarget, readDualStationResumeState, - strictStationPrepSshTransportArgs, + stationPrepSshArgs, writeDualStationResumeState, } from "../scripts/prepare-dual-dgx-station.mts"; import { DUAL_STATION_VLLM_LAUNCH_SCHEMA } from "../src/lib/inference/vllm-station-cluster-lifecycle.ts"; -import { - stationKnownHostsDigest, - strictStationSshTransportArgs, -} from "../src/lib/inference/vllm-station-ssh-binding.ts"; +import { stationKnownHostsDigest } from "../src/lib/inference/vllm-station-ssh-binding.ts"; +import { strictVllmSshTransportArgs } from "../src/lib/inference/serving/vllm-ssh-transport-policy.ts"; import { runInstallerSourcedBody } from "./helpers/installer-run-fixture"; import { TEST_SYSTEM_PATH } from "./helpers/installer-sourced-env"; @@ -794,16 +792,27 @@ describe.sequential("dual-DGX Station trust and resume-state boundaries", () => } }); - it("uses a strict noninteractive SSH argument boundary and exact-byte helper command", () => { - const args = strictStationPrepSshTransportArgs(); - expect(args).toEqual(strictStationSshTransportArgs()); - expect(args).toContain("BatchMode=yes"); - expect(args).toContain("StrictHostKeyChecking=yes"); - expect(args).toContain("VerifyHostKeyDNS=no"); - expect(args).toContain("NoHostAuthenticationForLocalhost=no"); - expect(args).toContain("ClearAllForwardings=yes"); - expect(args).toContain("ProxyCommand=none"); - expect(args).toContain("ProxyJump=none"); + it("pins the Station preparation endpoint after the strict SSH policy (#9519)", () => { + const args = stationPrepSshArgs( + sshBinding(), + "/tmp/nemoclaw-known-hosts", + "python3 -", + ); + expect(args).toEqual([ + ...strictVllmSshTransportArgs(), + "-o", + "UserKnownHostsFile=/tmp/nemoclaw-known-hosts", + "-o", + "GlobalKnownHostsFile=/dev/null", + "-o", + "HostKeyAlias=10.10.0.2", + "--", + "10.10.0.2", + "python3 -", + ]); + }); + + it("builds the exact-byte noninteractive helper command", () => { const command = buildRemoteHelperCommand(HELPER_SHA256, "--apply"); expect(command).toContain(HELPER_SHA256); expect(command).toContain("sudo -n true"); From 666ec8afa188b613dd17302cd4e6d4be75d55648 Mon Sep 17 00:00:00 2001 From: Rebecca Sliter <571084+rsliter@users.noreply.github.com> Date: Tue, 18 Aug 2026 13:33:42 -0700 Subject: [PATCH 2/4] chore(inference): format vLLM SSH policy consumers Signed-off-by: Rebecca Sliter <571084+rsliter@users.noreply.github.com> --- scripts/prepare-dual-dgx-station.mts | 6 +----- .../serving/managed-cluster-ssh-binding.ts | 4 +--- test/install-station-pair-preparation.test.ts | 14 +++----------- 3 files changed, 5 insertions(+), 19 deletions(-) diff --git a/scripts/prepare-dual-dgx-station.mts b/scripts/prepare-dual-dgx-station.mts index b101fc76e8d..a34921c14c8 100755 --- a/scripts/prepare-dual-dgx-station.mts +++ b/scripts/prepare-dual-dgx-station.mts @@ -510,11 +510,7 @@ function knownHostEvidence( export function inspectPretrustedSshTarget(target: string): PretrustedSshTarget | null { validateStationPeerTarget(target); - const configResult = runCommand( - "ssh", - ["-G", ...strictVllmSshTransportArgs(), "--", target], - "", - ); + const configResult = runCommand("ssh", ["-G", ...strictVllmSshTransportArgs(), "--", target], ""); if (!commandSucceeded(configResult, true)) return null; const config = parseSshConfig(configResult.stdout); assertStrictSshConfig(config); diff --git a/src/lib/inference/serving/managed-cluster-ssh-binding.ts b/src/lib/inference/serving/managed-cluster-ssh-binding.ts index 779a1621856..e6eb080b4cf 100644 --- a/src/lib/inference/serving/managed-cluster-ssh-binding.ts +++ b/src/lib/inference/serving/managed-cluster-ssh-binding.ts @@ -6,9 +6,7 @@ export type { QualifiedStationSshIdentity as QualifiedManagedVllmSshIdentity, WriteDualStationSshBindingOptions as WriteManagedVllmSshBindingOptions, } from "../vllm-station-ssh-binding.js"; -export { - strictVllmSshTransportArgs as strictManagedVllmSshTransportArgs, -} from "./vllm-ssh-transport-policy.js"; +export { strictVllmSshTransportArgs as strictManagedVllmSshTransportArgs } from "./vllm-ssh-transport-policy.js"; /** * Cardinality-neutral names for the pinned SSH transport shared by managed * vLLM clusters. The legacy Station implementation remains the compatibility diff --git a/test/install-station-pair-preparation.test.ts b/test/install-station-pair-preparation.test.ts index 6df938508a7..a7351f75fe1 100644 --- a/test/install-station-pair-preparation.test.ts +++ b/test/install-station-pair-preparation.test.ts @@ -793,11 +793,7 @@ describe.sequential("dual-DGX Station trust and resume-state boundaries", () => }); it("pins the Station preparation endpoint after the strict SSH policy (#9519)", () => { - const args = stationPrepSshArgs( - sshBinding(), - "/tmp/nemoclaw-known-hosts", - "python3 -", - ); + const args = stationPrepSshArgs(sshBinding(), "/tmp/nemoclaw-known-hosts", "python3 -"); expect(args).toEqual([ ...strictVllmSshTransportArgs(), "-o", @@ -956,9 +952,7 @@ fi } }); - it.each( - ["ssh-keyscan", "arp-scan", "avahi-browse", "dns-sd", "lldpctl", "nmap", "mdns-scan"], - )( + it.each(["ssh-keyscan", "arp-scan", "avahi-browse", "dns-sd", "lldpctl", "nmap", "mdns-scan"])( "uses only deterministic rail candidates without trust enrollment or network discovery [%s]", (command) => { const root = fs.mkdtempSync(path.join(os.tmpdir(), "nemoclaw-pair-command-boundary-")); @@ -1019,9 +1013,7 @@ fi }, ); - it.each( - ["ssh-keyscan", "arp-scan", "avahi-browse", "dns-sd", "lldpctl", "nmap", "mdns-scan"], - )( + it.each(["ssh-keyscan", "arp-scan", "avahi-browse", "dns-sd", "lldpctl", "nmap", "mdns-scan"])( "keeps forbidden discovery and trust enrollment unreachable through pair qualification [%s]", (command) => { const root = fs.mkdtempSync(path.join(os.tmpdir(), "nemoclaw-pair-ready-boundary-")); From 34d6cfb9ba3147c93054004cca2f228be8d7083c Mon Sep 17 00:00:00 2001 From: Prekshi Vyas Date: Tue, 18 Aug 2026 13:48:22 -0700 Subject: [PATCH 3/4] test: align Dockerfile plan fixture with current schema Signed-off-by: Prekshi Vyas --- src/lib/onboard/dockerfile-patch.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/onboard/dockerfile-patch.test.ts b/src/lib/onboard/dockerfile-patch.test.ts index 70d4adc54e5..be800de6caf 100644 --- a/src/lib/onboard/dockerfile-patch.test.ts +++ b/src/lib/onboard/dockerfile-patch.test.ts @@ -707,7 +707,7 @@ describe("dockerfile patch helpers", () => { { channelId: "telegram", active: true }, ], agentRender: [ - { channelId: "discord", target: "openclaw.json", path: ["channels", "discord"] }, + { agent: "openclaw", channelId: "discord", target: "config", path: ["discord"] }, ], }); const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "nemoclaw-onboard-dockerfile-plan-")); From 3622be3d98265c3c1072c5940d7d443066629881 Mon Sep 17 00:00:00 2001 From: Prekshi Vyas Date: Tue, 18 Aug 2026 14:30:46 -0700 Subject: [PATCH 4/4] test: use supported OpenClaw render target Signed-off-by: Prekshi Vyas --- src/lib/onboard/dockerfile-patch.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/onboard/dockerfile-patch.test.ts b/src/lib/onboard/dockerfile-patch.test.ts index be800de6caf..339857ab616 100644 --- a/src/lib/onboard/dockerfile-patch.test.ts +++ b/src/lib/onboard/dockerfile-patch.test.ts @@ -707,7 +707,7 @@ describe("dockerfile patch helpers", () => { { channelId: "telegram", active: true }, ], agentRender: [ - { agent: "openclaw", channelId: "discord", target: "config", path: ["discord"] }, + { agent: "openclaw", channelId: "discord", target: "openclaw.json", path: ["discord"] }, ], }); const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "nemoclaw-onboard-dockerfile-plan-"));