From 5dff7efd54e062aaeaf08cb4b86698999b4c8dd6 Mon Sep 17 00:00:00 2001 From: latenighthackathon Date: Mon, 13 Apr 2026 15:31:42 -0500 Subject: [PATCH] fix(install): read sandbox name from onboard session instead of stale registry MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit resolve_default_sandbox_name() reads from sandboxes.json which may contain a stale defaultSandbox entry from a previous gateway. After re-onboarding (e.g. colima delete + reinstall), the completion message shows the old sandbox name instead of the one just created. Check the onboard session first — it always has the sandbox name from the current run. Fall back to the registry only when no session exists. Closes #1839 Signed-off-by: latenighthackathon --- scripts/install.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/scripts/install.sh b/scripts/install.sh index bb6332e6ae6..2fe280471c2 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -156,6 +156,23 @@ resolve_default_sandbox_name() { local registry_file="${HOME}/.nemoclaw/sandboxes.json" local sandbox_name="${NEMOCLAW_SANDBOX_NAME:-}" + # Prefer the sandbox name from the current onboard session — it reflects + # the sandbox just created, whereas sandboxes.json may hold a stale default + # from a previous gateway that no longer exists (#1839). + local session_file="${HOME}/.nemoclaw/onboard-session.json" + if [[ -z "$sandbox_name" && -f "$session_file" ]] && command_exists node; then + sandbox_name="$( + node -e ' + const fs = require("fs"); + try { + const data = JSON.parse(fs.readFileSync(process.argv[1], "utf8")); + const name = data.sandboxName || ""; + process.stdout.write(name); + } catch {} + ' "$session_file" 2>/dev/null || true + )" + fi + if [[ -z "$sandbox_name" && -f "$registry_file" ]] && command_exists node; then sandbox_name="$( node -e '