Skip to content

feat(cli): add nemoclaw reconnect command for post-reboot recovery #910

@prekshivyas

Description

@prekshivyas

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:

  1. Verify the container runtime is running
  2. Start the OpenShell gateway if it's not running (openshell gateway start --name nemoclaw)
  3. Wait for the gateway to become healthy
  4. Check sandbox state (openshell sandbox list)
  5. Start port forward and connect to the default (or named) sandbox

Context

Open questions

  • Does openshell gateway start --name nemoclaw work 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 reconnect command, or should nemoclaw <name> connect be 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions