Skip to content

Commit fece345

Browse files
ericksoacv
andauthored
fix(inference): contain shared gateway route conflicts (#6338)
<!-- markdownlint-disable MD041 --> ## Summary Contain the current one-route-per-OpenShell-gateway behavior so onboarding, runtime inference switches, and connect-time repair cannot silently change the route used by another registered sandbox. This is a compatibility guard for the current OpenShell contract; true simultaneous per-sandbox routing remains upstream work. ## Related Issue Addresses #6315 ## Changes - Compare the requested provider/model and custom endpoint/API family with every durable registry row on the target gateway, including stopped sandboxes. - Allow identical routes and different gateways; fail closed for same-gateway conflicts, missing durable provider/model identity, incomplete legacy custom-route identity, and invalid gateway bindings. - Run the guard before onboarding setup, resumed setup, runtime `inference set`, connect-time route writes, endpoint probes, or repair mutations. - Serialize route-sensitive onboarding, runtime switches, connect repair, snapshot restore, and registry recovery per gateway; different gateways remain independent. - Persist a full pending route reservation before verification/smoke checks, and revalidate the target reservation under the gateway lock before creating or reusing a sandbox. - Resolve `inference set -g` from the target sandbox's recorded gateway instead of hardcoding the default gateway. - Keep missing-flag guidance inside NemoClaw so users do not bypass the shared-route protection with raw OpenShell commands. - Document the one-route-per-gateway contract and recovery options: align routes, remove the conflicting sandbox, or use another `NEMOCLAW_GATEWAY_PORT`. ## Type of Change - [ ] Code change (feature, bug fix, or refactor) - [x] Code change with doc updates - [ ] Doc only (prose changes, no code sample modifications) - [ ] Doc only (includes code sample changes) ## Quality Gates - [x] Tests added or updated for changed behavior - [ ] Existing tests cover changed behavior — justification: - [ ] Tests not applicable — justification: - [x] Docs updated for user-facing behavior changes - [ ] Docs not applicable — justification: - [x] Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging) - [x] Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: exact head `7df7274c` passed an independent nine-category security review with no findings; the maintainer disposition, exact-head E2E evidence, and manual validation procedure are recorded [here](#6338 (comment)). - [ ] Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue: ## Verification - [x] PR description includes the DCO sign-off declaration and every commit appears as `Verified` in GitHub — all 45 PR commits are GitHub-verified and signed off at `7df7274c138efe4080993378863a21b4567db842`. - [x] Normal `pre-commit`, `commit-msg`, and `pre-push` hooks passed, or `npm run check:diff` passed when hooks were skipped or unavailable — normal pre-commit, commit-msg, and pre-push hooks passed for the merge-resolution and documentation commits at exact head `7df7274c`. - [x] Targeted behavior tests pass for the current change set, or tests are marked not applicable above — 93 conflict-focused assertions and CLI typecheck passed locally after the merge; an independent exact-head security pass reran 108 focused assertions across route locking, DNS finalization, late peers, incomplete recovered rows, aliases, SSRF no-bypass behavior, connect/onboard containment, and local-provider probes. - [x] Applicable broad gate passed — refreshed exact-head CI [run 28893800691](https://github.com/NVIDIA/NemoClaw/actions/runs/28893800691) passed all five CLI shards, aggregate tests/checks, build/typecheck, installer, plugin, security, docs, macOS/WSL, self-hosted, and growth-guard jobs; all five required contexts pass. - [x] Quality Gates section completed with required justifications or waivers - [x] No secrets, API keys, or credentials committed - [ ] `npm run docs` builds without warnings (doc changes only) — 0 errors; Fern reports two pre-existing hidden warnings. - [x] Doc pages follow the [style guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md) (doc changes only) - [ ] New doc pages include SPDX header and frontmatter (new pages only) Additional validation: CLI typecheck, formatting, source/test budgets, the Fern docs build, and normal git hooks passed for the final merge and docs changes at `7df7274c`. The top-level `src/lib/onboard.ts` is net-neutral against the PR base (`+139/-139`). This branch includes `main` through `376ebe2ed18f71555aca0d139337e7f6a9a76e90`. The DCode default-model conflict in `setup-nim-flow.ts` was resolved additively: DCode retains its Ultra default and logger, while same-gateway discovery constraints, pre-probe checks, exact route checks, and API coercion remain intact; the combined interaction is now regression-tested. The later rebuild loader-seam merge was conflict-free. The race coverage includes same-gateway serialization, independent gateways, DNS-normalized endpoint changes between preliminary and finalized checks, gateway-binding changes while queued, pending-reservation loss, snapshot pre-delete rejection, recovered rows with incomplete durable route identity, and zero-mutation conflict exits. The earlier isolated OpenShell 0.0.72 proof `2026-07-06T23-01-11-471Z-pid-7719` remains applicable to the unchanged live containment path: identical same-gateway onboarding succeeded; a conflicting same-gateway onboard named both peers, made zero conflicting endpoint probes, and left the first route, providers, sandboxes, forwards, configs, containers, images, volumes, registry, credentials, gateway PID, and data plane unchanged; the same conflicting route succeeded on a separate gateway without changing gateway A; all cleanup checks passed. Final exact-head E2E passed every refreshed advisor requirement: [run 28893935439](https://github.com/NVIDIA/NemoClaw/actions/runs/28893935439) covered resume/repair, cloud onboarding, inference routing, both OpenClaw variants, both Hermes variants, double-onboard, and concurrent gateway ports; [run 28893939992](https://github.com/NVIDIA/NemoClaw/actions/runs/28893939992) passed the canonical OpenClaw cloud target; and [run 28894237287](https://github.com/NVIDIA/NemoClaw/actions/runs/28894237287) passed sandbox operations and snapshot commands. Exact-head GPT-5.5 attempt 2 reports zero required findings and one runtime-test warning. The explicit maintainer acceptance of that residual checked-in-target gap, its rationale, exact-head live evidence, and reproducible manual validation procedure are recorded [here](#6338 (comment)). Nemotron's only required item applies an unenforced 20-line growth heuristic even though the repository's 1,500-line test budget passes. An independent exact-head audit found no remaining product or security defect. <details> <summary>Advisor scope rationale</summary> - The two-phase custom-route check is intentional: the synchronous preliminary guard rejects known registry conflicts before endpoint work, then asynchronous DNS validation feeds a fresh-registry final guard before any OpenShell, config, or registry mutation. The removal condition is concrete: collapse the phases only when preparation can consume fully DNS-validated metadata without an earlier endpoint probe or mutation. - Registry recovery never invents missing route identity, probes an endpoint, or changes the live gateway route. Complete recovered identities are compatibility-checked; a durable recovered row with missing provider/model is preserved for inventory but makes every later same-gateway route mutation fail closed until the row is removed and re-onboarded. DNS pinning remains at the later endpoint-use/mutation boundary. - Snapshot restore compares the recorded route through the shared compatibility guard under the gateway mutation lock. It does not introduce or probe a new custom endpoint, so adding a second DNS-pinning path there would duplicate the endpoint-use boundary without closing a mutation gap. - Both the ambient `OPENSHELL_GATEWAY_ENDPOINT` environment path and the explicit endpoint flag are rejected or validated at their entry boundaries; neither bypasses the compatibility guard. - Further splits of `connect.ts`, provider onboarding, and the focused containment test files would be structural refactors without changing this issue's behavior. All affected files remain within the repository's enforced source/test budgets, so those splits are deferred to avoid widening the containment PR and its regression surface. - The OpenShell 0.0.72 proof above covers the same-gateway conflict contract and separate-gateway success path; the refreshed exact-head E2E run covers onboarding, repair, switching, sandbox operations, multi-gateway behavior, and stale rebuild. - Overlapping PR merge order requires maintainer coordination: this branch contains `main` through `376ebe2e`; overlapping route-changing work should rebase after this containment change lands. No change inside this PR can safely rewrite those independent branches. - Validation failures are intentionally converted to credential-safe `InferenceSetError` messages. Preserving raw URL/DNS error causes would risk exposing untrusted endpoint detail and is not required for the fail-closed behavior. </details> --- Signed-off-by: Aaron Erickson <aerickson@nvidia.com> --------- Signed-off-by: Aaron Erickson <aerickson@nvidia.com> Signed-off-by: Carlos Villela <cvillela@nvidia.com> Co-authored-by: Carlos Villela <cvillela@nvidia.com>
1 parent 376ebe2 commit fece345

88 files changed

Lines changed: 6869 additions & 1149 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

bin/lib/nim-images.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
},
88
{
99
"name": "nvidia/nemotron-3-nano-30b-a3b",
10+
"servedModel": "nvidia/nemotron-3-nano",
1011
"image": "nvcr.io/nim/nvidia/nemotron-3-nano:latest",
1112
"minGpuMemoryMB": 8192
1213
},

