Skip to content
2 changes: 1 addition & 1 deletion ci/platform-matrix.json
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@
{
"name": "Managed inference",
"status": "tested",
"notes": "Provider-routed model calls through OpenShell, transparent to the agent. NVIDIA Endpoints and supported fixed hosted providers use native endpoints through sandbox-attached OpenShell providers. New Deep Agents Code selections of Ollama, standalone vLLM, llama.cpp, and qualifying local compatible endpoints use sandbox-attached providers for their qualified host-local endpoints. Hermes implements the same attachment path, with live qualification for its new local lifecycle pending. OpenClaw, Pi, owned Local NVIDIA NIM, and other custom or local selections retain the shared `inference.local` route. OpenShell keeps provider credentials outside the sandbox. Supports every entry in the Providers table."
"notes": "Provider-routed model calls through OpenShell, transparent to the agent. NVIDIA Endpoints and supported fixed hosted providers use native endpoints through sandbox-attached OpenShell providers. New Deep Agents Code selections of Ollama, standalone vLLM, llama.cpp, and qualifying local compatible endpoints use sandbox-attached providers for their qualified host-local endpoints. Hermes implements the same attachment path, with live qualification for its new local lifecycle pending. New OpenClaw selections of Ollama, standalone vLLM, and llama.cpp also use sandbox-attached providers, and their `status`, `connect`, and `start` health checks send requests to the recorded provider endpoint. Earlier OpenClaw sandboxes without a sandbox-attached provider, Pi, owned Local NVIDIA NIM, and other custom or local selections retain the shared `inference.local` route. OpenShell keeps provider credentials outside the sandbox. Supports every entry in the Providers table."
},
{
"name": "Declarative network policy",
Expand Down
3 changes: 2 additions & 1 deletion docs/get-started/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,8 @@ Use these details when your first-run path needs more control.
<Accordion title="Web Search Messaging and Network Policies">
After confirmation, NemoClaw registers the selected provider with OpenShell.
NVIDIA Endpoints and supported fixed hosted providers use native endpoints through sandbox-attached OpenShell providers.
Custom and local providers retain the shared `inference.local` route.
New Ollama, standalone vLLM, and llama.cpp selections also use sandbox-attached providers for their host-local endpoints.
Local NVIDIA NIM, custom endpoints, and earlier local selections without a sandbox-attached provider retain the shared `inference.local` route.
The wizard asks whether to enable web search and offers Brave Search or Tavily Search.
Provide `BRAVE_API_KEY` for Brave Search or `TAVILY_API_KEY` for Tavily Search when prompted.
NemoClaw validates the selected key before it creates the sandbox, registers a sandbox-scoped OpenShell provider, and writes only an OpenShell resolver placeholder into the OpenClaw configuration.
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/platform-support.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ Each row below is a launch-facing capability claim that NemoClaw makes in docs,
|------------|--------|-------|
| Guided onboarding | Tested | Single-command interactive wizard (`$$nemoclaw onboard`) that walks the user through inference provider selection, credential setup, and sandbox creation or update. It opens the agent dashboard when the selected runtime provides one. Non-interactive mode is supported with `--non-interactive` and `NEMOCLAW_*` environment variables for CI and scripted installs. |
| Sandboxed execution | Tested with limitations | Landlock, seccomp, network namespace isolation, no-new-privileges, privilege dropping, and process limits (nproc 512 at `scripts/lib/sandbox-rlimits.sh:8`) are tested and on by default. OpenShell owns capability enforcement for managed entrypoints, exec processes, and connect shells; those paths do not call NemoClaw capability handling. Direct container runtimes that explicitly override the image user to root retain the existing compatibility drop and required `setpriv` transition. Direct container launches must configure capabilities at the container runtime. |
| Managed inference | Tested | Provider-routed model calls through OpenShell, transparent to the agent. NVIDIA Endpoints and supported fixed hosted providers use native endpoints through sandbox-attached OpenShell providers. New Deep Agents Code selections of Ollama, standalone vLLM, llama.cpp, and qualifying local compatible endpoints use sandbox-attached providers for their qualified host-local endpoints. Hermes implements the same attachment path, with live qualification for its new local lifecycle pending. OpenClaw, Pi, owned Local NVIDIA NIM, and other custom or local selections retain the shared `inference.local` route. OpenShell keeps provider credentials outside the sandbox. Supports every entry in the Providers table. |
| Managed inference | Tested | Provider-routed model calls through OpenShell, transparent to the agent. NVIDIA Endpoints and supported fixed hosted providers use native endpoints through sandbox-attached OpenShell providers. New Deep Agents Code selections of Ollama, standalone vLLM, llama.cpp, and qualifying local compatible endpoints use sandbox-attached providers for their qualified host-local endpoints. Hermes implements the same attachment path, with live qualification for its new local lifecycle pending. New OpenClaw selections of Ollama, standalone vLLM, and llama.cpp also use sandbox-attached providers, and their `status`, `connect`, and `start` health checks send requests to the recorded provider endpoint. Earlier OpenClaw sandboxes without a sandbox-attached provider, Pi, owned Local NVIDIA NIM, and other custom or local selections retain the shared `inference.local` route. OpenShell keeps provider credentials outside the sandbox. Supports every entry in the Providers table. |
| Declarative network policy | Tested | YAML-defined egress with policy presets. Presets include `slack`, `discord`, `telegram`, `weather`, `openclaw-pricing`, `huggingface`, `npm`, `pypi`, `brew`, and others. Hot-reloadable at runtime with `$$nemoclaw <name> policy add`. |
| State persistence and rebuild transfer | Tested | OpenShell preserves the native agent home during routine lifecycle operations. Before destructive replacement, NemoClaw archives and integrity-checks the complete native home/workspace, then restores it into the replacement sandbox. |
| Agent skills | Tested | Packaged agent skills are discoverable by Cursor, Claude Code, and other coding assistants under `.agents/skills/`. Skills also install into the sandbox with `$$nemoclaw <name> skill install`. |
Expand Down
110 changes: 110 additions & 0 deletions src/lib/actions/sandbox/inference-invocation-probe.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ import {
READINESS_INFERENCE_INVOCATION_TIMEOUT_MS,
type SandboxInferenceInvocationInput,
} from "./inference-invocation-probe";
import {
NATIVE_LOCAL_CREDENTIAL_HANDLE,
recordingProbeShell,
} from "../../../../test/helpers/native-local-probe-shell";
import { nativeLocalTestReceipt } from "../../../../test/helpers/inference-set";

const input = {
sandboxName: "dcode-workspace",
Expand Down Expand Up @@ -977,3 +982,108 @@ it.each([true, undefined])(
).toEqual({ ok: true });
},
);

