diff --git a/bin/lib/onboard.js b/bin/lib/onboard.js index 060b5ba2120..688004bdd1f 100644 --- a/bin/lib/onboard.js +++ b/bin/lib/onboard.js @@ -221,7 +221,7 @@ function sleep(seconds) { function waitForSandboxReady(sandboxName, attempts = 10, delaySeconds = 2) { for (let i = 0; i < attempts; i += 1) { - const exists = runCapture(`openshell sandbox get "${sandboxName}" 2>/dev/null`, { ignoreError: true }); + const exists = runCapture(`openshell sandbox get ${shellQuote(sandboxName)} 2>/dev/null`, { ignoreError: true }); if (exists) return true; sleep(delaySeconds); } @@ -438,7 +438,7 @@ async function createSandbox(gpu) { } } // Destroy old sandbox - run(`openshell sandbox delete "${sandboxName}" 2>/dev/null || true`, { ignoreError: true }); + run(`openshell sandbox delete ${shellQuote(sandboxName)} 2>/dev/null || true`, { ignoreError: true }); registry.removeSandbox(sandboxName); } @@ -457,7 +457,7 @@ async function createSandbox(gpu) { const basePolicyPath = path.join(ROOT, "nemoclaw-blueprint", "policies", "openclaw-sandbox.yaml"); const createArgs = [ `--from "${buildCtx}/Dockerfile"`, - `--name "${sandboxName}"`, + `--name ${shellQuote(sandboxName)}`, `--policy "${basePolicyPath}"`, ]; // --gpu is intentionally omitted. See comment in startGateway(). @@ -507,7 +507,7 @@ async function createSandbox(gpu) { if (!ready) { // Clean up the orphaned sandbox so the next onboard retry with the same // name doesn't fail on "sandbox already exists". - const delResult = run(`openshell sandbox delete "${sandboxName}" 2>/dev/null || true`, { ignoreError: true }); + const delResult = run(`openshell sandbox delete ${shellQuote(sandboxName)} 2>/dev/null || true`, { ignoreError: true }); console.error(""); console.error(` Sandbox '${sandboxName}' was created but did not become ready within 60s.`); if (delResult.status === 0) { @@ -525,7 +525,7 @@ async function createSandbox(gpu) { // which would silently prevent the new sandbox's dashboard from being reachable. run(`openshell forward stop 18789 2>/dev/null || true`, { ignoreError: true }); // Forward dashboard port to the new sandbox - run(`openshell forward start --background 18789 "${sandboxName}"`, { ignoreError: true }); + run(`openshell forward start --background 18789 ${shellQuote(sandboxName)}`, { ignoreError: true }); // Register only after confirmed ready — prevents phantom entries registry.registerSandbox({ @@ -800,7 +800,7 @@ async function setupOpenclaw(sandboxName, model, provider) { onboardedAt: new Date().toISOString(), }; const script = buildSandboxConfigSyncScript(sandboxConfig); - run(`cat <<'EOF_NEMOCLAW_SYNC' | openshell sandbox connect "${sandboxName}" + run(`cat <<'EOF_NEMOCLAW_SYNC' | openshell sandbox connect ${shellQuote(sandboxName)} ${script} EOF_NEMOCLAW_SYNC`, { stdio: ["ignore", "ignore", "inherit"] }); }