ci/test-file-size-budget.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"test/nemoclaw-start.test.ts": 4827,
1111
"test/onboard-messaging.test.ts": 2062,
1212
"test/onboard-selection.test.ts": 4834,
13-
"test/onboard.test.ts": 4057,
13+
"test/onboard.test.ts": 4043,
1414
"test/policies.test.ts": 2279
1515
}
1616
}

docs/about/release-notes.mdx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,23 @@ NemoClaw v0.0.74 upgrades the OpenShell policy boundary, adds managed MCP and pr
4848
The selected mode persists through resume and transactional rebuilds, and model-specific compatibility safeguards can keep an incompatible model on direct disclosure.
4949
Sandbox-first `inference get` and `inference set` commands now provide the same route controls as their global forms.
5050
For more information, refer to [Tool Calling Reliability](../inference/tool-calling-reliability), [Model Capability Audit](../inference/model-capability-audit), and [NemoClaw CLI Commands Reference](../reference/commands).
51+
- Shared OpenShell gateways now enforce a single compatible inference route across every registered sandbox, including stopped sandboxes.
52+
Onboarding, connect-time repair, and `inference set` reject provider/model conflicts; custom routes must also match the normalized endpoint and API family.
53+
As a migration requirement, custom switches must provide `--endpoint-url` and an unambiguous API family, and incomplete legacy custom-route metadata fails closed until the sandbox is removed and re-onboarded with complete metadata.
54+
After backing up an affected workspace, an OpenAI-compatible route can be re-onboarded with complete metadata as follows (replace the example endpoint, model, and sandbox name):
55+
56+
```bash
57+
$$nemoclaw legacy-sandbox destroy
58+
NEMOCLAW_PROVIDER=custom \
59+
NEMOCLAW_ENDPOINT_URL=https://endpoint.example/v1 \
60+
NEMOCLAW_MODEL=your-model-id \
61+
NEMOCLAW_PREFERRED_API=openai-completions \
62+
$$nemoclaw onboard --name legacy-sandbox
63+
```
64+
65+
Hermes deterministically selects `openai-completions` for `compatible-anthropic-endpoint`, so that one route may omit `--inference-api`; explicit incompatible values are rejected.
66+
Use a different `NEMOCLAW_GATEWAY_PORT` when sandboxes need independent routes.
67+
For more information, refer to [Switch Inference Providers](../inference/switch-inference-providers), [NemoClaw CLI Commands Reference](../reference/commands), and [Troubleshooting](../reference/troubleshooting).
5168
- LangChain Deep Agents Code now provides managed `status`, `whoami`, and `identity` commands without launching the interactive UI, validates the installed agent version during onboarding, and keeps credential-shaped or tracing configuration out of persisted runtime metadata.
5269
Its rebuild path validates recreation before destructive handoff and preserves the managed proxy, tool-disclosure, and MCP boundaries.
5370
For more information, refer to [Quickstart with LangChain Deep Agents Code](../../openclaw/get-started/quickstart-langchain-deepagents-code), [NemoClaw CLI Commands Reference](../reference/commands), and [Security Best Practices](../security/best-practices).

