Skip to content

[Ubuntu 24.04][CLI&UX] nemoclaw <name> status missing --json flag (per-sandbox variant gap; #6132441 only fixed global status) #4310

@hulynn

Description

@hulynn

Description

NemoClaw v0.0.52: the per-sandbox status command nemoclaw <name> status does NOT accept --json, while the global nemoclaw status (no sandbox name) does. Bug #6132441 added the JSON renderer to the GLOBAL status command on 2026-05-04 but did not extend it to the per-sandbox variant. Automation that needs hostGpuDetected / sandboxGpuEnabled / sandboxGpuMode / sandboxGpuDevice / openshellDriver / openshellVersion for a specific sandbox cannot consume them as JSON — the values are computed and rendered in the text output but no JSON entrypoint exists.

Environment

Device:        Two Ubuntu 24.04 hosts:
               - a1u2n2g-0096-02 / 10.176.178.129 (no GPU)
               - 2u2g-gen-0690   / 10.57.211.27   (RTX 5090)
OS:            Ubuntu 24.04.4 LTS
Architecture:  x86_64
Node.js:       v22.22.3
npm:           10.9.8
Docker:        Docker version 29.4.1, build 055a478
OpenShell CLI: openshell 0.0.44
NemoClaw:      nemoclaw v0.0.52
OpenClaw:      2026.4.24 (ollama-base) / 2026.5.22 (cpu-sb, gpu-sb)

Steps to Reproduce

  1. Have any healthy sandbox onboarded (e.g. ollama-base, cpu-sb, gpu-sb).
  2. Run:
    nemoclaw <name> status --json
  3. Inspect the help output:
    nemoclaw <name> status --help
  4. Compare to the global form:
    nemoclaw status --json

Expected Result

nemoclaw <name> status --json emits a JSON document containing at least:

  • hostGpuDetected : boolean
  • sandboxGpuEnabled : boolean
  • sandboxGpuMode : string | null
  • sandboxGpuDevice : string | null
  • openshellDriver : string (always present; never null)
  • openshellVersion : string (semver shape, e.g. "0.0.44")

…plus the existing fields (model / provider / phase / inferenceHealth / …). status --help lists --json as a supported flag.

Actual Result

$ nemoclaw ollama-base status --json
 ›   Error: Nonexistent flag: --json
 ›   See more help with --help

$ nemoclaw ollama-base status --help
Sandbox health and NIM status

USAGE
  $ nemoclaw sandbox status <name>

ARGUMENTS
  SANDBOXNAME  Sandbox name

FLAGS
  -h, --help  Show CLI help.

(Same on cpu-sb and gpu-sb on the GPU host.)

For comparison, the global form does support JSON:

$ nemoclaw status --help
…
EXAMPLES
  $ nemoclaw status
  $ nemoclaw status --json

Code Analysis

1) Per-sandbox status oclif command has NO flags definedsrc/commands/sandbox/status.ts:

export default class SandboxStatusCommand extends NemoClawCommand {
  static id = "sandbox:status";
  static strict = true;
  static summary = "Sandbox health and NIM status";
  static description = "Show sandbox health, OpenShell gateway state, and local NIM status.";
  static usage = ["<name>"];
  static args = { sandboxName: sandboxNameArg };
  static flags = {};                          // ← no enableJsonFlag
  public async run(): Promise<void> {
    const { args } = await this.parse(SandboxStatusCommand);
    await showSandboxStatus(args.sandboxName);
  }
}

2) The GLOBAL status command DOES opt in (the #6132441 fix) — src/commands/status.ts:

export default class StatusCommand extends NemoClawCommand {
  static enableJsonFlag = true;
  ...
  if (this.jsonEnabled()) {
    const report = getStatusReport(deps);
    if (report.gatewayHealth && !report.gatewayHealth.healthy) {
      process.exitCode = 1;
    }
    return report;
  }
  showStatusCommand(deps);
}

3) The six fields are already computed in the per-sandbox renderer — only the JSON entry point is missing. src/lib/actions/sandbox/status.ts (lines 198–207):

const hostGpu = sb.hostGpuDetected ? "yes" : "no";
const sandboxGpuEnabled = sb.sandboxGpuEnabled ?? (sb.gpuEnabled === true);
const sandboxGpu = sandboxGpuEnabled ? "enabled" : "disabled";
const openshellDriver = sb.openshellDriver || "unknown";
const openshellVersion = sb.openshellVersion || "unknown";
console.log(`    OpenShell: ${openshellVersion} (${openshellDriver})`);

Each value comes off the SandboxEntry — the JSON renderer just needs an entry point.

Suggested fix:

  1. Add static enableJsonFlag = true; to SandboxStatusCommand in src/commands/sandbox/status.ts.
  2. Extend showSandboxStatus(sandboxName, { json: boolean }) so when json=true it returns an object instead of printing — with at least the six fields above plus model / provider / phase / inferenceHealth.
  3. Ensure openshellDriver and openshellVersion are emitted as strings (never null) so consumers can rely on typeof checks.
  4. Update the --help examples to include nemoclaw <name> status --json.

Related: #6132441 added the JSON renderer to the global status command; this bug extends that fix to the per-sandbox variant.


NVB#6229496

Metadata

Metadata

Assignees

Labels

NV QABugs found by the NVIDIA QA Teamarea: cliCommand line interface, flags, terminal UX, or outputplatform: ubuntuAffects Ubuntu Linux environments

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions