fix: follow active OpenShell gateway (#46)

Co-authored-by: mmckeen-nv <mmckeen-nv@users.noreply.github.com>
This commit is contained in:
mmckeen-nv
2026-09-08 23:11:14 -07:00
committed by GitHub
co-authored by mmckeen-nv
parent cbbdd1b4d2
commit 270eb109f1
17 changed files with 33 additions and 23 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ function parseRouteModel(output: string, label: "Gateway inference" | "System in
async function readOpenShellInferenceModel() {
const { stdout } = await execFileAsync(OPENSHELL_BIN, ["inference", "get"], {
env: hostCommandEnv({
OPENSHELL_GATEWAY: process.env.OPENSHELL_GATEWAY || "nemoclaw",
OPENSHELL_GATEWAY: process.env.OPENSHELL_GATEWAY?.trim() || undefined,
}),
timeout: 30000,
maxBuffer: 5 * 1024 * 1024,
+1 -1
View File
@@ -98,7 +98,7 @@ async function runNemoClaw(args: string[], timeout = 30000): Promise<NemoClawRun
try {
const { stdout, stderr } = await execFileAsync(invocation.file, invocation.args, {
env: hostCommandEnv({
OPENSHELL_GATEWAY: process.env.OPENSHELL_GATEWAY || "nemoclaw",
OPENSHELL_GATEWAY: process.env.OPENSHELL_GATEWAY?.trim() || undefined,
NO_COLOR: "1",
CLICOLOR: "0",
CLICOLOR_FORCE: "0",
+4 -1
View File
@@ -397,13 +397,16 @@ function resolveSandboxInstanceId(instanceId: string) {
}
function buildSandboxSshArgs(sandboxName: string, extraArgs: string[]) {
const gatewayOption = OPENSHELL_GATEWAY
? ` --gateway-name ${JSON.stringify(OPENSHELL_GATEWAY)}`
: ""
return [
"-o", "BatchMode=yes",
"-o", "StrictHostKeyChecking=no",
"-o", "UserKnownHostsFile=/dev/null",
"-o", "GlobalKnownHostsFile=/dev/null",
"-o", "LogLevel=ERROR",
"-o", `ProxyCommand=${OPENSHELL_BIN} ssh-proxy --gateway-name nemoclaw --name ${sandboxName}`,
"-o", `ProxyCommand=${OPENSHELL_BIN} ssh-proxy${gatewayOption} --name ${sandboxName}`,
`sandbox@openshell-${sandboxName}`,
...extraArgs,
]
+1 -1
View File
@@ -59,7 +59,7 @@ function runSandboxExec(sandboxName: string, script: string, input?: Buffer, tim
return new Promise<{ stdout: Buffer; stderr: string; code: number | null }>((resolve, reject) => {
const child = spawn(OPENSHELL_BIN, ["sandbox", "exec", "-n", sandboxName, "--", "sh", "-lc", script], {
env: hostCommandEnv({
OPENSHELL_GATEWAY: process.env.OPENSHELL_GATEWAY || "nemoclaw",
OPENSHELL_GATEWAY: process.env.OPENSHELL_GATEWAY?.trim() || undefined,
}),
stdio: ["pipe", "pipe", "pipe"],
})
+1 -1
View File
@@ -17,7 +17,7 @@ function runSandboxShell(sandboxName: string, script: string, input?: string, ti
return new Promise<{ stdout: string; stderr: string; code: number | null }>((resolve, reject) => {
const child = spawn(OPENSHELL_BIN, ["sandbox", "exec", "-n", sandboxName, "--", "sh", "-lc", script], {
env: hostCommandEnv({
OPENSHELL_GATEWAY: process.env.OPENSHELL_GATEWAY || "nemoclaw",
OPENSHELL_GATEWAY: process.env.OPENSHELL_GATEWAY?.trim() || undefined,
}),
stdio: ["pipe", "pipe", "pipe"],
})
+1 -1
View File
@@ -26,7 +26,7 @@ type BrokerNetworkAction = {
function runOpenShell(args: string[], timeout = 60000) {
return execFileAsync(OPENSHELL_BIN, args, {
env: hostCommandEnv({
OPENSHELL_GATEWAY: process.env.OPENSHELL_GATEWAY || "nemoclaw",
OPENSHELL_GATEWAY: process.env.OPENSHELL_GATEWAY?.trim() || undefined,
TERM: "dumb",
}),
timeout,
+1 -1
View File
@@ -9,7 +9,7 @@ function runSandboxShell(sandboxName: string, script: string, input?: Buffer | s
return new Promise<{ stdout: string; stderr: string; code: number | null }>((resolve, reject) => {
const child = spawn(OPENSHELL_BIN, ["sandbox", "exec", "-n", sandboxName, "--", "sh", "-lc", script], {
env: hostCommandEnv({
OPENSHELL_GATEWAY: process.env.OPENSHELL_GATEWAY || "nemoclaw",
OPENSHELL_GATEWAY: process.env.OPENSHELL_GATEWAY?.trim() || undefined,
}),
stdio: ["pipe", "pipe", "pipe"],
})