docs/inference/switch-inference-providers.mdx

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,17 @@ If you run `$$nemoclaw inference set` before NemoClaw has a selected sandbox, th
2727
Run `$$nemoclaw onboard` first, then retry the switch.
2828
</Note>
2929

30+
<Warning>
31+
OpenShell currently exposes one inference route per gateway, not one route per sandbox.
32+
All registered sandboxes on the same gateway must use the same provider and model.
33+
Custom compatible routes must also use the same endpoint and API family.
34+
An OpenClaw native-Anthropic route and a Hermes OpenAI-frontend route therefore cannot share a gateway, even when their custom endpoint and model are otherwise identical.
35+
NemoClaw checks stopped sandboxes because they depend on that route when restarted.
36+
If a registered same-gateway sandbox lacks durable provider or model metadata, or a custom route lacks durable endpoint or API-family metadata, NemoClaw fails closed until you remove and re-onboard that sandbox with complete route metadata.
37+
When a route conflicts, onboarding, runtime switching, and connect-time repair exit non-zero before changing the gateway and name the affected sandboxes.
38+
Align the routes, remove the conflicting sandbox, or onboard it with another `NEMOCLAW_GATEWAY_PORT`.
39+
</Warning>
40+
3041
## Find the Provider Name
3142

3243
The `--provider` value must match a provider already configured on the sandbox.
@@ -104,7 +115,11 @@ $$nemoclaw inference set --provider compatible-endpoint --model <model-name>
104115
$$nemoclaw inference set --provider compatible-anthropic-endpoint --model <model-name>
105116
```
106117

107-
To change only the model on a sandbox that is already on this provider, omit `--endpoint-url``inference set` reuses the endpoint that onboarding established and does not repoint the gateway route. Any `--endpoint-url` you do pass is always validated by the host-side SSRF guard, so a URL that resolves to a private or internal address is rejected even if it is the same one onboarding recorded; omit the flag to keep the established endpoint. To point the sandbox at a genuinely different endpoint, re-run `$$nemoclaw onboard` with the new endpoint (rebuild reuses the recorded endpoint and cannot change it).
118+
To change only the model on a sandbox that is already on this provider, omit `--endpoint-url` when its durable registry entry contains both endpoint and API-family metadata.
119+
`inference set` reuses that recorded route and does not repoint the gateway.
120+
If the durable metadata is incomplete, NemoClaw fails closed and tells you to re-run onboarding.
121+
Any `--endpoint-url` you pass is always validated by the host-side SSRF guard, so a URL that resolves to a private or internal address is rejected even if it matches the recorded endpoint.
122+
To point the sandbox at a different endpoint, re-run `$$nemoclaw onboard` with the new endpoint because rebuild reuses the recorded endpoint and cannot change it.
108123

109124
<AgentOnly variant="hermes">
110125

@@ -145,6 +160,7 @@ $$nemoclaw <sandbox-name> rebuild
145160

146161
Resuming onboarding also detects and repairs a stale route.
147162
`inference set` can select this provider after it has been registered on the verified OpenAI surface, but it fails before mutation for a legacy Anthropic registration because that command cannot change a gateway provider's protocol type.
163+
When supplying new custom metadata, Hermes may omit `--inference-api` for this provider because NemoClaw deterministically selects `openai-completions`; an explicit non-OpenAI value is rejected.
148164
</AgentOnly>
149165

150166
#### Switching from Responses API to Chat Completions
@@ -203,6 +219,7 @@ The error includes a redacted OpenShell detail, lists the registered providers w
203219
Run `$$nemoclaw onboard` to register the provider, then retry `$$nemoclaw inference set`.
204220

205221
Use `--no-verify` only when OpenShell cannot verify the provider at switch time but you have already confirmed the provider and credential.
222+
`--no-verify` does not bypass the one-route-per-gateway compatibility check.
206223

207224
## Tune Model Metadata
208225

docs/reference/commands-nemohermes.mdx

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -541,8 +541,10 @@ If another terminal is already connected to the sandbox, `connect` prints a note
541541
An unknown model slug, malformed extra-args JSON, or a gated model (for example `deepseek-r1-distill-70b`) with no `HF_TOKEN` or `HUGGING_FACE_HUB_TOKEN` exits non-zero with the same error the installer would emit, before any sandbox readiness probe or SSH attach.
542542
Unset the managed-vLLM variable, or fix the value, before retrying.
543543

544-
When the live OpenShell gateway inference route differs from the route recorded in the NemoClaw registry, `connect` prints an explicit warning and realigns the shared gateway to the recorded route.
545-
Use `nemohermes inference set --provider <provider> --model <model>` to make an intentional route change.
544+
When the live OpenShell gateway inference route differs from the route recorded in the NemoClaw registry, `connect` checks every registered sandbox on that gateway before attempting a repair.
545+
It realigns the route only when those registry entries are compatible with the requested provider and model.
546+
If another sandbox records a conflicting route, `connect` exits non-zero without changing the gateway and names the affected sandboxes.
547+
Use `nemohermes inference set --provider <provider> --model <model>` to make an intentional compatible route change.
546548
If the sandbox is registered locally but missing from a healthy gateway, `connect` preserves the registry entry and points you to `rebuild --yes`, `onboard`, or `destroy` instead of deleting the metadata needed for recovery.
547549

548550
After a host reboot, the OpenShell gateway rotates its SSH host keys.
@@ -1921,6 +1923,12 @@ By default, the command syncs the default registered sandbox.
19211923
The command refuses before changing the OpenShell route when the selected sandbox has shields up.
19221924
Run `nemohermes <name> shields down`, apply the inference change, then run `nemohermes <name> shields up` again.
19231925

1926+
Each OpenShell gateway exposes one inference route to every sandbox registered on that gateway.
1927+
Before changing the route, NemoClaw compares the requested provider and model with every same-gateway registry entry, including stopped sandboxes.
1928+
Custom compatible routes must also have matching normalized endpoint URLs and API families.
1929+
If a route conflicts or a legacy custom route lacks enough endpoint or API-family metadata to prove compatibility, the command exits non-zero before changing the OpenShell route, agent config, or host registry and names the conflicting sandboxes.
1930+
Align those sandboxes to the same route, remove the conflicting sandbox, or onboard it with another `NEMOCLAW_GATEWAY_PORT`.
1931+
19241932
```bash
19251933
nemohermes inference set --provider <provider> --model <model> [--sandbox <name>] [--no-verify] [--endpoint-url <url>] [--credential-env <ENV>] [--inference-api <api>]
19261934
```
@@ -1933,19 +1941,21 @@ nemohermes my-assistant inference set --provider nvidia-prod --model nvidia/nemo
19331941
```
19341942