describe("OpenClaw native local probe routing (#13338)", () => {
const PROVIDERS = [
["vllm-local", "http://host.openshell.internal:18000/v1"],
["llama-cpp-local", "http://host.openshell.internal:8081/v1"],
["ollama-local", "http://host.openshell.internal:11435/v1"],
] as const;
const okBody = '{"choices":[{"message":{"content":"OK"}}]}';

function openClawInput(
provider: (typeof PROVIDERS)[number][0],
endpointUrl: string,
agentName: string | null | undefined,
agent: "openclaw" | null = "openclaw",
): SandboxInferenceInvocationInput {
return {
sandboxName: "alpha",
gatewayName: "nemoclaw",
...(agentName === undefined ? {} : { agentName }),
provider,
model: "local-model",
preferredInferenceApi: "openai-completions",
nativeLocalProviderAttachment: nativeLocalTestReceipt(
provider,
endpointUrl,
agent ? { agent } : {},
),
};
}

it.each(
PROVIDERS.flatMap(([provider, endpointUrl]) =>
[undefined, null, "openclaw"].map((agentName) => ({ provider, endpointUrl, agentName })),
),
)(
"sends $provider to the recorded endpoint when agentName is $agentName",
async ({ provider, endpointUrl, agentName }) => {
const selected = openClawInput(provider, endpointUrl, agentName);
const shell = recordingProbeShell("200", okBody);
await expect(
probeSandboxInferenceInvocation(selected, { execute: shell.execute }),
).resolves.toEqual({ ok: true });
expect(shell.destinations()).toEqual([`${endpointUrl}/chat/completions`]);
expect(shell.requests[0]).toContain(
`Authorization: Bearer ${NATIVE_LOCAL_CREDENTIAL_HANDLE}`,
);
expect(shell.requests[0].join("\n")).not.toContain("inference.local");
},
);

it("reports the endpoint that actually failed", async () => {
const [provider, endpointUrl] = PROVIDERS[0];
const shell = recordingProbeShell("503");
const result = await probeSandboxInferenceInvocation(
openClawInput(provider, endpointUrl, null),
{
execute: shell.execute,
},
);
expect(result).toMatchObject({ ok: false, httpStatus: 503 });
assert(!result.ok);
expect(result.endpoint).toBe(shell.destinations()[0]);
expect(result.endpoint).toBe(`${endpointUrl}/chat/completions`);
});

it("refuses a raw credential before calling curl", async () => {
const [provider, endpointUrl] = PROVIDERS[2];
const shell = recordingProbeShell("200", okBody, {
NEMOCLAW_LOCAL_INFERENCE_TOKEN: "raw-local-secret",
});
const result = await probeSandboxInferenceInvocation(
openClawInput(provider, endpointUrl, null),
{
execute: shell.execute,
},
);
expect(result.ok).toBe(false);
expect(shell.requests).toEqual([]);
});

it.each([
["ollama-local", undefined],
["ollama-local", "openclaw"],
["vllm-local", "openclaw"],
] as const)(
"keeps a %s selection without native authority (agent %s) on the shared route",
async (provider, agentName) => {
const shell = recordingProbeShell("200", okBody, {});
await expect(
probeSandboxInferenceInvocation(
{
sandboxName: "alpha",
...(agentName ? { agentName } : {}),
provider,
model: "local-model",
preferredInferenceApi: "openai-completions",
},
{ execute: shell.execute },
),
).resolves.toEqual({ ok: true });
expect(shell.destinations()).toEqual(["https://inference.local/v1/chat/completions"]);
expect(shell.requests[0].join("\n")).not.toContain("Authorization");
},
);
});
3 changes: 2 additions & 1 deletion src/lib/actions/sandbox/inference-invocation-probe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ function buildProbeRequest(input: SandboxInferenceInvocationInput): {
? nativeHosted.endpoint
: isNativeNvidiaProvider(input.provider) || hosted
? "https://inference.local/v1"
: config.inferenceBaseUrl
: // A native local attachment is the route, whichever agent the caller names.
(local?.endpointUrl ?? config.inferenceBaseUrl)
).replace(/\/+$/u, "");
// Gemini's existing OpenAI-compatible API ends in /v1beta/openai, not /v1.
const apiBaseUrl =
Expand Down
4 changes: 3 additions & 1 deletion src/lib/actions/sandbox/inference-route-health.ts
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,9 @@ export function buildSandboxInferenceRouteHealth(
ok: invocation?.ok === true,
probed: invocation !== null,
providerLabel: "Native local inference",
endpoint: `${context.nativeLocalEndpoint}/chat/completions`,
endpoint:
(invocation?.ok === false && invocation.endpoint) ||
`${context.nativeLocalEndpoint}/chat/completions`,
detail: invocation?.ok
? "The attached provider served a native local inference request."
: invocation
Expand Down
55 changes: 55 additions & 0 deletions src/lib/actions/sandbox/launch-readiness-gateway-health.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ import {
requireNativeInferenceHealth,
type LaunchReadinessHealthDeps,
} from "./launch-readiness/health";
import { probeSandboxInferenceInvocation } from "./inference-invocation-probe";
import { runSandboxInferenceInvocationProbe } from "./inference-route-health";
import {
NATIVE_LOCAL_CREDENTIAL_HANDLE,
recordingProbeShell,
} from "../../../../test/helpers/native-local-probe-shell";
import { nativeLocalTestReceipt } from "../../../../test/helpers/inference-set";
import {
isSandboxGatewayRunningForStatus,
waitForStartedHermesGatewayProcess,
Expand Down Expand Up @@ -448,3 +455,51 @@ describe("Hermes native-local readiness authority", () => {
);
});
});

