[All Platforms][CLI&UX] inference get reports valid endpoint metadata as invalid for a sandbox on a non-default gateway port
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
- In an isolated HOME, write one valid
compatible-endpointsandbox namedcustomto~/.nemoclaw/gateways/18080/sandboxes.json, withgatewayNamenemoclaw-18080andgatewayPort18080. - Point
NEMOCLAW_OPENSHELL_BINat a stub that answersinference get -g nemoclaw-18080withProvider: compatible-endpointandModel: custom/model. - Run
node bin/nemoclaw.js custom inference get --jsonwithoutNEMOCLAW_GATEWAY_PORT. - 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
mainat4c44f7cc8; the affected files are unchanged on5f6eb3232 - 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