19351943
Pass both `--provider` and `--model` when you want NemoClaw to update the OpenShell inference route and sync the selected sandbox's agent config.
1936-
If you only want the lower-level OpenShell route operation, run `openshell inference set -g nemoclaw --model <model> --provider <provider>` directly.
1937-
When either flag is missing, `nemohermes inference set` prints that OpenShell command instead of an oclif flag-validation error.
1944+
NemoClaw resolves the OpenShell gateway from the target sandbox's recorded gateway binding, including non-default `NEMOCLAW_GATEWAY_PORT` deployments.
1945+
Do not run `openshell inference set` directly on a shared NemoClaw gateway because that bypasses registry compatibility checks and can break other sandboxes.
1946+
When either flag is missing, `nemohermes inference set` reports both required flags without suggesting a raw OpenShell command.
19381947
The command updates the host registry immediately after the gateway route changes.
19391948
If the in-sandbox config sync fails, NemoClaw keeps the gateway and registry aligned, warns that the running image may still need a rebuild, and points you to `nemohermes <name> rebuild`.
19401949

19411950
Supported provider names are `nvidia-prod`, `nvidia-nim`, `nvidia-router`, `openai-api`, `anthropic-prod`, `compatible-anthropic-endpoint`, `gemini-api`, `compatible-endpoint`, `hermes-provider`, `ollama-local`, and `vllm-local`.
19421951
Use `--no-verify` only when OpenShell cannot verify the provider at switch time but you have already confirmed the provider and credential.
1943-
When switching to `compatible-endpoint` or `compatible-anthropic-endpoint` from a different provider family, pass `--endpoint-url` with the trusted custom provider URL so NemoClaw can persist durable rebuild metadata.
1952+
When switching to `compatible-endpoint` or `compatible-anthropic-endpoint` from a different provider family, pass `--endpoint-url` with the trusted custom provider URL and, except for the Hermes case below, `--inference-api` with its API family so NemoClaw can persist a complete route identity for rebuild and shared-gateway checks.
1953+
For a Hermes `compatible-anthropic-endpoint` target, `--inference-api` may be omitted because NemoClaw deterministically selects `openai-completions`; an explicit different API family is rejected.
19441954
NemoClaw rejects loopback, link-local, private, and internal endpoint addresses, including public hostnames that resolve to a private address.
19451955
For public HTTP URLs, NemoClaw stores the validated IP address to prevent DNS rebinding.
19461956
DNS-backed HTTPS URLs are rejected because NemoClaw cannot pin the downstream peer address while preserving TLS SNI and host validation across the OpenShell runtime boundary; HTTPS IP-literal URLs remain supported.
19471957
NemoClaw accepts `http://host.openshell.internal:<port>` only with an explicit port from `1024` through `65535`; this narrow exception supports NemoClaw's sandbox-to-host inference routes and is not a general private-endpoint bypass.
1948-
`--credential-env` and `--inference-api` may also be supplied for the compatible provider metadata; supported API values are `openai-completions`, `anthropic-messages`, and `openai-responses`.
1958+
`--credential-env` may also be supplied for compatible provider metadata; supported `--inference-api` values are `openai-completions`, `anthropic-messages`, and `openai-responses`.
19491959