describe("OpenClaw native-local readiness identity (#13338)", () => {
it.each([
{ agentName: undefined, agent: "openclaw" },
{ agentName: undefined, agent: undefined },
{ agentName: "openclaw", agent: "openclaw" },
])(
"sends the health request to the recorded endpoint (selected $agentName, recorded $agent)",
async ({ agentName, agent }) => {
const receipt = nativeLocalTestReceipt(
"llama-cpp-local",
"http://host.openshell.internal:8081/v1",
{
agent: "openclaw",
gatewayName: "selected",
},
);
const shell = recordingProbeShell("200", '{"choices":[{"message":{"content":"OK"}}]}');
await expect(
requireNativeInferenceHealth({
sandboxName: "alpha",
gatewayName: "selected",
...(agentName ? { agentName } : {}),
entry: {
name: "alpha",
...(agent ? { agent } : {}),
provider: "llama-cpp-local",
model: "local-model",
nativeLocalProviderAttachment: receipt,
},
deps: {
verifyNativeLocalAttachment: vi.fn(async () => {}),
inferenceInvocationProbe: (input) =>
runSandboxInferenceInvocationProbe(input, (selected, _deps, timeoutMs) =>
probeSandboxInferenceInvocation(selected, { execute: shell.execute }, timeoutMs),
),
},
}),
).resolves.toBe(true);
expect(shell.destinations()).toEqual([
"http://host.openshell.internal:8081/v1/chat/completions",
]);
expect(shell.requests[0]).toContain(
`Authorization: Bearer ${NATIVE_LOCAL_CREDENTIAL_HANDLE}`,
);
},
);
});
51 changes: 51 additions & 0 deletions src/lib/actions/sandbox/status-snapshot-inference-health.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import type { SandboxEntry } from "../../state/registry";
import type { SandboxInferenceInvocationResult } from "./inference-invocation-probe";
import type { SandboxInferenceRouteHealth } from "./inference-route-health";
import { collectSandboxStatusSnapshot } from "./status-snapshot";
import { probeSandboxInferenceInvocation } from "./inference-invocation-probe";
import { recordingProbeShell } from "../../../../test/helpers/native-local-probe-shell";
import { nativeLocalTestReceipt } from "../../../../test/helpers/inference-set";

