diff --git a/bin/nemoclaw.js b/bin/nemoclaw.js index ba21a2aa4..517f86081 100755 --- a/bin/nemoclaw.js +++ b/bin/nemoclaw.js @@ -776,16 +776,17 @@ async function deploy(instanceName) { ); } -async function start() { - const { defaultSandbox } = registry.listSandboxes(); - const safeName = - defaultSandbox && /^[a-zA-Z0-9._-]+$/.test(defaultSandbox) ? defaultSandbox : null; - const sandboxEnv = safeName ? `SANDBOX_NAME=${shellQuote(safeName)}` : ""; - run(`${sandboxEnv} bash "${SCRIPTS}/start-services.sh"`); +function registrySandboxArg(defaultSandbox = registry.listSandboxes().defaultSandbox) { + const safe = defaultSandbox && /^[a-zA-Z0-9._-]+$/.test(defaultSandbox) ? defaultSandbox : null; + return safe ? ` --sandbox ${shellQuote(safe)}` : ""; +} + +function start() { + run(`bash "${SCRIPTS}/start-services.sh"${registrySandboxArg()}`); } function stop() { - run(`bash "${SCRIPTS}/start-services.sh" --stop`); + run(`bash "${SCRIPTS}/start-services.sh" --stop${registrySandboxArg()}`); } function debug(args) { @@ -859,8 +860,8 @@ function showStatus() { console.log(""); } - // Show service status - run(`bash "${SCRIPTS}/start-services.sh" --status`); + // Show service status — pass --sandbox so PID lookup uses the correct directory + run(`bash "${SCRIPTS}/start-services.sh" --status${registrySandboxArg(defaultSandbox)}`); } async function listSandboxes() {