19501960
### `nemohermes setup`
19511961

docs/reference/commands.mdx

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -645,8 +645,10 @@ If another terminal is already connected to the sandbox, `connect` prints a note
645645
An unknown model slug, malformed extra-args JSON, or a gated model (for example `deepseek-r1-distill-70b`) with no `HF_TOKEN` or `HUGGING_FACE_HUB_TOKEN` exits non-zero with the same error the installer would emit, before any sandbox readiness probe or SSH attach.
646646
Unset the managed-vLLM variable, or fix the value, before retrying.
647647

648-
When the live OpenShell gateway inference route differs from the route recorded in the NemoClaw registry, `connect` prints an explicit warning and realigns the shared gateway to the recorded route.
649-
Use `$$nemoclaw inference set --provider <provider> --model <model>` to make an intentional route change.
648+
When the live OpenShell gateway inference route differs from the route recorded in the NemoClaw registry, `connect` checks every registered sandbox on that gateway before attempting a repair.
649+
It realigns the route only when those registry entries are compatible with the requested provider and model.
650+
If another sandbox records a conflicting route, `connect` exits non-zero without changing the gateway and names the affected sandboxes.
651+
Use `$$nemoclaw inference set --provider <provider> --model <model>` to make an intentional compatible route change.
650652
If the sandbox is registered locally but missing from a healthy gateway, `connect` preserves the registry entry and points you to `rebuild --yes`, `onboard`, or `destroy` instead of deleting the metadata needed for recovery.
651653

