NemoClaw icon indicating copy to clipboard operation
NemoClaw copied to clipboard

sandbox status reports an unregistered sandbox as registered, with recovery guidance for the wrong problem

Open udsy19 opened this issue 3 months ago • 0 comments

What happened?

nemoclaw sandbox status <name> states the opposite of the truth when the local registry does not hold <name>. It reports that the sandbox is registered locally, then prints three lines of recovery guidance for a different problem: waiting for the OpenShell gateway to reconnect, and reassurance about a registry entry that does not exist.

nemoclaw sandbox stop <name> and nemoclaw sandbox start <name> answer the same question correctly for the same name in the same run, so the CLI contradicts itself about one registry.

This is on a documented automation path. docs/reference/commands.mdx:1931 says:

The alias form nemoclaw <name> status --json requires the sandbox to be registered locally; the canonical form nemoclaw sandbox status <name> --json is the one to use from automation that may run against an unknown sandbox name, since it still emits a JSON document with found: false instead of a text error.

So the form the docs direct at unknown sandbox names is the one that answers, in text mode, that the name is registered.

Steps to reproduce

  1. Have a NemoClaw gateway that is up and connected, with no sandbox named not-a-sandbox in the local registry.
  2. Run each of the following:
nemoclaw sandbox status not-a-sandbox
nemoclaw sandbox stop   not-a-sandbox
nemoclaw not-a-sandbox  status

Actual output

########## nemoclaw sandbox status not-a-sandbox ##########

  Sandbox 'not-a-sandbox' is registered locally, but is not present in the live OpenShell gateway.
  No local registry entry was removed by this status check.
  Retry `nemoclaw not-a-sandbox status` after the gateway finishes reconnecting.
  If the sandbox was intentionally deleted, run `nemoclaw list` to inspect the remaining sandboxes or `nemoclaw onboard` to create a new one.
EXIT=1

########## nemoclaw sandbox stop not-a-sandbox ##########
  Sandbox 'not-a-sandbox' is not registered. Run 'nemoclaw list' to see registered sandboxes.
EXIT=1

########## nemoclaw not-a-sandbox status ##########
  Sandbox 'not-a-sandbox' does not exist.
  Run 'nemoclaw onboard' to create one.
EXIT=1

The registry held no sandbox at all during this run.

Expected output

nemoclaw sandbox status <unregistered-name> reports that the sandbox is not registered, using the sentence sandbox start and sandbox stop already print:

  Sandbox 'not-a-sandbox' is not registered. Run 'nemoclaw list' to see registered sandboxes.

The exit code stays 1, and nemoclaw sandbox status <name> --json keeps reporting "found": false.

Root cause

src/lib/actions/sandbox/status-lookup-rendering.ts

  • Line 39-41: the "missing" gateway-lookup case calls printMissingLiveSandboxStatusGuidance(...) and then process.exit(1).
  • Line 77-98: that function never consults the registry. Line 83 asserts is registered locally unconditionally.

Nothing else fills the gap. printSandboxDetails (src/lib/actions/sandbox/status-text.ts:351) returns { exitCode: null } and prints nothing when the registry entry is absent, so the false sentence is the entire text answer the user gets.

The nemoclaw <name> status alias form does not hit this, because recoverRequestedSandboxIfNeeded (src/lib/cli/public-dispatch.ts:268) checks the registry first. The sandbox namespace form skips that guard: NATIVE_OCLIF_NAMESPACES (src/lib/cli/public-dispatch.ts:43) routes nemoclaw sandbox ... straight to oclif at line 505, before dispatchNormalizedArgv runs.

Note that extending that guard to the sandbox namespace is not the right fix: the guard prints a text error and exits 1 with no --json awareness, so it would remove the "found": false JSON contract that docs/reference/commands.mdx:1931 promises.

Impact

  • Automation and users following docs/reference/commands.mdx:1931 get a wrong-cause diagnostic for a typo or a stale sandbox name.
  • The suggested recovery ("retry after the gateway finishes reconnecting") can never succeed, because the gateway is not the problem.
  • No Did you mean: suggestion is offered, even though suggestSandboxName already exists and the alias form already uses it.

Exit code is already correct (1), so this is a diagnostic-accuracy defect, not a scripting-contract break.

Related but different

  • #8737 (open) is the case where a genuinely registered sandbox is absent from the live gateway after a post-interrupt re-onboard. The current message is correct there, and this report does not change that path.
  • #8848 ("fix(cli): report stopped sandboxes truthfully") is the same defect class — the CLI stating a sandbox state that is not true — already accepted and merged.
  • The same unconditional sentence also appears in gateway-state.ts:736 (ensureLiveSandboxOrExit, which fronts sandbox exec and sandbox skill install), snapshot.ts:774, and rebuild-flow-helpers.ts:228. Those are separate commands with separate owning scenarios and are better handled in their own change.

Environment

  • NemoClaw commit 7d516f2ed ("test: migrate remaining test loops (#9402)")
  • macOS (darwin 25.5.0), Node.js 22
  • Reproduced against a stub openshell on NEMOCLAW_OPENSHELL_BIN that reports a healthy, connected nemoclaw gateway and answers every sandbox get with NotFound, with an empty HOME so the local registry is empty.

udsy19 avatar Aug 18 '26 06:08 udsy19