// Direct, unmocked coverage of `buildSandboxInferenceRouteHealth` through the
// exported `collectSandboxStatusSnapshot` entry point (it is not itself
Expand Down Expand Up @@ -1158,3 +1161,51 @@ describe("collectSandboxStatusSnapshot inference route health", () => {
expect(snapshot.inferenceHealth).toMatchObject({ ok: false, failureLabel: "unhealthy" });
});
});

describe("status native local request identity (#13338)", () => {
it.each(["openclaw", undefined] as const)(
"probes and reports the recorded OpenClaw endpoint when the registry agent is %s",
async (agent) => {
const receipt = nativeLocalTestReceipt(
"vllm-local",
"http://host.openshell.internal:18000/v1",
{
agent: "openclaw",
authMode: "sentinel",
},
);
const options = snapshotDeps(
null,
null,
{ ok: true },
{
agent,
provider: "vllm-local",
model: "local-model",
gatewayName: "nemoclaw",
nativeLocalProviderAttachment: receipt,
},
);
const shell = recordingProbeShell("503");
const snapshot = await collectSandboxStatusSnapshot("alpha", {
...options,
deps: {
...options.deps,
inferenceRouteObserver: { observeInferenceRoute: vi.fn() },
verifyNativeLocalProviderAttachmentImpl: async () => undefined,
probeSandboxInferenceInvocationImpl: (input, _deps, timeoutMs) =>
probeSandboxInferenceInvocation(input, { execute: shell.execute }, timeoutMs),
delayInferenceRecoveryProbe: async () => undefined,
},
});
expect(shell.destinations().length).toBeGreaterThan(0);
expect(new Set(shell.destinations())).toEqual(
new Set(["http://host.openshell.internal:18000/v1/chat/completions"]),
);
expect(snapshot.inferenceHealth).toMatchObject({
ok: false,
endpoint: shell.destinations()[0],
});
},
);
});
19 changes: 19 additions & 0 deletions test/e2e/fixtures/native-local-chat.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

import { NATIVE_LOCAL_AUTH_HEADER_SCRIPT } from "../../../src/lib/inference/native-local/agent-config.ts";
import { shellQuote } from "./clients/command.ts";

/**
* Sandbox shell command for a chat request to a sandbox-owned native local provider (#13293).
* The auth script accepts only the credential handle that OpenShell issues, so the raw local
* credential never enters the request. The endpoint and body are shell-quoted, so request data
* stays one curl argument.
*/
export function nativeLocalChatCommand(
endpointUrl: string,
body: string,
curlFlags: "-fsS" | "-sS",
): string {
return `${NATIVE_LOCAL_AUTH_HEADER_SCRIPT}; curl ${curlFlags} --max-time 120 ${shellQuote(`${endpointUrl}/chat/completions`)} -H "$AUTH_HEADER" -H 'Content-Type: application/json' --data ${shellQuote(body)}`;
}
Loading