652654
After a host reboot, the OpenShell gateway rotates its SSH host keys.
@@ -2380,6 +2382,12 @@ By default, the command syncs the default registered sandbox.
23802382
The command refuses before changing the OpenShell route when the selected sandbox has shields up.
23812383
Run `$$nemoclaw <name> shields down`, apply the inference change, then run `$$nemoclaw <name> shields up` again.
23822384

2385+
Each OpenShell gateway exposes one inference route to every sandbox registered on that gateway.
2386+
Before changing the route, NemoClaw compares the requested provider and model with every same-gateway registry entry, including stopped sandboxes.
2387+
Custom compatible routes must also have matching normalized endpoint URLs and API families.
2388+
If a route conflicts or a legacy custom route lacks enough endpoint or API-family metadata to prove compatibility, the command exits non-zero before changing the OpenShell route, agent config, or host registry and names the conflicting sandboxes.
2389+
Align those sandboxes to the same route, remove the conflicting sandbox, or onboard it with another `NEMOCLAW_GATEWAY_PORT`.
2390+
23832391
```bash
23842392
$$nemoclaw inference set --provider <provider> --model <model> [--sandbox <name>] [--no-verify] [--endpoint-url <url>] [--credential-env <ENV>] [--inference-api <api>]
23852393
```
@@ -2392,19 +2400,21 @@ $$nemoclaw my-assistant inference set --provider nvidia-prod --model nvidia/nemo
23922400
```
23932401

23942402
Pass both `--provider` and `--model` when you want NemoClaw to update the OpenShell inference route and sync the selected sandbox's agent config.
2395-
If you only want the lower-level OpenShell route operation, run `openshell inference set -g nemoclaw --model <model> --provider <provider>` directly.
2396-
When either flag is missing, `$$nemoclaw inference set` prints that OpenShell command instead of an oclif flag-validation error.
2403+
NemoClaw resolves the OpenShell gateway from the target sandbox's recorded gateway binding, including non-default `NEMOCLAW_GATEWAY_PORT` deployments.
2404+
Do not run `openshell inference set` directly on a shared NemoClaw gateway because that bypasses registry compatibility checks and can break other sandboxes.
2405+
When either flag is missing, `$$nemoclaw inference set` reports both required flags without suggesting a raw OpenShell command.
23972406
The command updates the host registry immediately after the gateway route changes.
23982407
If the in-sandbox config sync fails, NemoClaw keeps the gateway and registry aligned, warns that the running image may still need a rebuild, and points you to `$$nemoclaw <name> rebuild`.
23992408

24002409
Supported provider names are `nvidia-prod`, `nvidia-nim`, `nvidia-router`, `openai-api`, `anthropic-prod`, `compatible-anthropic-endpoint`, `gemini-api`, `compatible-endpoint`, `hermes-provider`, `ollama-local`, and `vllm-local`.
24012410
Use `--no-verify` only when OpenShell cannot verify the provider at switch time but you have already confirmed the provider and credential.
2402-
When switching to `compatible-endpoint` or `compatible-anthropic-endpoint` from a different provider family, pass `--endpoint-url` with the trusted custom provider URL so NemoClaw can persist durable rebuild metadata.
2411+
When switching to `compatible-endpoint` or `compatible-anthropic-endpoint` from a different provider family, pass `--endpoint-url` with the trusted custom provider URL and, except for the Hermes case below, `--inference-api` with its API family so NemoClaw can persist a complete route identity for rebuild and shared-gateway checks.
2412+
For a Hermes `compatible-anthropic-endpoint` target, `--inference-api` may be omitted because NemoClaw deterministically selects `openai-completions`; an explicit different API family is rejected.
24032413
NemoClaw rejects loopback, link-local, private, and internal endpoint addresses, including public hostnames that resolve to a private address.
24042414
For public HTTP URLs, NemoClaw stores the validated IP address to prevent DNS rebinding.
24052415
DNS-backed HTTPS URLs are rejected because NemoClaw cannot pin the downstream peer address while preserving TLS SNI and host validation across the OpenShell runtime boundary; HTTPS IP-literal URLs remain supported.
24062416
NemoClaw accepts `http://host.openshell.internal:<port>` only with an explicit port from `1024` through `65535`; this narrow exception supports NemoClaw's sandbox-to-host inference routes and is not a general private-endpoint bypass.
2407-
`--credential-env` and `--inference-api` may also be supplied for the compatible provider metadata; supported API values are `openai-completions`, `anthropic-messages`, and `openai-responses`.
2417+
`--credential-env` may also be supplied for compatible provider metadata; supported `--inference-api` values are `openai-completions`, `anthropic-messages`, and `openai-responses`.
24082418

24092419
### `$$nemoclaw setup`
24102420

0 commit comments

Comments
 (0)