Repository navigation
Closed
Labels
area: cliCommand line interface, flags, terminal UX, or outputarea: installInstall, setup, prerequisites, or uninstall flowarea: onboardingOnboarding FSM, provider setup, sandbox launch, or first-run flow
Description
Description
After a host reboot, users must manually run multiple commands to reconnect to their sandbox: start Docker, restart the OpenShell gateway, check sandbox state, then connect. This is documented in the troubleshooting guide but could be a single command.
A nemoclaw reconnect command would automate the recovery sequence:
- Verify the container runtime is running
- Start the OpenShell gateway if it's not running (
openshell gateway start --name nemoclaw) - Wait for the gateway to become healthy
- Check sandbox state (
openshell sandbox list) - Start port forward and connect to the default (or named) sandbox
Context
- Issue Please add restart commands to documentation #469 requested documentation for reconnecting after a reboot — addressed by the docs PR
- PR docs(troubleshooting): explain reconnect flow after host reboot #904 (by @WuKongAI-CMU) also attempted to document this but was closed due to PR limit
- The building blocks already exist in the codebase:
sandboxConnect()inbin/nemoclaw.jshandles port forwarding and connectionbin/lib/onboard.jshas gateway start, health check, and CoreDNS fix logicregistry.listSandboxes()provides the default sandbox name
Open questions
- Does
openshell gateway start --name nemoclawwork correctly when the gateway container exists but is stopped? Or does it require a destroy/recreate cycle? - Is the CoreDNS fix needed again after a reboot, or only on first setup?
- Should this be a new
nemoclaw reconnectcommand, or shouldnemoclaw <name> connectbe smarter about detecting and recovering from a stopped gateway?
Suggested implementation
async function reconnect(sandboxName) {
// 1. Check gateway
const gwInfo = runCaptureOpenshell(["gateway", "info", "-g", "nemoclaw"], { ignoreError: true });
if (!gwInfo || !gwInfo.includes("Running")) {
console.log(" Starting OpenShell gateway...");
runOpenshell(["gateway", "start", "--name", "nemoclaw"]);
// wait for health
}
// 2. Find sandbox
const name = sandboxName || registry.listSandboxes().defaultSandbox;
if (!name) {
console.error(" No sandbox registered. Run `nemoclaw onboard` first.");
process.exit(1);
}
// 3. Connect
sandboxConnect(name);
}Related
- Please add restart commands to documentation #469 — original user request for reboot recovery docs
- PR docs(troubleshooting): explain reconnect flow after host reboot #904 — previous docs-only attempt (closed, PR limit)
Metadata
Metadata
Assignees
Labels
area: cliCommand line interface, flags, terminal UX, or outputarea: installInstall, setup, prerequisites, or uninstall flowarea: onboardingOnboarding FSM, provider setup, sandbox launch, or first-run flow
Activity
WuKongAI-CMU commentedon Mar 26, 2026
Opened PR #960 to add a global
nemoclaw reconnect [name]command that reuses the existing gateway recovery and sandbox connect path for post-reboot recovery.dknos commentedon Mar 30, 2026
Full post-reboot recovery script + systemd auto-start on WSL2
Until a
nemoclaw reconnectcommand exists, here's a complete startup script we use that handles the full recovery sequence automatically on every boot.~/start-all.sh— handles:Auto-start on WSL boot via systemd user service (
~/.config/systemd/user/nemoclaw.service):Enable with:
This gives full hands-off recovery after every reboot — no manual steps needed.
prekshivyas commentedon May 5, 2026
Closing as resolved via a different approach. The top-level
nemoclaw reconnectcommand proposed here was explicitly considered and rejected in PR #960 (closed unmerged 2026-03-31). Instead, PR #1187 (merged same day) placed recovery directly on thenemoclaw <name> connectpath.What #1187 ships: when local registry state is missing or stale,
nemoclaw <name> connectautomatically probesopenshell sandbox list, re-registers any live sandboxes it finds, clears stale SSH host keys on identity drift, and falls into connect — no separate command needed. Adjacent fixes #1466, #1087, #2064, and #1025 cover sandbox survival across gateway restarts, SSH key cleanup, identity drift, and proxy env persistence respectively.Verified locally today: wiping the local registry entry for a sandbox and running
nemoclaw <sandbox> connecttriggered the live gateway probe, re-registered a running sandbox automatically, and returned the correct error for one that wasn't live. The recovery mechanism from #1187 addresses the scenario this issue described.