NemoClaw icon indicating copy to clipboard operation
NemoClaw copied to clipboard

[All Platforms][CLI&UX] inference get reports valid endpoint metadata as invalid for a sandbox on a non-default gateway port

Open PicoNVIDIA opened this issue 2 months ago • 0 comments

Description

nemoclaw <sandbox> inference get says a sandbox's endpoint metadata is invalid when the sandbox lives on a non-default gateway port and NEMOCLAW_GATEWAY_PORT isn't set. The metadata is fine. Setting the port makes the same data pass.

The command looks up the sandbox and its gateway across every gateway root (findSandboxAcrossGatewayRoots, src/lib/actions/sandbox/gateway-target.ts:14). The endpoint check then reads only the registry for the current environment's port (listPersistedSandboxTargets() → registry.listSandboxes(), src/lib/actions/inference-get.ts:200). The sandbox isn't in that registry, so the check flags it (inference-get.ts:285-288).

The endpoint check should read the registry that owns the sandbox and print the endpoint URL.

Reproduction Steps

  1. In an isolated HOME, write one valid compatible-endpoint sandbox named custom to ~/.nemoclaw/gateways/18080/sandboxes.json, with gatewayName nemoclaw-18080 and gatewayPort 18080.
  2. Point NEMOCLAW_OPENSHELL_BIN at a stub that answers inference get -g nemoclaw-18080 with Provider: compatible-endpoint and Model: custom/model.
  3. Run node bin/nemoclaw.js custom inference get --json without NEMOCLAW_GATEWAY_PORT.
  4. Run it again with NEMOCLAW_GATEWAY_PORT=18080.

Both runs call OpenShell with the same arguments: inference get -g nemoclaw-18080.

Environment

  • macOS 26.5.2 (arm64), Node.js v22.22.3
  • NemoClaw main at 4c44f7cc8; the affected files are unchanged on 5f6eb3232
  • OpenShell was a stub that only answers the read-only route query, so no live gateway was involved.

Debug Output

Without NEMOCLAW_GATEWAY_PORT (exit 0):

{
  "provider": "compatible-endpoint",
  "model": "custom/model",
  "endpointStatus": "invalid",
  "endpointRecovery": "Repair the named sandbox registrations' compatible-route metadata, then rerun inference get; repeat if additional affected registrations are reported.",
  "affectedSandboxes": [
    "custom"
  ]
}

With NEMOCLAW_GATEWAY_PORT=18080 (exit 0):

{
  "provider": "compatible-endpoint",
  "model": "custom/model",
  "endpointUrl": "https://inference.example.test/v1"
}

Logs

The recovery message sends users off to repair registration data that is already valid, and scripts that read endpointStatus get a false invalid.

A possible fix is to resolve the sandbox's owning registry once and use its rows for the endpoint check, with a test that compares unset and explicit NEMOCLAW_GATEWAY_PORT for a sandbox in a non-default gateway root.

Checklist

  • [x] I confirmed this bug is reproducible
  • [x] I searched existing issues and this is not a duplicate

PicoNVIDIA avatar Sep 28 '26 19:09 PicoNVIDIA