From 6ed503a1366a8b077337a2c05679d87eff5cb731 Mon Sep 17 00:00:00 2001 From: Yimo Jiang Date: Mon, 12 Oct 2026 02:20:40 +0000 Subject: [PATCH 01/17] fix(status): keep status responsive during rebuild Signed-off-by: Yimo Jiang --- src/lib/actions/sandbox/status-snapshot.ts | 17 ++++- src/lib/actions/sandbox/status.ts | 21 +++++- src/lib/cli/nemoclaw-oclif-command.test.ts | 37 ++++++++++ src/lib/cli/nemoclaw-oclif-command.ts | 74 ++++++++++++++++++- .../state/portable-uninstall-retirement.ts | 6 +- 5 files changed, 147 insertions(+), 8 deletions(-) diff --git a/src/lib/actions/sandbox/status-snapshot.ts b/src/lib/actions/sandbox/status-snapshot.ts index 53c41e2036b..39143fe7db9 100644 --- a/src/lib/actions/sandbox/status-snapshot.ts +++ b/src/lib/actions/sandbox/status-snapshot.ts @@ -1,6 +1,7 @@ // SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. // SPDX-License-Identifier: Apache-2.0 +import { AsyncLocalStorage } from "node:async_hooks"; import { setTimeout as sleep } from "node:timers/promises"; import type { OpenShellStateRpcIssue } from "../../adapters/openshell/gateway-drift"; @@ -76,6 +77,18 @@ import { type TerminalRuntimeOomProbeResult, } from "./terminal-runtime-health"; +const unlockedStatusRead = new AsyncLocalStorage(); + +/** Run a best-effort status read that may observe transitional ordinary sandbox state. */ +export function withUnlockedSandboxStatusRead(operation: () => Promise | T): Promise | T { + return unlockedStatusRead.run(true, operation); +} + +/** Whether status is running in the best-effort ordinary-host read path. */ +export function isUnlockedSandboxStatusRead(): boolean { + return unlockedStatusRead.getStore() === true; +} + type ProbeProviderHealth = ( provider: string, options?: ProviderHealthProbeOptions, @@ -473,7 +486,7 @@ export async function collectSandboxStatusSnapshot( ((name: string) => getReconciledSandboxGatewayState(name, { getState: getSandboxGatewayStateForStatus, - ...(initialPreflight?.intentionalStopConfirmed + ...(isUnlockedSandboxStatusRead() || initialPreflight?.intentionalStopConfirmed ? { gatewayRecovery: "observe" as const } : {}), })); @@ -488,6 +501,7 @@ export async function collectSandboxStatusSnapshot( }; } if ( + !isUnlockedSandboxStatusRead() && sb?.stopped === true && lookup.state === "present" && (lookup.phase === "Ready" || lookup.phase === "Running") && @@ -515,6 +529,7 @@ export async function collectSandboxStatusSnapshot( !initialPreflight?.intentionalStopConfirmed; let recoveredManagedGateway = false; if ( + !isUnlockedSandboxStatusRead() && lookup.state === "present" && (lookup.recoveredSandbox || managedOpenClawDeliveryMustBeProven) ) { diff --git a/src/lib/actions/sandbox/status.ts b/src/lib/actions/sandbox/status.ts index 7f5bd59e36b..d31018b0d23 100644 --- a/src/lib/actions/sandbox/status.ts +++ b/src/lib/actions/sandbox/status.ts @@ -27,6 +27,7 @@ import { import { collectSandboxStatusSnapshot, getSandboxStatusReport as getLegacySandboxStatusReport, + isUnlockedSandboxStatusRead, normalizeSandboxStatusHostMounts, resolveSandboxStatusAgent, type SandboxStatusReport, @@ -64,6 +65,15 @@ export { type ServingProcessHealth, } from "./status-snapshot"; +function withStatusLifecycleLock( + sandboxName: string, + operation: () => Promise | T, +): Promise | T { + return isUnlockedSandboxStatusRead() + ? operation() + : withSandboxLifecycleLock(sandboxName, operation); +} + function inspectHermesPortableStatus( sandboxName: string, ): HermesPortableAgentLifecycleAuthority | null { @@ -128,7 +138,7 @@ export async function getSandboxStatusReport( sandboxName: string, deps: Parameters[1] = {}, ): Promise { - return withSandboxLifecycleLock(sandboxName, async () => { + const read = async () => { const hermesPortable = inspectHermesPortableStatus(sandboxName); if (hermesPortable) { return await hermesPortableStatusReport( @@ -138,11 +148,13 @@ export async function getSandboxStatusReport( ); } return getLegacySandboxStatusReport(sandboxName, { getGatewayPresets, ...deps }); - }); + }; + return await withStatusLifecycleLock(sandboxName, read); } function maybeEnsureHermesToolGatewayBroker(sb: registry.SandboxEntry | null): void { if ( + isUnlockedSandboxStatusRead() || !sb || sb.agent !== "hermes" || !Array.isArray(sb.hermesToolGateways) || @@ -161,7 +173,7 @@ function maybeEnsureHermesToolGatewayBroker(sb: registry.SandboxEntry | null): v export async function showSandboxStatus(sandboxName: string): Promise { let deferredExitCode: number | null = null; try { - await withSandboxLifecycleLock(sandboxName, async () => { + const read = async () => { const hermesPortable = inspectHermesPortableStatus(sandboxName); if (hermesPortable) { console.log(` Sandbox: ${sandboxName}`); @@ -171,7 +183,8 @@ export async function showSandboxStatus(sandboxName: string): Promise { return; } await showLegacySandboxStatus(sandboxName); - }); + }; + await withStatusLifecycleLock(sandboxName, read); } catch (error) { if (!isSandboxLifecycleDeferredExit(error)) throw error; deferredExitCode = error.exitCode; diff --git a/src/lib/cli/nemoclaw-oclif-command.test.ts b/src/lib/cli/nemoclaw-oclif-command.test.ts index 1845e55c5fd..20959fcdea6 100644 --- a/src/lib/cli/nemoclaw-oclif-command.test.ts +++ b/src/lib/cli/nemoclaw-oclif-command.test.ts @@ -11,6 +11,8 @@ import { launchSandbox } from "../actions/sandbox/launch"; import * as portableAgentLifecycle from "../onboard/experimental/portable-agent-lifecycle"; import * as receiptAuthority from "../onboard/experimental/hermes-portable-receipt"; import * as portableHostAuthority from "../state/portable-uninstall-retirement"; +import { isUnlockedSandboxStatusRead } from "../actions/sandbox/status-read-context"; +import { acquireProcessBoundLockAt, releaseProcessBoundLock } from "../state/registry/lock"; import { isMcpLifecycleLockHeld, withMcpLifecycleLock, @@ -250,6 +252,41 @@ describe("NemoClawCommand", () => { PortableStopCommand.observed = { host: false, lifecycle: false, portableLifecycle: false }; }); + it("runs sandbox status without either lifecycle fence during ordinary-host contention (#11903)", async () => { + const fence = acquireProcessBoundLockAt(portableHostAuthority.portableHostFencePath(stateDir)); + const operation = vi.fn(async () => { + expect(fs.existsSync(portableHostAuthority.portableHostFencePath(stateDir))).toBe(true); + expect(isMcpLifecycleLockHeld("alpha")).toBe(false); + expect(isUnlockedSandboxStatusRead()).toBe(true); + }); + ParsedSupportedSandboxCommand.operation = operation; + try { + await expect( + ParsedSupportedSandboxCommand.run(["alpha"], process.cwd()), + ).resolves.toBeUndefined(); + expect(operation).toHaveBeenCalledOnce(); + } finally { + releaseProcessBoundLock(fence); + } + }); + + it("fails fast rather than bypassing portable authority during status contention (#11903)", async () => { + const authorityDirectory = path.join(stateDir, "hermes-portable-lifecycle"); + fs.mkdirSync(authorityDirectory, { mode: 0o700 }); + fs.writeFileSync(path.join(authorityDirectory, "receipt.json"), "authority\n"); + vi.spyOn(portableHostAuthority, "withCurrentPortableHostFenceTry").mockRejectedValue( + new Error(portableHostAuthority.PORTABLE_HOST_FENCE_BUSY_MESSAGE), + ); + const operation = vi.fn(async () => undefined); + ParsedSupportedSandboxCommand.operation = operation; + + await expect(ParsedSupportedSandboxCommand.run(["alpha"], process.cwd())).rejects.toThrow( + "Another NemoClaw lifecycle operation is in progress on this host.", + ); + expect(operation).not.toHaveBeenCalled(); + expect(portableHostAuthority.withCurrentPortableHostFenceTry).toHaveBeenCalledOnce(); + }); + it("records status-like command results without throwing", () => { makeCommand().apply({ status: 7 }); diff --git a/src/lib/cli/nemoclaw-oclif-command.ts b/src/lib/cli/nemoclaw-oclif-command.ts index e26f637ae29..b492581e773 100644 --- a/src/lib/cli/nemoclaw-oclif-command.ts +++ b/src/lib/cli/nemoclaw-oclif-command.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import { Command, Flags, type Interfaces } from "@oclif/core"; +import path from "node:path"; import { assertHermesPortableCommandSupported, assertHermesPortableCommandUnavailable, @@ -9,13 +10,23 @@ import { HERMES_PORTABLE_UNSUPPORTED_COMMAND_MESSAGE, HERMES_PORTABLE_UNSUPPORTED_DOCTOR_FIX_MESSAGE, } from "../onboard/experimental/portable-agent-lifecycle"; +import { + HERMES_PORTABLE_RECEIPT_DIRECTORY, + inspectPortableAgentReceiptAuthorityForClassification, +} from "../onboard/experimental/hermes-portable-receipt"; import { defaultPortableDemoStateDir } from "../onboard/experimental/portable-runtime-receipt-readiness"; import { redactForLog } from "../security/redact"; import { assertNoHermesPortableHostAuthority, + PORTABLE_HOST_FENCE_BUSY_MESSAGE, + readPortableAuthorityDirectory, + samePortableAuthorityDirectory, withCurrentPortableHostFence, + withCurrentPortableHostFenceTry, } from "../state/portable-uninstall-retirement"; import { withSandboxLifecycleLock } from "../actions/sandbox/lifecycle/lock"; +import { withUnlockedSandboxStatusRead } from "../actions/sandbox/status-snapshot"; +import { findSandboxAcrossGatewayRoots } from "../state/registry/cross-port"; import { enforceRemovedImmutabilityMigrationBoundary, reportRemovedImmutabilityUpgrade, @@ -41,6 +52,43 @@ const REMOVED_IMMUTABILITY_REMEDIATION_COMMANDS = new Set([ "sandbox:stop", ]); +function hasPortableRegistryAuthority(sandboxName: string): boolean { + const entry = findSandboxAcrossGatewayRoots(sandboxName)?.entry; + return ( + entry?.portableLifecycleProfile !== undefined || + (entry?.agent === "hermes" && + entry.openshellDriver === "docker" && + typeof entry.lifecycleGeneration === "string") + ); +} + +function canUseUnlockedSandboxStatusRead(sandboxName: string): boolean { + const stateDir = defaultPortableDemoStateDir(process.env); + const authorityDirectory = path.join(stateDir, HERMES_PORTABLE_RECEIPT_DIRECTORY); + try { + const before = readPortableAuthorityDirectory(authorityDirectory, false); + const hasPortableReceiptAuthority = () => + inspectPortableAgentReceiptAuthorityForClassification(sandboxName, stateDir).kind !== "none"; + if ( + before.entries.length > 0 || + hasPortableRegistryAuthority(sandboxName) || + hasPortableReceiptAuthority() + ) { + return false; + } + + const after = readPortableAuthorityDirectory(authorityDirectory, false); + return ( + after.entries.length === 0 && + samePortableAuthorityDirectory(before, after) && + !hasPortableRegistryAuthority(sandboxName) && + !hasPortableReceiptAuthority() + ); + } catch { + return false; + } +} + /** * Shared oclif base for NemoClaw commands. * @@ -107,7 +155,7 @@ export abstract class NemoClawCommand extends Command { const portablePolicy = typeof commandId === "string" ? classifyHermesPortableCommand(commandId, this.argv) : null; if (portablePolicy?.hostFence === "read" && !portablePolicy.helpRequested) { - return await withCurrentPortableHostFence(() => super._run()); + return await withCurrentPortableHostFenceTry(() => super._run()); } if ( typeof commandId === "string" && @@ -139,6 +187,30 @@ export abstract class NemoClawCommand extends Command { } return super._run(); }; + if (commandId === "sandbox:status") { + let fencedOperationStarted = false; + try { + return await withCurrentPortableHostFenceTry(() => { + fencedOperationStarted = true; + return withSandboxLifecycleLock(sandboxName, runLocked); + }); + } catch (error) { + if ( + fencedOperationStarted || + !(error instanceof Error) || + error.message !== PORTABLE_HOST_FENCE_BUSY_MESSAGE + ) { + throw error; + } + if (!canUseUnlockedSandboxStatusRead(sandboxName)) { + throw new Error( + "Another NemoClaw lifecycle operation is in progress on this host. Wait for it to finish, then retry status.", + { cause: error }, + ); + } + return await withUnlockedSandboxStatusRead(runLocked); + } + } return await withSandboxLifecycleLock(sandboxName, runLocked); } diff --git a/src/lib/state/portable-uninstall-retirement.ts b/src/lib/state/portable-uninstall-retirement.ts index e1b8612850b..513f606c17e 100644 --- a/src/lib/state/portable-uninstall-retirement.ts +++ b/src/lib/state/portable-uninstall-retirement.ts @@ -106,6 +106,8 @@ const tails = new Map>(); export const portableHostFencePath = (homeDir: string): string => path.join(homeDir, ".nemoclaw-portable-host.lock"); +export const PORTABLE_HOST_FENCE_BUSY_MESSAGE = + "Host maintenance is in progress. Retry this command after it completes."; /** Require the current asynchronous operation to own the exact Portable host fence. */ export function assertCurrentPortableHostFenceHeld(homeDir: string): void { @@ -243,7 +245,7 @@ export async function withPortableHostFenceTry( } } if (tails.has(lockPath)) { - throw new Error("Host maintenance is in progress. Retry this command after it completes."); + throw new Error(PORTABLE_HOST_FENCE_BUSY_MESSAGE); } let finish!: () => void; @@ -254,7 +256,7 @@ export async function withPortableHostFenceTry( try { const handle = tryAcquireProcessBoundLockAt(lockPath); if (!handle) { - throw new Error("Host maintenance is in progress. Retry this command after it completes."); + throw new Error(PORTABLE_HOST_FENCE_BUSY_MESSAGE); } let resolveDrained!: () => void; const drained = new Promise((resolve) => (resolveDrained = resolve)); From aa6e7fdabf2ea212e4bde9093227d749d9bc6f66 Mon Sep 17 00:00:00 2001 From: Yimo Jiang Date: Mon, 12 Oct 2026 02:27:02 +0000 Subject: [PATCH 02/17] test(status): update unlocked status helper import Signed-off-by: Yimo Jiang --- src/lib/cli/nemoclaw-oclif-command.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/cli/nemoclaw-oclif-command.test.ts b/src/lib/cli/nemoclaw-oclif-command.test.ts index 20959fcdea6..1a504b0f0fa 100644 --- a/src/lib/cli/nemoclaw-oclif-command.test.ts +++ b/src/lib/cli/nemoclaw-oclif-command.test.ts @@ -11,7 +11,7 @@ import { launchSandbox } from "../actions/sandbox/launch"; import * as portableAgentLifecycle from "../onboard/experimental/portable-agent-lifecycle"; import * as receiptAuthority from "../onboard/experimental/hermes-portable-receipt"; import * as portableHostAuthority from "../state/portable-uninstall-retirement"; -import { isUnlockedSandboxStatusRead } from "../actions/sandbox/status-read-context"; +import { isUnlockedSandboxStatusRead } from "../actions/sandbox/status-snapshot"; import { acquireProcessBoundLockAt, releaseProcessBoundLock } from "../state/registry/lock"; import { isMcpLifecycleLockHeld, From ed8c1e63365cd94756d4b58bb3d9f5b8d81c7d99 Mon Sep 17 00:00:00 2001 From: Yimo Jiang Date: Mon, 12 Oct 2026 02:39:45 +0000 Subject: [PATCH 03/17] fix(status): keep unlocked gateway probes read-only Signed-off-by: Yimo Jiang --- .../sandbox/status-snapshot-recovery.test.ts | 50 ++++++++++++++++++- src/lib/actions/sandbox/status-snapshot.ts | 8 +-- src/lib/cli/nemoclaw-oclif-command.test.ts | 25 ++++++++++ 3 files changed, 79 insertions(+), 4 deletions(-) diff --git a/src/lib/actions/sandbox/status-snapshot-recovery.test.ts b/src/lib/actions/sandbox/status-snapshot-recovery.test.ts index 866d63ea01a..43078a8e965 100644 --- a/src/lib/actions/sandbox/status-snapshot-recovery.test.ts +++ b/src/lib/actions/sandbox/status-snapshot-recovery.test.ts @@ -10,7 +10,12 @@ import { describe, expect, it, vi } from "vitest"; import type { SandboxEntry } from "../../state/registry"; import type { SandboxInferenceRouteHealth } from "./inference-route-health"; import type { SandboxStatusPreflightResult } from "./status-preflight"; -import { collectSandboxStatusSnapshot, getSandboxStatusReport } from "./status-snapshot"; +import * as gatewayState from "./gateway-state"; +import { + collectSandboxStatusSnapshot, + getSandboxStatusReport, + withUnlockedSandboxStatusRead, +} from "./status-snapshot"; const sandbox: SandboxEntry = { name: "alpha", @@ -177,6 +182,49 @@ describe("collectSandboxStatusSnapshot Docker recovery", () => { } }); + it("keeps unlocked status observations free of gateway and recovery mutations (#11903)", async () => { + const lookup = { + state: "present" as const, + phase: "Ready", + output: "Phase: Ready", + recoveredSandbox: true, + }; + const reconcile = vi + .spyOn(gatewayState, "getReconciledSandboxGatewayState") + .mockResolvedValue(lookup as never); + const { reconcile: _defaultReconcile, ...baseDeps } = snapshotDeps({ + checked: true, + wasRunning: false, + recovered: true, + forwardRecovered: true, + }); + const recordSandboxStopIntent = vi.fn(() => false); + const deps = { ...baseDeps, recordSandboxStopIntent }; + + try { + await withUnlockedSandboxStatusRead(() => + collectSandboxStatusSnapshot("alpha", { + sandboxEntry: { ...sandbox, stopped: true }, + preflight: clearPreflight, + suppressInferenceProbe: true, + deps, + }), + ); + + expect(reconcile).toHaveBeenCalledWith( + "alpha", + expect.objectContaining({ + gatewayRecovery: "observe", + selectOwningGateway: false, + }), + ); + expect(recordSandboxStopIntent).not.toHaveBeenCalled(); + expect(deps.recoverSandboxProcesses).not.toHaveBeenCalled(); + } finally { + reconcile.mockRestore(); + } + }); + it("leaves agent delivery recovery to the native image runtime", async () => { const deps = { ...snapshotDeps({ diff --git a/src/lib/actions/sandbox/status-snapshot.ts b/src/lib/actions/sandbox/status-snapshot.ts index 9bbb6d7e429..9fccd18ccac 100644 --- a/src/lib/actions/sandbox/status-snapshot.ts +++ b/src/lib/actions/sandbox/status-snapshot.ts @@ -489,9 +489,11 @@ export async function collectSandboxStatusSnapshot( ((name: string) => getReconciledSandboxGatewayState(name, { getState: getSandboxGatewayStateForStatus, - ...(isUnlockedSandboxStatusRead() || initialPreflight?.intentionalStopConfirmed - ? { gatewayRecovery: "observe" as const } - : {}), + ...(isUnlockedSandboxStatusRead() + ? { gatewayRecovery: "observe" as const, selectOwningGateway: false } + : initialPreflight?.intentionalStopConfirmed + ? { gatewayRecovery: "observe" as const } + : {}), })); let lookup: SandboxGatewayState; try { diff --git a/src/lib/cli/nemoclaw-oclif-command.test.ts b/src/lib/cli/nemoclaw-oclif-command.test.ts index 1a504b0f0fa..1d6039b102a 100644 --- a/src/lib/cli/nemoclaw-oclif-command.test.ts +++ b/src/lib/cli/nemoclaw-oclif-command.test.ts @@ -91,6 +91,16 @@ class ParsedUnsupportedSandboxCommand extends NemoClawCommand { } } +class GlobalStatusReadCommand extends NemoClawCommand { + static id = "status"; + static flags = {}; + static operation: () => Promise = async () => undefined; + + public async run(): Promise { + await GlobalStatusReadCommand.operation(); + } +} + class ParsedSupportedSandboxCommand extends NemoClawCommand { static id = "sandbox:status"; static args = { sandboxName: Args.string({ required: true }) }; @@ -243,6 +253,7 @@ describe("NemoClawCommand", () => { RawSandboxDoctorCommand.ran = false; ParsedUnsupportedSandboxCommand.ran = false; ParsedSupportedSandboxCommand.operation = async () => undefined; + GlobalStatusReadCommand.operation = async () => undefined; GlobalUnsupportedMutationCommand.ran = false; GlobalUseMutationCommand.ran = false; ProbeOnlyConnectCommand.operation = async () => undefined; @@ -287,6 +298,20 @@ describe("NemoClawCommand", () => { expect(portableHostAuthority.withCurrentPortableHostFenceTry).toHaveBeenCalledOnce(); }); + it("fails fast for global status when the portable host fence is busy", async () => { + const fence = acquireProcessBoundLockAt(portableHostAuthority.portableHostFencePath(stateDir)); + const operation = vi.fn(async () => undefined); + GlobalStatusReadCommand.operation = operation; + try { + await expect(GlobalStatusReadCommand.run([], process.cwd())).rejects.toThrow( + portableHostAuthority.PORTABLE_HOST_FENCE_BUSY_MESSAGE, + ); + expect(operation).not.toHaveBeenCalled(); + } finally { + releaseProcessBoundLock(fence); + } + }); + it("records status-like command results without throwing", () => { makeCommand().apply({ status: 7 }); From a4895af5e1934c0a05a4d059ff9514200d0b4544 Mon Sep 17 00:00:00 2001 From: Yimo Jiang Date: Mon, 12 Oct 2026 02:55:45 +0000 Subject: [PATCH 04/17] test(status): cover unlocked lifecycle guards Signed-off-by: Yimo Jiang --- src/lib/actions/sandbox/status-flow.test.ts | 18 ++++++++++++++++ src/lib/cli/nemoclaw-oclif-command.test.ts | 24 +++++++++++++++++++++ test/support/status-flow-test-harness.ts | 15 +++++++++++++ 3 files changed, 57 insertions(+) diff --git a/src/lib/actions/sandbox/status-flow.test.ts b/src/lib/actions/sandbox/status-flow.test.ts index 46691c518db..6ec9232e449 100644 --- a/src/lib/actions/sandbox/status-flow.test.ts +++ b/src/lib/actions/sandbox/status-flow.test.ts @@ -77,6 +77,24 @@ describe("showSandboxStatus flow", () => { }, ); + it("skips lifecycle locking and Hermes broker setup for unlocked status (#11903)", async () => { + const withMcpLifecycleLock = vi.fn(async () => { + throw new Error("unlocked status unexpectedly requested the lifecycle lock"); + }); + const harness = createStatusFlowHarness({ + mockHermesToolGatewayBroker: true, + portableDisposition: { kind: "openclaw" }, + sandboxEntry: { agent: "hermes", hermesToolGateways: [{}] } as never, + withMcpLifecycleLock, + }); + + await harness.withUnlockedSandboxStatusRead(() => harness.showSandboxStatus("alpha")); + + expect(harness.withMcpLifecycleLockSpy).not.toHaveBeenCalled(); + expect(harness.ensureHermesToolGatewayBrokerSpy).not.toBeNull(); + expect(harness.ensureHermesToolGatewayBrokerSpy).not.toHaveBeenCalled(); + }); + it("rejects malformed portable receipt authority before status probes (#9203)", async () => { const harness = createStatusFlowHarness({ portableDisposition: new Error("invalid portable lifecycle receipt"), diff --git a/src/lib/cli/nemoclaw-oclif-command.test.ts b/src/lib/cli/nemoclaw-oclif-command.test.ts index 1d6039b102a..59eaa0eefe4 100644 --- a/src/lib/cli/nemoclaw-oclif-command.test.ts +++ b/src/lib/cli/nemoclaw-oclif-command.test.ts @@ -11,6 +11,7 @@ import { launchSandbox } from "../actions/sandbox/launch"; import * as portableAgentLifecycle from "../onboard/experimental/portable-agent-lifecycle"; import * as receiptAuthority from "../onboard/experimental/hermes-portable-receipt"; import * as portableHostAuthority from "../state/portable-uninstall-retirement"; +import * as registryCrossPort from "../state/registry/cross-port"; import { isUnlockedSandboxStatusRead } from "../actions/sandbox/status-snapshot"; import { acquireProcessBoundLockAt, releaseProcessBoundLock } from "../state/registry/lock"; import { @@ -298,6 +299,29 @@ describe("NemoClawCommand", () => { expect(portableHostAuthority.withCurrentPortableHostFenceTry).toHaveBeenCalledOnce(); }); + it("fails closed when registry-only portable authority is present (#11903)", async () => { + vi.spyOn(portableHostAuthority, "withCurrentPortableHostFenceTry").mockRejectedValue( + new Error(portableHostAuthority.PORTABLE_HOST_FENCE_BUSY_MESSAGE), + ); + vi.spyOn(registryCrossPort, "findSandboxAcrossGatewayRoots").mockReturnValue({ + entry: { + name: "alpha", + agent: "hermes", + openshellDriver: "docker", + lifecycleGeneration: "generation-1", + } as never, + gatewayPort: 8091, + registryFile: "/test/sandboxes.json", + }); + const operation = vi.fn(async () => undefined); + ParsedSupportedSandboxCommand.operation = operation; + + await expect(ParsedSupportedSandboxCommand.run(["alpha"], process.cwd())).rejects.toThrow( + "Another NemoClaw lifecycle operation is in progress on this host.", + ); + expect(operation).not.toHaveBeenCalled(); + }); + it("fails fast for global status when the portable host fence is busy", async () => { const fence = acquireProcessBoundLockAt(portableHostAuthority.portableHostFencePath(stateDir)); const operation = vi.fn(async () => undefined); diff --git a/test/support/status-flow-test-harness.ts b/test/support/status-flow-test-harness.ts index 7f00f0e97ec..caac691dd77 100644 --- a/test/support/status-flow-test-harness.ts +++ b/test/support/status-flow-test-harness.ts @@ -24,6 +24,8 @@ type PortableAgentReceiptDisposition = ReturnType< >; type WithMcpLifecycleLock = (typeof import("../../src/lib/state/mcp-lifecycle-lock-acquisition"))["withMcpLifecycleLock"]; +type WithUnlockedSandboxStatusRead = + (typeof import("../../src/lib/actions/sandbox/status-snapshot"))["withUnlockedSandboxStatusRead"]; const requireDist = createRequire(import.meta.url); const statusModulePath = "../../src/lib/actions/sandbox/status.js"; @@ -45,6 +47,8 @@ export type StatusFlowHarness = { removeSandboxSpy: MockInstance; showSandboxStatus: ShowSandboxStatus; withMcpLifecycleLockSpy: MockInstance; + withUnlockedSandboxStatusRead: WithUnlockedSandboxStatusRead; + ensureHermesToolGatewayBrokerSpy: MockInstance | null; }; const baseSandboxEntry = { @@ -85,6 +89,7 @@ export type StatusFlowHarnessOptions = { registryEntry?: "present" | "missing"; publishedAcrossGatewayRoots?: boolean; withMcpLifecycleLock?: WithMcpLifecycleLock; + mockHermesToolGatewayBroker?: boolean; lookup?: SandboxGatewayState; lookupState?: "present" | "missing"; gatewayRunning?: boolean; @@ -305,6 +310,14 @@ export function createStatusFlowHarness(options: StatusFlowHarnessOptions = {}): logSpy.mockClear(); const statusModule = requireDist(statusModulePath); + const ensureHermesToolGatewayBrokerSpy = options.mockHermesToolGatewayBroker + ? vi + .spyOn( + requireDist("../../src/lib/hermes-tool-gateway-broker.js"), + "ensureHermesToolGatewayBrokerForSandboxEntry", + ) + .mockImplementation(() => undefined) + : null; return { checkAgentVersionSpy, @@ -318,5 +331,7 @@ export function createStatusFlowHarness(options: StatusFlowHarnessOptions = {}): removeSandboxSpy, showSandboxStatus: statusModule.showSandboxStatus, withMcpLifecycleLockSpy, + withUnlockedSandboxStatusRead: statusSnapshot.withUnlockedSandboxStatusRead, + ensureHermesToolGatewayBrokerSpy, } satisfies StatusFlowHarness; } From 6447ea910d7838e44833698c224cc7a096231c04 Mon Sep 17 00:00:00 2001 From: Yimo Jiang Date: Mon, 12 Oct 2026 03:41:29 +0000 Subject: [PATCH 05/17] fix(status): skip native profile checks in unlocked reads Signed-off-by: Yimo Jiang --- .../status-snapshot-route-drift.test.ts | 93 ++++++++++++++++++- src/lib/actions/sandbox/status-snapshot.ts | 8 +- 2 files changed, 99 insertions(+), 2 deletions(-) diff --git a/src/lib/actions/sandbox/status-snapshot-route-drift.test.ts b/src/lib/actions/sandbox/status-snapshot-route-drift.test.ts index 1e0f1d85cb6..c6e8d650fe1 100644 --- a/src/lib/actions/sandbox/status-snapshot-route-drift.test.ts +++ b/src/lib/actions/sandbox/status-snapshot-route-drift.test.ts @@ -18,7 +18,11 @@ import { } from "../../inference/llama-cpp/managed-state"; import { HOSTED_NATIVE_PROVIDERS } from "../../inference/native-provider/hosted"; import type { SandboxEntry } from "../../state/registry"; -import { collectSandboxStatusSnapshot, getSandboxStatusReport } from "./status-snapshot"; +import { + collectSandboxStatusSnapshot, + getSandboxStatusReport, + withUnlockedSandboxStatusRead, +} from "./status-snapshot"; const capture = vi.mocked(captureOpenshellForStatus); @@ -580,6 +584,93 @@ describe("collectSandboxStatusSnapshot inference invocation route (#9302)", () = }, ); + const hostedNative = HOSTED_NATIVE_PROVIDERS.find( + (definition) => definition.logicalProvider === "openai-api", + )!; + const unlockedNativeStatusEntries: { label: string; sandbox: SandboxEntry }[] = [ + { + label: "native NVIDIA", + sandbox: { + name: "alpha", + agent: "openclaw", + gatewayName: "nemoclaw", + provider: "nvidia-prod", + model: "nvidia/nemotron-3-super-120b-a12b", + preferredInferenceApi: "openai-completions", + nativeNvidiaProviderAttachment: { + schemaVersion: 1, + profileId: "nemoclaw-nvidia-inference-v1", + providerName: "nemoclaw-nvidia-prod-v1", + providerId: "provider-123", + }, + } as SandboxEntry, + }, + { + label: "native hosted", + sandbox: { + name: "alpha", + agent: "openclaw", + gatewayName: "nemoclaw", + provider: hostedNative.logicalProvider, + model: "selected-model", + nativeHostedProviderAttachment: { + schemaVersion: 1, + profileId: hostedNative.profileId, + providerName: hostedNative.providerName, + providerId: "native-provider-id", + }, + } as SandboxEntry, + }, + ]; + + it.each(unlockedNativeStatusEntries)( + "skips native provider profile verification for unlocked $label status (#11903)", + async ({ sandbox }) => { + const verifyNvidia = vi.fn(async () => undefined); + const verifyHosted = vi.fn(async () => undefined); + const healthy = { + ok: true, + endpoint: "https://inference.local/v1/models", + httpStatus: 200, + detail: "reachable", + }; + + await withUnlockedSandboxStatusRead(() => + collectSandboxStatusSnapshot("alpha", { + sandboxEntry: sandbox, + preflight: { + failure: null, + failureLayer: null, + suppressInferenceProbe: false, + exitCode: 0, + }, + deps: { + getSandbox: () => sandbox, + listPublishedSandboxesAcrossGatewayRoots: () => [sandbox], + reconcile: async () => ({ + state: "present" as const, + phase: "Ready", + output: "Phase: Ready", + }), + inferenceRouteObserver: { + observeInferenceRoute: async () => { + throw new Error("native status should not observe the shared route"); + }, + }, + probeProviderHealthImpl: () => null, + probeSandboxInferenceGatewayHealthImpl: async () => healthy, + probeSandboxInferenceInvocationImpl: async () => ({ ok: true }) as const, + verifyNativeNvidiaProviderAttachmentImpl: verifyNvidia, + verifyNativeHostedProviderAttachmentImpl: verifyHosted, + }, + }), + ); + + expect(verifyNvidia).not.toHaveBeenCalled(); + expect(verifyHosted).not.toHaveBeenCalled(); + }, + ); + it.each(["malformed", "mismatched", "live identity changed"])( "refuses %s native hosted authority without falling back", async (failure) => { diff --git a/src/lib/actions/sandbox/status-snapshot.ts b/src/lib/actions/sandbox/status-snapshot.ts index 9fccd18ccac..02e907c008e 100644 --- a/src/lib/actions/sandbox/status-snapshot.ts +++ b/src/lib/actions/sandbox/status-snapshot.ts @@ -634,7 +634,13 @@ export async function collectSandboxStatusSnapshot( // as drift instead of being mislabeled as this sandbox's configuration. const currentModel = sb ? sb.model || "unknown" : (live && live.model) || "unknown"; const currentProvider = sb ? sb.provider || "unknown" : (live && live.provider) || "unknown"; - if (!suppressInferenceProbe && lookup.state === "present" && nativeProvider && sb) { + if ( + !isUnlockedSandboxStatusRead() && + !suppressInferenceProbe && + lookup.state === "present" && + nativeProvider && + sb + ) { const expected = nativeAttachment; if (!gatewayName || !expected) { nativeAttachmentFailure = From 662b8f00c3b1d11d7965a07117a5e9bdb66ae80c Mon Sep 17 00:00:00 2001 From: Yimo Jiang Date: Mon, 12 Oct 2026 04:38:41 +0000 Subject: [PATCH 06/17] test(cli): cover nonblocking global status fence Signed-off-by: Yimo Jiang --- src/commands/global-oclif-command-adapters.test.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/commands/global-oclif-command-adapters.test.ts b/src/commands/global-oclif-command-adapters.test.ts index 8b8810b290e..fe178733269 100644 --- a/src/commands/global-oclif-command-adapters.test.ts +++ b/src/commands/global-oclif-command-adapters.test.ts @@ -21,6 +21,7 @@ const mocks = vi.hoisted(() => ({ async (homeOrOperation: string | (() => unknown), operation?: () => unknown) => (typeof homeOrOperation === "function" ? homeOrOperation : operation)?.(), ), + withPortableHostFenceTry: vi.fn(async (operation: () => unknown) => operation()), showStatusCommand: vi.fn(), onboardRuntimeDeps: { googlechatTunnelRuntime: {} }, })); @@ -51,6 +52,7 @@ vi.mock("../lib/state/portable-uninstall-retirement", async (importOriginal) => ...(await importOriginal()), assertNoHermesPortableHostAuthority: mocks.assertNoHermesPortableHostAuthority, withCurrentPortableHostFence: mocks.withPortableHostFence, + withCurrentPortableHostFenceTry: mocks.withPortableHostFenceTry, withPortableHostFence: mocks.withPortableHostFence, })); @@ -186,7 +188,8 @@ describe("global oclif command adapters", () => { it("runs status through status helpers", async () => { await StatusCommand.run([], rootDir); - expect(mocks.withPortableHostFence).toHaveBeenCalledOnce(); + expect(mocks.withPortableHostFenceTry).toHaveBeenCalledOnce(); + expect(mocks.withPortableHostFence).not.toHaveBeenCalled(); expect(mocks.assertNoHermesPortableHostAuthority).not.toHaveBeenCalled(); expect(mocks.buildStatusCommandDeps).toHaveBeenCalledWith(rootDir); expect(mocks.showStatusCommand).toHaveBeenCalledWith({ statusDeps: true }); From ff07e978c6547585311d2acc97aa5ad8e6000a51 Mon Sep 17 00:00:00 2001 From: Yimo Jiang Date: Mon, 12 Oct 2026 06:03:32 +0000 Subject: [PATCH 07/17] fix(status): suppress probes during unlocked reads --- docs/reference/commands.mdx | 14 +++- .../global-oclif-command-adapters.test.ts | 5 +- src/lib/actions/sandbox/status-flow.test.ts | 31 +++++++- .../status-snapshot-route-drift.test.ts | 78 ++++++++++++++++--- src/lib/actions/sandbox/status-snapshot.ts | 7 +- src/lib/actions/sandbox/status-text.ts | 18 ++--- src/lib/actions/sandbox/status.ts | 21 ++--- src/lib/cli/nemoclaw-oclif-command.test.ts | 42 ++++++++-- src/lib/cli/nemoclaw-oclif-command.ts | 13 +++- 9 files changed, 181 insertions(+), 48 deletions(-) diff --git a/docs/reference/commands.mdx b/docs/reference/commands.mdx index dc426c134c2..32006927c61 100644 --- a/docs/reference/commands.mdx +++ b/docs/reference/commands.mdx @@ -1692,7 +1692,7 @@ nonzero. A stopped runtime without recorded stop intent remains a For a `compatible-endpoint` route that uses `openai-completions`, the text output prints `Reasoning effort` as `low`, `medium`, `high`, or `endpoint-default`. The line is omitted for another provider or API family. -Pass `--json` to emit a structured per-sandbox report instead of the text renderer. The JSON output includes at least `schemaVersion`, `name`, `found`, `agent`, `agentDisplayName`, `agentRuntime`, `dcodeAutoApprovalMode`, `model`, `provider`, `recordedRoute`, `liveRoute`, `routeDrift`, `phase`, `gatewayState`, `inferenceHealth`, `rpcIssue`, `hostGpuDetected`, `sandboxGpuEnabled`, `sandboxGpuMode`, `sandboxGpuDevice`, `openshellDriver`, `openshellVersion`, `policies`, `policiesAvailable`, `llamaCpp`, `failureLayer`, `terminalRuntimeHealth`, `servingProcessHealth`, and `dockerPaused`. `policies` is derived from the current OpenShell policy; NemoClaw does not persist a second preset list or baseline-exclusion ledger. `policiesAvailable` is `false` when that live policy cannot be read or parsed, distinguishing an unavailable result from a verified empty `policies` array; text status prints `Policies: unavailable` for the same state. When the live gateway route matches the sandbox's recorded llama.cpp route, `llamaCpp.kind` is `attached`, `managed`, or `unavailable`. An attached route also includes its fixed loopback `llamaCpp.endpointUrl`. An unavailable result means NemoClaw could not safely verify the managed ownership receipt; it does not include an endpoint and provides a secret-free diagnostic and recovery action. During route drift, `status` omits the `llamaCpp` route attribution; inspect `routeDrift` before acting on endpoint information. Text status can still show managed-runtime details from the sandbox-owned receipt. The schema-version `1` `model` and `provider` fields keep their established live-route meaning when the gateway route is readable, except that sandboxes with native NVIDIA or fixed hosted provider attachments report their recorded sandbox-scoped route because the shared route is unrelated. Use `recordedRoute` for the sandbox's durable provider and model and `liveRoute` for the gateway-global route. When the live shared route differs for a shared-route provider, text output prints both routes and JSON output sets `routeDrift.live`, `routeDrift.recorded`, and `routeDrift.canConnect`. Native NVIDIA and fixed hosted provider attachments do not report shared-route drift. When `routeDrift.canConnect` is `false`, `connect` cannot safely restore the recorded route because provider-global identity differs or required route or gateway metadata is incomplete. Refer to [Use Shared Gateway Routes](../inference/manage-inference/use-shared-gateway-routes) for the route-sharing workflow. `openshellDriver` and `openshellVersion` are always strings (falling back to `"unknown"` when the registry has no value), so consumers can rely on `typeof` checks. `agent` is always a string and reports `openclaw` when the registry records no agent for the sandbox. `failureLayer` is `null` when no preflight failure was detected and otherwise one of `docker_unreachable`, `sandbox_container_stopped`, or `sandbox_dashboard_port_conflict`; when set, `inferenceHealth` is suppressed to `null` so automation does not see a stale remote-provider healthy status during a local outage. `inferenceHealth.ok` reports whether the selected provider path returned a structurally valid result for one request sent from inside the sandbox. The result must match Chat Completions, Responses, or Anthropic Messages for the selected route. An empty body, malformed JSON, provider-error envelope, or wrong response shape reports `unhealthy`, even with a 2xx status. The probe captures at most 64 KiB and does not include the response body in diagnostics. The path probe treats any final HTTP status from `200` through `499` as reachable, so a route with an invalidated provider credential answers HTTP `401` while the path is up. Shared-route requests use the live gateway route's provider and model, then fall back to the recorded values when the live route is unreadable. Native NVIDIA and hosted requests always use the sandbox's recorded provider and model. When the live shared provider matches the recorded provider, the request uses the sandbox's recorded API family, even when only the model differs. This includes `openai-responses`. When the live shared provider differs, NemoClaw does not carry the recorded API family to that provider. Each attempt requests 16 reply tokens for ordinary providers or 256 for Gemini. The request allows up to 90 seconds, and the host wrapper allows 95 seconds for bounded process startup and cleanup. Hosted requests consume provider tokens on every attempt. When the inference request returns HTTP `429`, `502`, `503`, or `504`, `status` retries the provider path and inference request together up to three total attempts, with a two-second delay between failed attempts, because those statuses are transient gateway and availability answers rather than evidence that the path is broken. Before each retry, it writes the failed probe boundary, an HTTP status when one is available, the next attempt, total attempts, and delay to stderr; `--json` keeps stdout machine-readable. On an ordinary run, every other failure is final on the first attempt with no delay: HTTP `401`, `403`, `404`, and `500`, an invalid 2xx response body, a request that returned no HTTP status, and a failing provider-path probe. When the same run recovers a managed gateway, `status` retries any failed route or inference probe on that schedule instead, while the restarted delivery chain settles. Each route probe has a 10-second timeout. Three complete route probes plus their 95-second inference wrappers and two delays can take about 319 seconds. When NemoClaw sends an inference request, `inferenceHealth.subprobes` reports the provider-path result as the `route reachability` hop, so a failing verdict still shows that the path itself answered. `inferenceHealth.failureLabel` reports why the inference request failed: +Pass `--json` to emit a structured per-sandbox report instead of the text renderer. The JSON output includes at least `schemaVersion`, `name`, `found`, `agent`, `agentDisplayName`, `agentRuntime`, `dcodeAutoApprovalMode`, `model`, `provider`, `recordedRoute`, `liveRoute`, `routeDrift`, `phase`, `gatewayState`, `inferenceHealth`, `inferenceProbeSuppressed`, `rpcIssue`, `hostGpuDetected`, `sandboxGpuEnabled`, `sandboxGpuMode`, `sandboxGpuDevice`, `openshellDriver`, `openshellVersion`, `policies`, `policiesAvailable`, `llamaCpp`, `failureLayer`, `terminalRuntimeHealth`, `servingProcessHealth`, and `dockerPaused`. `policies` is derived from the current OpenShell policy; NemoClaw does not persist a second preset list or baseline-exclusion ledger. `policiesAvailable` is `false` when that live policy cannot be read or parsed, distinguishing an unavailable result from a verified empty `policies` array; text status prints `Policies: unavailable` for the same state. When the live gateway route matches the sandbox's recorded llama.cpp route, `llamaCpp.kind` is `attached`, `managed`, or `unavailable`. An attached route also includes its fixed loopback `llamaCpp.endpointUrl`. An unavailable result means NemoClaw could not safely verify the managed ownership receipt; it does not include an endpoint and provides a secret-free diagnostic and recovery action. During route drift, `status` omits the `llamaCpp` route attribution; inspect `routeDrift` before acting on endpoint information. Text status can still show managed-runtime details from the sandbox-owned receipt. The schema-version `1` `model` and `provider` fields keep their established live-route meaning when the gateway route is readable, except that sandboxes with native NVIDIA or fixed hosted provider attachments report their recorded sandbox-scoped route because the shared route is unrelated. Use `recordedRoute` for the sandbox's durable provider and model and `liveRoute` for the gateway-global route. When the live shared route differs for a shared-route provider, text output prints both routes and JSON output sets `routeDrift.live`, `routeDrift.recorded`, and `routeDrift.canConnect`. Native NVIDIA and fixed hosted provider attachments do not report shared-route drift. When `routeDrift.canConnect` is `false`, `connect` cannot safely restore the recorded route because provider-global identity differs or required route or gateway metadata is incomplete. Refer to [Use Shared Gateway Routes](../inference/manage-inference/use-shared-gateway-routes) for the route-sharing workflow. `openshellDriver` and `openshellVersion` are always strings (falling back to `"unknown"` when the registry has no value), so consumers can rely on `typeof` checks. `agent` is always a string and reports `openclaw` when the registry records no agent for the sandbox. `failureLayer` is `null` when no preflight failure was detected and otherwise one of `docker_unreachable`, `sandbox_container_stopped`, or `sandbox_dashboard_port_conflict`; when set, `inferenceHealth` is suppressed to `null` so automation does not see a stale remote-provider healthy status during a local outage. `inferenceHealth.ok` reports whether the selected provider path returned a structurally valid result for one request sent from inside the sandbox. The result must match Chat Completions, Responses, or Anthropic Messages for the selected route. An empty body, malformed JSON, provider-error envelope, or wrong response shape reports `unhealthy`, even with a 2xx status. The probe captures at most 64 KiB and does not include the response body in diagnostics. The path probe treats any final HTTP status from `200` through `499` as reachable, so a route with an invalidated provider credential answers HTTP `401` while the path is up. Shared-route requests use the live gateway route's provider and model, then fall back to the recorded values when the live route is unreadable. Native NVIDIA and hosted requests always use the sandbox's recorded provider and model. When the live shared provider matches the recorded provider, the request uses the sandbox's recorded API family, even when only the model differs. This includes `openai-responses`. When the live shared provider differs, NemoClaw does not carry the recorded API family to that provider. Each attempt requests 16 reply tokens for ordinary providers or 256 for Gemini. The request allows up to 90 seconds, and the host wrapper allows 95 seconds for bounded process startup and cleanup. Hosted requests consume provider tokens on every attempt. When the inference request returns HTTP `429`, `502`, `503`, or `504`, `status` retries the provider path and inference request together up to three total attempts, with a two-second delay between failed attempts, because those statuses are transient gateway and availability answers rather than evidence that the path is broken. Before each retry, it writes the failed probe boundary, an HTTP status when one is available, the next attempt, total attempts, and delay to stderr; `--json` keeps stdout machine-readable. On an ordinary run, every other failure is final on the first attempt with no delay: HTTP `401`, `403`, `404`, and `500`, an invalid 2xx response body, a request that returned no HTTP status, and a failing provider-path probe. When the same run recovers a managed gateway, `status` retries any failed route or inference probe on that schedule instead, while the restarted delivery chain settles. Each route probe has a 10-second timeout. Three complete route probes plus their 95-second inference wrappers and two delays can take about 319 seconds. When NemoClaw sends an inference request, `inferenceHealth.subprobes` reports the provider-path result as the `route reachability` hop, so a failing verdict still shows that the path itself answered. `inferenceHealth.failureLabel` reports why the inference request failed: - `unauthorized` when the route rejected it with HTTP `401` or `403`. - `unhealthy` when the route returned another failing HTTP status or an invalid 2xx response body. @@ -1725,7 +1725,8 @@ $$nemoclaw my-assistant status --json $$nemoclaw sandbox status my-assistant --json ``` -The command probes the selected provider path from inside the sandbox, and when that probe reports the path reachable it sends an inference request over the same path. 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. That inference request is the authoritative inference health check, and both checks exercise the path that agent traffic uses. The main `Inference` line reports one of these states: +On a normal status read, the command probes the selected provider path from inside the sandbox. +When that probe reports the path reachable, it sends an inference request over the same path. 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. That inference request is the authoritative inference health check, and both checks exercise the path that agent traffic uses. The main `Inference` line reports one of these states: | State | Meaning | | -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -1737,6 +1738,13 @@ The command probes the selected provider path from inside the sandbox, and when | `not probed` | NemoClaw could not run the authoritative route probe from a reachable sandbox. | | `not verified` | NemoClaw could not verify the sandbox or gateway state, so it skips inference probing. | +When another lifecycle operation is in progress and NemoClaw confirms that no Portable authority exists, status returns a best-effort, read-only snapshot that can show transitional state. +It does not run inference health checks or send an inference request. +It does not repair the gateway, host forward, stop-intent record, or Hermes tool gateway broker. +JSON output sets `inferenceProbeSuppressed` to `true`. +If NemoClaw finds or cannot rule out Portable authority, status fails fast. +If Portable authority appears during the snapshot, status reports a lifecycle conflict after it finishes the snapshot. + An authentication response on a shared gateway route probe confirms that the route is reachable, not that provider credentials are valid. For those shared routes, `$$nemoclaw doctor` sends no inference request, so it reports an HTTP `401` or `403` route response as reachable and exits `0` where `status` reports `unauthorized`. Native hosted doctor checks verify the recorded provider identity and sandbox attachment, then require a successful inference request through the selected native endpoint. The native NVIDIA doctor probe verifies the sandbox-attached provider directly and requires a 2xx response. The command can also print direct host-side provider checks such as `Inference (upstream)` and provider-specific subprobes. For supported remote providers, this diagnostic sends an authenticated request to the configured model and accepts only a recognized Chat Completions, streaming Chat Completions, or Anthropic Messages response. It uses a 3-second connection timeout, a 5-second total timeout, and an 8-token output limit. If the request reaches the time limit, NemoClaw reports the provider as `not probed` and leaves model health unverified instead of reporting it as unhealthy. These checks are diagnostic only and do not override the authoritative selected-provider result or determine the command exit status. The `Inference (upstream)` check authenticates with the host credential that NemoClaw resolves for the provider, such as `NVIDIA_INFERENCE_API_KEY`. OpenShell stores the credential that the sandbox's selected provider path uses. The CLI cannot read the stored value back, so the two credentials can hold different secrets. When the managed sandbox path has already served the inference request, an `unauthorized` result on `Inference (upstream)` describes the host credential. NemoClaw then reports that check as `not probed` and names both credential sources. An `Inference (upstream)` check that fails for another reason, such as `unreachable`, still reports its own state. Local backend and auth proxy checks, such as `Inference (auth proxy)`, always report their own state and their own repair step. For a shared route, `$$nemoclaw doctor` sends no inference request, so it reports the `Inference (upstream)` state that it measured. @@ -1750,7 +1758,7 @@ When the sandbox's recorded driver is `docker` and the host Docker daemon is not When the host Docker daemon is reachable but the per-sandbox container is stopped without a matching intentional-stop record, the initial preflight records the `sandbox_container_stopped` failure layer and suppresses the host-side `Inference` probe. A matching intentional-stop record instead produces the clean `Stopped` result described above. If the owning OpenShell gateway is healthy but no longer lists the registered sandbox, status preserves the local registration and reports the missing OpenShell state without directly starting, unpausing, renaming, or replacing a container. -If OpenShell already reports the registered Docker-driver sandbox as present and `Ready`, status verifies the OpenClaw gateway and host forward. +When lifecycle locks are available and OpenShell reports the registered Docker-driver sandbox as present and `Ready`, status verifies the OpenClaw gateway and host forward. It recovers either component when the verification reports it absent. When status finds a running sandbox but cannot clear its stale intentional-stop record, it exits non-zero and reports the `stop_intent_update_failed` state. diff --git a/src/commands/global-oclif-command-adapters.test.ts b/src/commands/global-oclif-command-adapters.test.ts index fe178733269..8b8810b290e 100644 --- a/src/commands/global-oclif-command-adapters.test.ts +++ b/src/commands/global-oclif-command-adapters.test.ts @@ -21,7 +21,6 @@ const mocks = vi.hoisted(() => ({ async (homeOrOperation: string | (() => unknown), operation?: () => unknown) => (typeof homeOrOperation === "function" ? homeOrOperation : operation)?.(), ), - withPortableHostFenceTry: vi.fn(async (operation: () => unknown) => operation()), showStatusCommand: vi.fn(), onboardRuntimeDeps: { googlechatTunnelRuntime: {} }, })); @@ -52,7 +51,6 @@ vi.mock("../lib/state/portable-uninstall-retirement", async (importOriginal) => ...(await importOriginal()), assertNoHermesPortableHostAuthority: mocks.assertNoHermesPortableHostAuthority, withCurrentPortableHostFence: mocks.withPortableHostFence, - withCurrentPortableHostFenceTry: mocks.withPortableHostFenceTry, withPortableHostFence: mocks.withPortableHostFence, })); @@ -188,8 +186,7 @@ describe("global oclif command adapters", () => { it("runs status through status helpers", async () => { await StatusCommand.run([], rootDir); - expect(mocks.withPortableHostFenceTry).toHaveBeenCalledOnce(); - expect(mocks.withPortableHostFence).not.toHaveBeenCalled(); + expect(mocks.withPortableHostFence).toHaveBeenCalledOnce(); expect(mocks.assertNoHermesPortableHostAuthority).not.toHaveBeenCalled(); expect(mocks.buildStatusCommandDeps).toHaveBeenCalledWith(rootDir); expect(mocks.showStatusCommand).toHaveBeenCalledWith({ statusDeps: true }); diff --git a/src/lib/actions/sandbox/status-flow.test.ts b/src/lib/actions/sandbox/status-flow.test.ts index 6ec9232e449..7997094de2c 100644 --- a/src/lib/actions/sandbox/status-flow.test.ts +++ b/src/lib/actions/sandbox/status-flow.test.ts @@ -84,15 +84,44 @@ describe("showSandboxStatus flow", () => { const harness = createStatusFlowHarness({ mockHermesToolGatewayBroker: true, portableDisposition: { kind: "openclaw" }, - sandboxEntry: { agent: "hermes", hermesToolGateways: [{}] } as never, + sandboxEntry: { agent: "hermes", agentVersion: null, hermesToolGateways: [{}] } as never, withMcpLifecycleLock, }); await harness.withUnlockedSandboxStatusRead(() => harness.showSandboxStatus("alpha")); expect(harness.withMcpLifecycleLockSpy).not.toHaveBeenCalled(); + expect(harness.checkAgentVersionSpy).toHaveBeenCalledWith("alpha", { + forceProbe: false, + skipProbe: true, + }); expect(harness.ensureHermesToolGatewayBrokerSpy).not.toBeNull(); expect(harness.ensureHermesToolGatewayBrokerSpy).not.toHaveBeenCalled(); + const output = harness.logSpy.mock.calls.flat().join("\n"); + expect(output).toContain("Inference: not probed (another lifecycle operation is in progress)"); + expect(output).not.toContain("Inference: healthy"); + expect(output).not.toContain("ollama backend"); + }); + + it("skips lifecycle locking for unlocked JSON status reports (#11903)", async () => { + const withMcpLifecycleLock = vi.fn(async () => { + throw new Error("unlocked JSON status unexpectedly requested the lifecycle lock"); + }); + const harness = createStatusFlowHarness({ + portableDisposition: { kind: "openclaw" }, + withMcpLifecycleLock, + }); + + const report = await harness.withUnlockedSandboxStatusRead(() => + harness.getSandboxStatusReport("alpha"), + ); + + expect(report).toMatchObject({ + schemaVersion: 1, + name: "alpha", + inferenceProbeSuppressed: true, + }); + expect(harness.withMcpLifecycleLockSpy).not.toHaveBeenCalled(); }); it("rejects malformed portable receipt authority before status probes (#9203)", async () => { diff --git a/src/lib/actions/sandbox/status-snapshot-route-drift.test.ts b/src/lib/actions/sandbox/status-snapshot-route-drift.test.ts index c6e8d650fe1..a8b9dd39512 100644 --- a/src/lib/actions/sandbox/status-snapshot-route-drift.test.ts +++ b/src/lib/actions/sandbox/status-snapshot-route-drift.test.ts @@ -624,18 +624,14 @@ describe("collectSandboxStatusSnapshot inference invocation route (#9302)", () = ]; it.each(unlockedNativeStatusEntries)( - "skips native provider profile verification for unlocked $label status (#11903)", + "suppresses inference probes for unlocked native $label status (#11903)", async ({ sandbox }) => { const verifyNvidia = vi.fn(async () => undefined); const verifyHosted = vi.fn(async () => undefined); - const healthy = { - ok: true, - endpoint: "https://inference.local/v1/models", - httpStatus: 200, - detail: "reachable", - }; - - await withUnlockedSandboxStatusRead(() => + const providerProbe = vi.fn(() => ({ ok: true, probed: true })); + const gatewayProbe = vi.fn(async () => ({ ok: true, probed: true })); + const invocationProbe = vi.fn(async () => ({ ok: true }) as const); + const snapshot = await withUnlockedSandboxStatusRead(() => collectSandboxStatusSnapshot("alpha", { sandboxEntry: sandbox, preflight: { @@ -657,9 +653,9 @@ describe("collectSandboxStatusSnapshot inference invocation route (#9302)", () = throw new Error("native status should not observe the shared route"); }, }, - probeProviderHealthImpl: () => null, - probeSandboxInferenceGatewayHealthImpl: async () => healthy, - probeSandboxInferenceInvocationImpl: async () => ({ ok: true }) as const, + probeProviderHealthImpl: providerProbe as never, + probeSandboxInferenceGatewayHealthImpl: gatewayProbe as never, + probeSandboxInferenceInvocationImpl: invocationProbe, verifyNativeNvidiaProviderAttachmentImpl: verifyNvidia, verifyNativeHostedProviderAttachmentImpl: verifyHosted, }, @@ -668,9 +664,67 @@ describe("collectSandboxStatusSnapshot inference invocation route (#9302)", () = expect(verifyNvidia).not.toHaveBeenCalled(); expect(verifyHosted).not.toHaveBeenCalled(); + expect(providerProbe).not.toHaveBeenCalled(); + expect(gatewayProbe).not.toHaveBeenCalled(); + expect(invocationProbe).not.toHaveBeenCalled(); + expect(snapshot.inferenceHealth).toBeNull(); }, ); + it("suppresses shared-route health and invocation probes for unlocked status (#11903)", async () => { + const sandbox = { + name: "alpha", + agent: "openclaw", + gatewayName: "nemoclaw", + provider: "openai-api", + model: "selected-model", + } as SandboxEntry; + const providerProbe = vi.fn(); + const gatewayProbe = vi.fn(); + const invocationProbe = vi.fn(); + const observeInferenceRoute = vi.fn( + async () => + ({ + ok: true, + value: { + state: "configured", + route: { provider: "openai-api", model: "selected-model" }, + }, + }) as never, + ); + + const snapshot = await withUnlockedSandboxStatusRead(() => + collectSandboxStatusSnapshot("alpha", { + sandboxEntry: sandbox, + preflight: { + failure: null, + failureLayer: null, + suppressInferenceProbe: false, + exitCode: 0, + }, + deps: { + getSandbox: () => sandbox, + listPublishedSandboxesAcrossGatewayRoots: () => [sandbox], + reconcile: async () => ({ + state: "present" as const, + phase: "Ready", + output: "Phase: Ready", + }), + inferenceRouteObserver: { observeInferenceRoute }, + probeProviderHealthImpl: providerProbe, + probeSandboxInferenceGatewayHealthImpl: gatewayProbe, + probeSandboxInferenceInvocationImpl: invocationProbe, + }, + }), + ); + + expect(observeInferenceRoute).toHaveBeenCalledOnce(); + expect(providerProbe).not.toHaveBeenCalled(); + expect(gatewayProbe).not.toHaveBeenCalled(); + expect(invocationProbe).not.toHaveBeenCalled(); + expect(snapshot.inferenceHealth).toBeNull(); + }); + it.each(["malformed", "mismatched", "live identity changed"])( "refuses %s native hosted authority without falling back", async (failure) => { diff --git a/src/lib/actions/sandbox/status-snapshot.ts b/src/lib/actions/sandbox/status-snapshot.ts index 02e907c008e..525eaeec4cc 100644 --- a/src/lib/actions/sandbox/status-snapshot.ts +++ b/src/lib/actions/sandbox/status-snapshot.ts @@ -207,6 +207,8 @@ export interface SandboxStatusReport { portableLifecyclePhase?: "pending" | "configuring" | "active"; gatewayState: string; inferenceHealth: ProviderHealthStatus | null; + /** True when host-fence contention suppresses inference-health and invocation probes. */ + inferenceProbeSuppressed?: boolean; rpcIssue: { kind: "image_drift" | "host_process_drift" | "protobuf_mismatch" } | null; hostGpuDetected: boolean; sandboxGpuEnabled: boolean; @@ -577,8 +579,9 @@ export async function collectSandboxStatusSnapshot( ) : undefined; const suppressInferenceProbe = - (postRecoveryPreflight ?? initialPreflight)?.suppressInferenceProbe ?? - opts.suppressInferenceProbe === true; + isUnlockedSandboxStatusRead() || + ((postRecoveryPreflight ?? initialPreflight)?.suppressInferenceProbe ?? + opts.suppressInferenceProbe === true); const nativeSelection = readNativeStatusSelection(sb); const { attachment: nativeAttachment, label: nativeLabel } = nativeSelection; let nativeAttachmentFailure = nativeSelection.failure; diff --git a/src/lib/actions/sandbox/status-text.ts b/src/lib/actions/sandbox/status-text.ts index 04c9f19cd07..fa103c98b15 100644 --- a/src/lib/actions/sandbox/status-text.ts +++ b/src/lib/actions/sandbox/status-text.ts @@ -44,6 +44,8 @@ export interface SandboxStatusTextContext extends Pick< | "servingProcessHealth" > { sandboxName: string; + unlockedStatusRead: boolean; + inferenceProbeSuppressed?: boolean; statusAgent: SandboxStatusAgentInfo; phase: string | null; } @@ -114,13 +116,14 @@ function printServingProcessHealth( } function printInferenceStatus(context: SandboxStatusTextContext): void { - if (context.inferenceHealth) { + if (context.inferenceProbeSuppressed) { + console.log(" Inference: not probed (another lifecycle operation is in progress)"); + } else if (context.inferenceHealth) { printInferenceProbeLine(context.inferenceHealth); for (const subprobe of context.inferenceHealth.subprobes ?? []) { printInferenceProbeLine(subprobe); } - } - if (context.lookup.state !== "present") { + } else if (context.lookup.state !== "present") { console.log(" Inference: not verified (gateway/sandbox state not verified)"); } printServingProcessHealth(context.statusAgent, context.servingProcessHealth); @@ -235,12 +238,9 @@ async function printAgentVersion( ): Promise { try { const { lookup, sandboxName, statusAgent } = context; - const shouldProbe = shouldProbeSandboxRuntimeVersion( - lookup, - context.phase, - sandbox, - statusAgent.agentRuntime, - ); + const shouldProbe = + !context.unlockedStatusRead && + shouldProbeSandboxRuntimeVersion(lookup, context.phase, sandbox, statusAgent.agentRuntime); const versionCheck = await sandboxVersion.checkAgentVersion(sandboxName, { forceProbe: shouldProbe, skipProbe: !shouldProbe, diff --git a/src/lib/actions/sandbox/status.ts b/src/lib/actions/sandbox/status.ts index d31018b0d23..1c7ccb87a4d 100644 --- a/src/lib/actions/sandbox/status.ts +++ b/src/lib/actions/sandbox/status.ts @@ -138,16 +138,16 @@ export async function getSandboxStatusReport( sandboxName: string, deps: Parameters[1] = {}, ): Promise { - const read = async () => { + const read = async (): Promise => { const hermesPortable = inspectHermesPortableStatus(sandboxName); - if (hermesPortable) { - return await hermesPortableStatusReport( - sandboxName, - hermesPortable, - deps.getGatewayPresets ?? getGatewayPresets, - ); - } - return getLegacySandboxStatusReport(sandboxName, { getGatewayPresets, ...deps }); + const report = hermesPortable + ? await hermesPortableStatusReport( + sandboxName, + hermesPortable, + deps.getGatewayPresets ?? getGatewayPresets, + ) + : await getLegacySandboxStatusReport(sandboxName, { getGatewayPresets, ...deps }); + return isUnlockedSandboxStatusRead() ? { ...report, inferenceProbeSuppressed: true } : report; }; return await withStatusLifecycleLock(sandboxName, read); } @@ -243,8 +243,11 @@ async function showLegacySandboxStatus(sandboxName: string): Promise { }); deferSandboxLifecycleExit(1); } + const unlockedStatusRead = isUnlockedSandboxStatusRead(); const textContext: SandboxStatusTextContext = { sandboxName, + unlockedStatusRead, + inferenceProbeSuppressed: unlockedStatusRead, sb, lookup, currentModel, diff --git a/src/lib/cli/nemoclaw-oclif-command.test.ts b/src/lib/cli/nemoclaw-oclif-command.test.ts index 59eaa0eefe4..1a112bf203e 100644 --- a/src/lib/cli/nemoclaw-oclif-command.test.ts +++ b/src/lib/cli/nemoclaw-oclif-command.test.ts @@ -282,6 +282,24 @@ describe("NemoClawCommand", () => { } }); + it("rejects an unlocked status read if portable authority appears before it completes (#11903)", async () => { + const fence = acquireProcessBoundLockAt(portableHostAuthority.portableHostFencePath(stateDir)); + const authorityDirectory = path.join(stateDir, "hermes-portable-lifecycle"); + const operation = vi.fn(async () => { + fs.mkdirSync(authorityDirectory, { mode: 0o700 }); + fs.writeFileSync(path.join(authorityDirectory, "receipt.json"), "authority\n"); + }); + ParsedSupportedSandboxCommand.operation = operation; + try { + await expect(ParsedSupportedSandboxCommand.run(["alpha"], process.cwd())).rejects.toThrow( + "Another NemoClaw lifecycle operation is in progress on this host.", + ); + expect(operation).toHaveBeenCalledOnce(); + } finally { + releaseProcessBoundLock(fence); + } + }); + it("fails fast rather than bypassing portable authority during status contention (#11903)", async () => { const authorityDirectory = path.join(stateDir, "hermes-portable-lifecycle"); fs.mkdirSync(authorityDirectory, { mode: 0o700 }); @@ -322,17 +340,29 @@ describe("NemoClawCommand", () => { expect(operation).not.toHaveBeenCalled(); }); - it("fails fast for global status when the portable host fence is busy", async () => { - const fence = acquireProcessBoundLockAt(portableHostAuthority.portableHostFencePath(stateDir)); + it("waits for the host fence before running global status", async () => { + let releaseFence!: () => void; + const fenceReady = new Promise((resolve) => { + releaseFence = resolve; + }); + const withFence = vi + .spyOn(portableHostAuthority, "withCurrentPortableHostFence") + .mockImplementation(async (operation) => { + await fenceReady; + return await operation(); + }); const operation = vi.fn(async () => undefined); GlobalStatusReadCommand.operation = operation; + + const status = GlobalStatusReadCommand.run([], process.cwd()); try { - await expect(GlobalStatusReadCommand.run([], process.cwd())).rejects.toThrow( - portableHostAuthority.PORTABLE_HOST_FENCE_BUSY_MESSAGE, - ); + await vi.waitFor(() => expect(withFence).toHaveBeenCalledOnce()); expect(operation).not.toHaveBeenCalled(); + releaseFence(); + await expect(status).resolves.toBeUndefined(); + expect(operation).toHaveBeenCalledOnce(); } finally { - releaseProcessBoundLock(fence); + releaseFence(); } }); diff --git a/src/lib/cli/nemoclaw-oclif-command.ts b/src/lib/cli/nemoclaw-oclif-command.ts index e6b5b0e337a..84bc6460657 100644 --- a/src/lib/cli/nemoclaw-oclif-command.ts +++ b/src/lib/cli/nemoclaw-oclif-command.ts @@ -199,7 +199,7 @@ export abstract class NemoClawCommand extends Command { const portablePolicy = typeof commandId === "string" ? classifyHermesPortableCommand(commandId, this.argv) : null; if (portablePolicy?.hostFence === "read" && !portablePolicy.helpRequested) { - return await withCurrentPortableHostFenceTry(() => super._run()); + return await withCurrentPortableHostFence(() => super._run()); } if ( typeof commandId === "string" && @@ -252,7 +252,16 @@ export abstract class NemoClawCommand extends Command { { cause: error }, ); } - return await withUnlockedSandboxStatusRead(runLocked); + return await withUnlockedSandboxStatusRead(async () => { + const result = await runLocked(); + if (!canUseUnlockedSandboxStatusRead(sandboxName)) { + throw new Error( + "Another NemoClaw lifecycle operation is in progress on this host. Wait for it to finish, then retry status.", + { cause: error }, + ); + } + return result; + }); } } return await withSandboxLifecycleLock(sandboxName, runLocked); From 6e4aabc0a926a5f2e6cdafe65217e14674b5c42f Mon Sep 17 00:00:00 2001 From: Yimo Jiang Date: Mon, 12 Oct 2026 07:38:56 +0000 Subject: [PATCH 08/17] fix(status): check host-wide portable authority Signed-off-by: Yimo Jiang --- src/lib/actions/sandbox/status-flow.test.ts | 59 +++++++++++++ src/lib/actions/sandbox/status.ts | 17 +++- src/lib/cli/nemoclaw-oclif-command.test.ts | 92 +++++++++++++++++++-- src/lib/cli/nemoclaw-oclif-command.ts | 74 +++++++++++------ test/support/status-flow-test-harness.ts | 16 ++++ 5 files changed, 224 insertions(+), 34 deletions(-) diff --git a/src/lib/actions/sandbox/status-flow.test.ts b/src/lib/actions/sandbox/status-flow.test.ts index 7997094de2c..ce28abaa97f 100644 --- a/src/lib/actions/sandbox/status-flow.test.ts +++ b/src/lib/actions/sandbox/status-flow.test.ts @@ -8,6 +8,7 @@ import path from "node:path"; import { afterEach, beforeEach, describe, expect, it, type MockInstance, vi } from "vitest"; import { + createRealMcpLifecycleLock, createStatusFlowHarness, resetStatusFlowModuleCache, } from "../../../../test/support/status-flow-test-harness"; @@ -103,6 +104,64 @@ describe("showSandboxStatus flow", () => { expect(output).not.toContain("ollama backend"); }); + it("skips managed llama.cpp readiness probes for unlocked status (#11903)", async () => { + const harness = createStatusFlowHarness({ portableDisposition: { kind: "openclaw" } }); + harness.inspectManagedLlamaCppStatusSpy.mockReturnValue({ + recipeId: "nemotron-mini", + modelDigest: "sha256:fixture", + imageReference: "nvcr.io/nvidia/llama-cpp:fixture", + endpoint: "https://inference.local/v1", + state: "running", + detail: "exact managed container is running and ready", + }); + + await harness.withUnlockedSandboxStatusRead(() => harness.showSandboxStatus("alpha")); + expect(harness.inspectManagedLlamaCppStatusSpy).not.toHaveBeenCalled(); + + await harness.showSandboxStatus("alpha"); + expect(harness.inspectManagedLlamaCppStatusSpy).toHaveBeenCalledOnce(); + expect(harness.logSpy.mock.calls.flat().join("\n")).toContain("Managed llama.cpp: running"); + }); + + it("does not wait on a held MCP lifecycle lock for unlocked text or JSON status (#11903)", async () => { + const withMcpLifecycleLock = createRealMcpLifecycleLock({ + pollIntervalMs: 1, + timeoutMs: 100, + }); + const harness = createStatusFlowHarness({ withMcpLifecycleLock }); + let releaseLock!: () => void; + let markLockHeld!: () => void; + const lockHeld = new Promise((resolve) => { + markLockHeld = resolve; + }); + const hold = new Promise((resolve) => { + releaseLock = resolve; + }); + const heldLock = withMcpLifecycleLock("alpha", async () => { + markLockHeld(); + await hold; + }); + + await lockHeld; + try { + const report = await harness.withUnlockedSandboxStatusRead(async () => { + const json = await harness.getSandboxStatusReport("alpha"); + await harness.showSandboxStatus("alpha"); + return json; + }); + + expect(report).toMatchObject({ + schemaVersion: 1, + name: "alpha", + inferenceProbeSuppressed: true, + }); + expect(harness.withMcpLifecycleLockSpy).not.toHaveBeenCalled(); + } finally { + releaseLock(); + await heldLock; + } + }); + it("skips lifecycle locking for unlocked JSON status reports (#11903)", async () => { const withMcpLifecycleLock = vi.fn(async () => { throw new Error("unlocked JSON status unexpectedly requested the lifecycle lock"); diff --git a/src/lib/actions/sandbox/status.ts b/src/lib/actions/sandbox/status.ts index 1c7ccb87a4d..3c3f922634e 100644 --- a/src/lib/actions/sandbox/status.ts +++ b/src/lib/actions/sandbox/status.ts @@ -170,6 +170,19 @@ function maybeEnsureHermesToolGatewayBroker(sb: registry.SandboxEntry | null): v } } +function getManagedLlamaCppStatusForDisplay( + sandboxName: string, + sandboxEntry: registry.SandboxEntry | null, + unlockedStatusRead: boolean, +) { + if (unlockedStatusRead) return null; + return inspectManagedLlamaCppStatus(sandboxName, { + ...(typeof sandboxEntry?.gatewayPort === "number" + ? { gatewayPort: sandboxEntry.gatewayPort } + : {}), + }); +} + export async function showSandboxStatus(sandboxName: string): Promise { let deferredExitCode: number | null = null; try { @@ -283,9 +296,7 @@ async function showLegacySandboxStatus(sandboxName: string): Promise { printDockerHealth(dockerRuntime); printNimStatus(sandboxName, sb); - const managedLlamaCpp = inspectManagedLlamaCppStatus(sandboxName, { - ...(typeof sb?.gatewayPort === "number" ? { gatewayPort: sb.gatewayPort } : {}), - }); + const managedLlamaCpp = getManagedLlamaCppStatusForDisplay(sandboxName, sb, unlockedStatusRead); if (managedLlamaCpp) { console.log(` Managed llama.cpp: ${managedLlamaCpp.state}`); console.log(` Recipe: ${managedLlamaCpp.recipeId}`); diff --git a/src/lib/cli/nemoclaw-oclif-command.test.ts b/src/lib/cli/nemoclaw-oclif-command.test.ts index 1a112bf203e..9bc7dd56b21 100644 --- a/src/lib/cli/nemoclaw-oclif-command.test.ts +++ b/src/lib/cli/nemoclaw-oclif-command.test.ts @@ -10,6 +10,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; import { launchSandbox } from "../actions/sandbox/launch"; import * as portableAgentLifecycle from "../onboard/experimental/portable-agent-lifecycle"; import * as receiptAuthority from "../onboard/experimental/hermes-portable-receipt"; +import { portableDemoReceiptPath } from "../onboard/experimental/portable-runtime-receipt-readiness"; import * as portableHostAuthority from "../state/portable-uninstall-retirement"; import * as registryCrossPort from "../state/registry/cross-port"; import { isUnlockedSandboxStatusRead } from "../actions/sandbox/status-snapshot"; @@ -230,6 +231,35 @@ function useHermesPortableAuthority(): void { }); } +function writeOpenClawPortableReceipt(stateDir: string, sandboxName: string): void { + const uid = process.getuid?.() ?? 1001; + const homeDir = process.env.HOME || os.homedir(); + const receiptPath = portableDemoReceiptPath(sandboxName, stateDir); + fs.mkdirSync(path.dirname(receiptPath), { recursive: true, mode: 0o700 }); + fs.writeFileSync( + receiptPath, + `${JSON.stringify({ + schemaVersion: 4, + sandboxName, + sandboxId: `sandbox-${sandboxName}`, + containerId: "a".repeat(64), + dashboardPort: 18789, + registryGeneration: `generation-${sandboxName}`, + runtimeAuthority: { + schemaVersion: 1, + kind: "podman", + ownership: "current-user", + uid, + homeDir, + configHome: path.join(homeDir, ".config"), + runtimeDir: `/run/user/${String(uid)}`, + socketPath: `/run/user/${String(uid)}/podman/podman.sock`, + }, + })}\n`, + { mode: 0o600 }, + ); +} + function makeCommand(): TestCommand { return Object.create(TestCommand.prototype) as TestCommand; } @@ -300,6 +330,25 @@ describe("NemoClawCommand", () => { } }); + it("rejects a read if OpenClaw Portable authority for another sandbox appears during it (#11903)", async () => { + const fence = acquireProcessBoundLockAt(portableHostAuthority.portableHostFencePath(stateDir)); + const operation = vi.fn(async () => { + writeOpenClawPortableReceipt( + portableHostAuthority.defaultPortableStateDir(process.env), + "beta", + ); + }); + ParsedSupportedSandboxCommand.operation = operation; + try { + await expect(ParsedSupportedSandboxCommand.run(["alpha"], process.cwd())).rejects.toThrow( + "Another NemoClaw lifecycle operation is in progress on this host.", + ); + expect(operation).toHaveBeenCalledOnce(); + } finally { + releaseProcessBoundLock(fence); + } + }); + it("fails fast rather than bypassing portable authority during status contention (#11903)", async () => { const authorityDirectory = path.join(stateDir, "hermes-portable-lifecycle"); fs.mkdirSync(authorityDirectory, { mode: 0o700 }); @@ -317,20 +366,51 @@ describe("NemoClawCommand", () => { expect(portableHostAuthority.withCurrentPortableHostFenceTry).toHaveBeenCalledOnce(); }); - it("fails closed when registry-only portable authority is present (#11903)", async () => { + it("fails closed on registry-only Portable authority for the requested sandbox (#11903)", async () => { vi.spyOn(portableHostAuthority, "withCurrentPortableHostFenceTry").mockRejectedValue( new Error(portableHostAuthority.PORTABLE_HOST_FENCE_BUSY_MESSAGE), ); - vi.spyOn(registryCrossPort, "findSandboxAcrossGatewayRoots").mockReturnValue({ - entry: { + vi.spyOn(registryCrossPort, "listInferenceRouteOwnersAcrossGatewayRoots").mockReturnValue([ + { name: "alpha", agent: "hermes", openshellDriver: "docker", lifecycleGeneration: "generation-1", } as never, - gatewayPort: 8091, - registryFile: "/test/sandboxes.json", - }); + ]); + const operation = vi.fn(async () => undefined); + ParsedSupportedSandboxCommand.operation = operation; + + await expect(ParsedSupportedSandboxCommand.run(["alpha"], process.cwd())).rejects.toThrow( + "Another NemoClaw lifecycle operation is in progress on this host.", + ); + expect(operation).not.toHaveBeenCalled(); + }); + + it("fails closed on Portable registry authority for another sandbox (#11903)", async () => { + vi.spyOn(portableHostAuthority, "withCurrentPortableHostFenceTry").mockRejectedValue( + new Error(portableHostAuthority.PORTABLE_HOST_FENCE_BUSY_MESSAGE), + ); + vi.spyOn(registryCrossPort, "listInferenceRouteOwnersAcrossGatewayRoots").mockReturnValue([ + { name: "beta", portableLifecycleProfile: "openclaw" } as never, + ]); + const operation = vi.fn(async () => undefined); + ParsedSupportedSandboxCommand.operation = operation; + + await expect(ParsedSupportedSandboxCommand.run(["alpha"], process.cwd())).rejects.toThrow( + "Another NemoClaw lifecycle operation is in progress on this host.", + ); + expect(operation).not.toHaveBeenCalled(); + }); + + it("fails closed on an OpenClaw Portable receipt for another sandbox (#11903)", async () => { + writeOpenClawPortableReceipt( + portableHostAuthority.defaultPortableStateDir(process.env), + "beta", + ); + vi.spyOn(portableHostAuthority, "withCurrentPortableHostFenceTry").mockRejectedValue( + new Error(portableHostAuthority.PORTABLE_HOST_FENCE_BUSY_MESSAGE), + ); const operation = vi.fn(async () => undefined); ParsedSupportedSandboxCommand.operation = operation; diff --git a/src/lib/cli/nemoclaw-oclif-command.ts b/src/lib/cli/nemoclaw-oclif-command.ts index 84bc6460657..83294eb6b12 100644 --- a/src/lib/cli/nemoclaw-oclif-command.ts +++ b/src/lib/cli/nemoclaw-oclif-command.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import { Command, Flags, type Interfaces } from "@oclif/core"; +import os from "node:os"; import path from "node:path"; import { assertHermesPortableCommandSupported, @@ -10,23 +11,24 @@ import { HERMES_PORTABLE_UNSUPPORTED_COMMAND_MESSAGE, HERMES_PORTABLE_UNSUPPORTED_DOCTOR_FIX_MESSAGE, } from "../onboard/experimental/portable-agent-lifecycle"; +import { HERMES_PORTABLE_RECEIPT_DIRECTORY } from "../onboard/experimental/hermes-portable-receipt"; import { - HERMES_PORTABLE_RECEIPT_DIRECTORY, - inspectPortableAgentReceiptAuthorityForClassification, -} from "../onboard/experimental/hermes-portable-receipt"; -import { defaultPortableDemoStateDir } from "../onboard/experimental/portable-runtime-receipt-readiness"; + defaultPortableDemoStateDir, + portableDemoReceiptDirectory, +} from "../onboard/experimental/portable-runtime-receipt-readiness"; import { redactForLog } from "../security/redact"; import { assertNoHermesPortableHostAuthority, PORTABLE_HOST_FENCE_BUSY_MESSAGE, readPortableAuthorityDirectory, samePortableAuthorityDirectory, + type PortableAuthorityDirectorySnapshot, withCurrentPortableHostFence, withCurrentPortableHostFenceTry, } from "../state/portable-uninstall-retirement"; import { withSandboxLifecycleLock } from "../actions/sandbox/lifecycle/lock"; import { withUnlockedSandboxStatusRead } from "../actions/sandbox/status-snapshot"; -import { findSandboxAcrossGatewayRoots } from "../state/registry/cross-port"; +import { listInferenceRouteOwnersAcrossGatewayRoots } from "../state/registry/cross-port"; import { enforceRemovedImmutabilityMigrationBoundary, reportRemovedImmutabilityUpgrade, @@ -90,37 +92,59 @@ const REMOVED_IMMUTABILITY_REMEDIATION_COMMANDS = new Set([ "sandbox:stop", ]); -function hasPortableRegistryAuthority(sandboxName: string): boolean { - const entry = findSandboxAcrossGatewayRoots(sandboxName)?.entry; +function hasPortableRegistryAuthorityOnHost(sandboxName: string): boolean { + return listInferenceRouteOwnersAcrossGatewayRoots(process.env.HOME || os.homedir()).some( + (entry) => + entry.portableLifecycleProfile !== undefined || + (entry.name === sandboxName && + entry.agent === "hermes" && + entry.openshellDriver === "docker" && + typeof entry.lifecycleGeneration === "string"), + ); +} + +type PortableAuthorityDirectories = { + readonly hermes: PortableAuthorityDirectorySnapshot; + readonly openclaw: PortableAuthorityDirectorySnapshot; +}; + +function readPortableAuthorityDirectories(stateDir: string): PortableAuthorityDirectories { + return { + hermes: readPortableAuthorityDirectory( + path.join(stateDir, HERMES_PORTABLE_RECEIPT_DIRECTORY), + false, + ), + openclaw: readPortableAuthorityDirectory(portableDemoReceiptDirectory(stateDir), false), + }; +} + +function hasPortableReceiptAuthority(directories: PortableAuthorityDirectories): boolean { + return directories.hermes.entries.length > 0 || directories.openclaw.entries.length > 0; +} + +function samePortableAuthorityDirectories( + left: PortableAuthorityDirectories, + right: PortableAuthorityDirectories, +): boolean { return ( - entry?.portableLifecycleProfile !== undefined || - (entry?.agent === "hermes" && - entry.openshellDriver === "docker" && - typeof entry.lifecycleGeneration === "string") + samePortableAuthorityDirectory(left.hermes, right.hermes) && + samePortableAuthorityDirectory(left.openclaw, right.openclaw) ); } function canUseUnlockedSandboxStatusRead(sandboxName: string): boolean { const stateDir = defaultPortableDemoStateDir(process.env); - const authorityDirectory = path.join(stateDir, HERMES_PORTABLE_RECEIPT_DIRECTORY); try { - const before = readPortableAuthorityDirectory(authorityDirectory, false); - const hasPortableReceiptAuthority = () => - inspectPortableAgentReceiptAuthorityForClassification(sandboxName, stateDir).kind !== "none"; - if ( - before.entries.length > 0 || - hasPortableRegistryAuthority(sandboxName) || - hasPortableReceiptAuthority() - ) { + const before = readPortableAuthorityDirectories(stateDir); + if (hasPortableReceiptAuthority(before) || hasPortableRegistryAuthorityOnHost(sandboxName)) { return false; } - const after = readPortableAuthorityDirectory(authorityDirectory, false); + const after = readPortableAuthorityDirectories(stateDir); return ( - after.entries.length === 0 && - samePortableAuthorityDirectory(before, after) && - !hasPortableRegistryAuthority(sandboxName) && - !hasPortableReceiptAuthority() + !hasPortableReceiptAuthority(after) && + samePortableAuthorityDirectories(before, after) && + !hasPortableRegistryAuthorityOnHost(sandboxName) ); } catch { return false; diff --git a/test/support/status-flow-test-harness.ts b/test/support/status-flow-test-harness.ts index caac691dd77..081d2d065fd 100644 --- a/test/support/status-flow-test-harness.ts +++ b/test/support/status-flow-test-harness.ts @@ -14,6 +14,7 @@ import type { import type { LlamaCppRouteDetails } from "../../src/lib/inference/config"; import type { ProviderHealthStatus } from "../../src/lib/inference/health"; import type { SandboxHostMount } from "../../src/lib/state/registry"; +import type { McpLifecycleLockOptions } from "../../src/lib/state/mcp-lifecycle-lock-acquisition"; type ShowSandboxStatus = (typeof import("../../src/lib/actions/sandbox/status"))["showSandboxStatus"]; @@ -41,6 +42,7 @@ export type StatusFlowHarness = { getActiveSandboxSessionsSpy: MockInstance; getSandboxDockerRuntimeSpy: MockInstance; getSandboxStatusReport: GetSandboxStatusReport; + inspectManagedLlamaCppStatusSpy: MockInstance; qualifyPortableAgentLifecycleAuthoritySpy: MockInstance; isSandboxGatewayRunningForStatusSpy: MockInstance; logSpy: MockInstance; @@ -121,6 +123,15 @@ export function resetStatusFlowModuleCache(): void { delete require.cache[requireDist.resolve(statusModulePath)]; } +export function createRealMcpLifecycleLock( + options: McpLifecycleLockOptions = {}, +): WithMcpLifecycleLock { + const lockModule = requireDist("../../src/lib/state/mcp-lifecycle-lock-acquisition.js"); + const acquire = lockModule.withMcpLifecycleLock as WithMcpLifecycleLock; + return (sandboxName, operation, overrides = {}) => + acquire(sandboxName, operation, { ...options, ...overrides }); +} + export function createStatusFlowHarness(options: StatusFlowHarnessOptions = {}): StatusFlowHarness { resetStatusFlowModuleCache(); @@ -137,6 +148,7 @@ export function createStatusFlowHarness(options: StatusFlowHarnessOptions = {}): "../../src/lib/onboard/experimental/portable-agent-lifecycle.js", ); const lifecycleLock = requireDist("../../src/lib/state/mcp-lifecycle-lock-acquisition.js"); + const managedLlamaCppStatus = requireDist("../../src/lib/inference/llama-cpp/managed-status.js"); const resolve = requireDist("../../src/lib/adapters/openshell/resolve.js"); const agentRuntime = requireDist("../../src/lib/agent/runtime.js"); const nim = requireDist("../../src/lib/inference/nim.js"); @@ -309,6 +321,9 @@ export function createStatusFlowHarness(options: StatusFlowHarnessOptions = {}): logSpy.mockClear(); + const inspectManagedLlamaCppStatusSpy = vi + .spyOn(managedLlamaCppStatus, "inspectManagedLlamaCppStatus") + .mockReturnValue(null); const statusModule = requireDist(statusModulePath); const ensureHermesToolGatewayBrokerSpy = options.mockHermesToolGatewayBroker ? vi @@ -325,6 +340,7 @@ export function createStatusFlowHarness(options: StatusFlowHarnessOptions = {}): getActiveSandboxSessionsSpy, getSandboxDockerRuntimeSpy, getSandboxStatusReport: statusModule.getSandboxStatusReport, + inspectManagedLlamaCppStatusSpy, qualifyPortableAgentLifecycleAuthoritySpy, isSandboxGatewayRunningForStatusSpy, logSpy, From df8d24e575cba0329112ba308654c7274ccee77c Mon Sep 17 00:00:00 2001 From: Yimo Jiang Date: Mon, 12 Oct 2026 08:49:48 +0000 Subject: [PATCH 09/17] fix(status): distinguish unknown inference state Signed-off-by: Yimo Jiang --- src/lib/actions/sandbox/status-flow.test.ts | 20 ++++++++++++++++++++ src/lib/actions/sandbox/status-text.ts | 6 +++--- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/lib/actions/sandbox/status-flow.test.ts b/src/lib/actions/sandbox/status-flow.test.ts index ce28abaa97f..844c0b29002 100644 --- a/src/lib/actions/sandbox/status-flow.test.ts +++ b/src/lib/actions/sandbox/status-flow.test.ts @@ -123,6 +123,26 @@ describe("showSandboxStatus flow", () => { expect(harness.logSpy.mock.calls.flat().join("\n")).toContain("Managed llama.cpp: running"); }); + it("reports unverified inference state for unlocked reads when gateway state is unknown (#11903)", async () => { + const harness = createStatusFlowHarness({ + inferenceHealth: null, + lookup: { + state: "gateway_unreachable_after_restart", + output: "Gateway: nemoclaw\nclient error (Connect): Connection refused", + }, + }); + + await expect( + harness.withUnlockedSandboxStatusRead(() => harness.showSandboxStatus("alpha")), + ).rejects.toThrow("process.exit(1)"); + + const output = harness.logSpy.mock.calls.flat().join("\n"); + expect(output).toContain("Inference: not verified (gateway/sandbox state not verified)"); + expect(output).not.toContain( + "Inference: not probed (another lifecycle operation is in progress)", + ); + }); + it("does not wait on a held MCP lifecycle lock for unlocked text or JSON status (#11903)", async () => { const withMcpLifecycleLock = createRealMcpLifecycleLock({ pollIntervalMs: 1, diff --git a/src/lib/actions/sandbox/status-text.ts b/src/lib/actions/sandbox/status-text.ts index fa103c98b15..3eff3a94fa0 100644 --- a/src/lib/actions/sandbox/status-text.ts +++ b/src/lib/actions/sandbox/status-text.ts @@ -116,15 +116,15 @@ function printServingProcessHealth( } function printInferenceStatus(context: SandboxStatusTextContext): void { - if (context.inferenceProbeSuppressed) { + if (context.lookup.state !== "present") { + console.log(" Inference: not verified (gateway/sandbox state not verified)"); + } else if (context.inferenceProbeSuppressed) { console.log(" Inference: not probed (another lifecycle operation is in progress)"); } else if (context.inferenceHealth) { printInferenceProbeLine(context.inferenceHealth); for (const subprobe of context.inferenceHealth.subprobes ?? []) { printInferenceProbeLine(subprobe); } - } else if (context.lookup.state !== "present") { - console.log(" Inference: not verified (gateway/sandbox state not verified)"); } printServingProcessHealth(context.statusAgent, context.servingProcessHealth); } From 2de21fbc4a27f5da6b3f7052d7558a822013f20d Mon Sep 17 00:00:00 2001 From: Yimo Jiang Date: Mon, 12 Oct 2026 09:31:39 +0000 Subject: [PATCH 10/17] fix(status): include Hermes registry authority host-wide Signed-off-by: Yimo Jiang --- src/lib/cli/nemoclaw-oclif-command.test.ts | 35 ++++++++++++++++++++-- src/lib/cli/nemoclaw-oclif-command.ts | 17 +++++------ 2 files changed, 40 insertions(+), 12 deletions(-) diff --git a/src/lib/cli/nemoclaw-oclif-command.test.ts b/src/lib/cli/nemoclaw-oclif-command.test.ts index 9bc7dd56b21..d896677f079 100644 --- a/src/lib/cli/nemoclaw-oclif-command.test.ts +++ b/src/lib/cli/nemoclaw-oclif-command.test.ts @@ -366,13 +366,13 @@ describe("NemoClawCommand", () => { expect(portableHostAuthority.withCurrentPortableHostFenceTry).toHaveBeenCalledOnce(); }); - it("fails closed on registry-only Portable authority for the requested sandbox (#11903)", async () => { + it("fails closed on registry-only Hermes Portable authority for another sandbox (#11903)", async () => { vi.spyOn(portableHostAuthority, "withCurrentPortableHostFenceTry").mockRejectedValue( new Error(portableHostAuthority.PORTABLE_HOST_FENCE_BUSY_MESSAGE), ); vi.spyOn(registryCrossPort, "listInferenceRouteOwnersAcrossGatewayRoots").mockReturnValue([ { - name: "alpha", + name: "beta", agent: "hermes", openshellDriver: "docker", lifecycleGeneration: "generation-1", @@ -387,6 +387,37 @@ describe("NemoClawCommand", () => { expect(operation).not.toHaveBeenCalled(); }); + it("rejects an unlocked status read when Hermes Portable registry authority appears during it (#11903)", async () => { + const fence = acquireProcessBoundLockAt(portableHostAuthority.portableHostFencePath(stateDir)); + let registryReads = 0; + vi.spyOn(registryCrossPort, "listInferenceRouteOwnersAcrossGatewayRoots").mockImplementation( + () => { + registryReads += 1; + return registryReads < 3 + ? [] + : [ + { + name: "beta", + agent: "hermes", + openshellDriver: "docker", + lifecycleGeneration: "generation-1", + } as never, + ]; + }, + ); + const operation = vi.fn(async () => undefined); + ParsedSupportedSandboxCommand.operation = operation; + try { + await expect(ParsedSupportedSandboxCommand.run(["alpha"], process.cwd())).rejects.toThrow( + "Another NemoClaw lifecycle operation is in progress on this host.", + ); + expect(operation).toHaveBeenCalledOnce(); + expect(registryReads).toBe(3); + } finally { + releaseProcessBoundLock(fence); + } + }); + it("fails closed on Portable registry authority for another sandbox (#11903)", async () => { vi.spyOn(portableHostAuthority, "withCurrentPortableHostFenceTry").mockRejectedValue( new Error(portableHostAuthority.PORTABLE_HOST_FENCE_BUSY_MESSAGE), diff --git a/src/lib/cli/nemoclaw-oclif-command.ts b/src/lib/cli/nemoclaw-oclif-command.ts index 83294eb6b12..c78b3bedd80 100644 --- a/src/lib/cli/nemoclaw-oclif-command.ts +++ b/src/lib/cli/nemoclaw-oclif-command.ts @@ -92,12 +92,11 @@ const REMOVED_IMMUTABILITY_REMEDIATION_COMMANDS = new Set([ "sandbox:stop", ]); -function hasPortableRegistryAuthorityOnHost(sandboxName: string): boolean { +function hasPortableRegistryAuthorityOnHost(): boolean { return listInferenceRouteOwnersAcrossGatewayRoots(process.env.HOME || os.homedir()).some( (entry) => entry.portableLifecycleProfile !== undefined || - (entry.name === sandboxName && - entry.agent === "hermes" && + (entry.agent === "hermes" && entry.openshellDriver === "docker" && typeof entry.lifecycleGeneration === "string"), ); @@ -132,19 +131,17 @@ function samePortableAuthorityDirectories( ); } -function canUseUnlockedSandboxStatusRead(sandboxName: string): boolean { +function canUseUnlockedSandboxStatusRead(): boolean { const stateDir = defaultPortableDemoStateDir(process.env); try { const before = readPortableAuthorityDirectories(stateDir); - if (hasPortableReceiptAuthority(before) || hasPortableRegistryAuthorityOnHost(sandboxName)) { - return false; - } + if (hasPortableReceiptAuthority(before) || hasPortableRegistryAuthorityOnHost()) return false; const after = readPortableAuthorityDirectories(stateDir); return ( !hasPortableReceiptAuthority(after) && samePortableAuthorityDirectories(before, after) && - !hasPortableRegistryAuthorityOnHost(sandboxName) + !hasPortableRegistryAuthorityOnHost() ); } catch { return false; @@ -270,7 +267,7 @@ export abstract class NemoClawCommand extends Command { ) { throw error; } - if (!canUseUnlockedSandboxStatusRead(sandboxName)) { + if (!canUseUnlockedSandboxStatusRead()) { throw new Error( "Another NemoClaw lifecycle operation is in progress on this host. Wait for it to finish, then retry status.", { cause: error }, @@ -278,7 +275,7 @@ export abstract class NemoClawCommand extends Command { } return await withUnlockedSandboxStatusRead(async () => { const result = await runLocked(); - if (!canUseUnlockedSandboxStatusRead(sandboxName)) { + if (!canUseUnlockedSandboxStatusRead()) { throw new Error( "Another NemoClaw lifecycle operation is in progress on this host. Wait for it to finish, then retry status.", { cause: error }, From fef5131c3b77c9f476d24b446ef9e1b298c222bd Mon Sep 17 00:00:00 2001 From: Rebecca Sliter Date: Mon, 26 Oct 2026 13:32:42 -0700 Subject: [PATCH 11/17] chore: prepare status docs branch update Signed-off-by: Rebecca Sliter <571084+rsliter@users.noreply.github.com> --- docs/reference/commands.mdx | 396 +++++++++++++++++++++++++++++------- 1 file changed, 319 insertions(+), 77 deletions(-) diff --git a/docs/reference/commands.mdx b/docs/reference/commands.mdx index 32006927c61..2d2d91e870c 100644 --- a/docs/reference/commands.mdx +++ b/docs/reference/commands.mdx @@ -16,6 +16,11 @@ content: type: "reference" --- +The installer and supported CLI operations attempt anonymous completion telemetry to NVIDIA's fixed TEST receiver by default. +Run `export NEMOCLAW_DISABLE_TELEMETRY=1` in this shell before installing or rerunning it to suppress collection and delivery. +Repeat it in any new shell used for NemoClaw CLI commands. +Refer to [Operation Telemetry](/user-guide/openclaw/security/best-practices#operation-telemetry) for details. + The `$$nemoclaw` CLI is the primary interface for managing NemoClaw sandboxes. It is installed automatically by the installer (`curl -fsSL https://www.nvidia.com/nemoclaw.sh | bash`). For guidance on when to use `$$nemoclaw` versus the underlying `openshell` CLI, refer to [CLI Selection Guide](cli-selection-guide). @@ -256,7 +261,8 @@ Start a new shell session to refresh the cached sandbox names after creating or ### `$$nemoclaw config export ` Export a supported registered OpenClaw, Hermes, or LangChain Deep Agents Code sandbox as a credential-value-free `nemoclaw.nvidia.com/v1alpha1` `NemoClawConfig` document. -Version 1 cannot export a sandbox whose registry retains messaging state. The command writes no YAML or output file in that case. Removing the last channel leaves messaging state in the registry, so it does not make that sandbox exportable. Use a supported sandbox without messaging state for Version 1 export. +Version 1 accepts valid empty messaging plans, including plans left after removing the last channel. +It rejects plans that retain channels or messaging effects and writes no YAML or output file. The command reads the registry and current OpenShell state without changing the sandbox. It stops without writing output when required identity, policy, inference, or workload evidence is missing or inconsistent. If the source changes during observation, the command retries the complete observation once and stops without output if the retry also changes. @@ -414,7 +420,7 @@ Use the stable `id` value with `$$nemoclaw onboard --profile `. Display na Run the interactive setup wizard (recommended for new installs). The wizard creates an OpenShell gateway, registers inference providers, selects the exact managed image (or builds an explicit custom Dockerfile), and creates the sandbox. Use this command for new installs and for recreating a sandbox after changes to policy or configuration. ```bash -$$nemoclaw onboard [--profile ] [--non-interactive] [--resume | --fresh] [--recreate-sandbox] [--apf-interceptor] [--gpu | --no-gpu] [--from | --from-image @sha256:] [--name ] [--host-mount ] [--sandbox-gpu | --no-sandbox-gpu] [--sandbox-gpu-device ] [--vllm-gpu-device ] [--agent ] [--agents ] [--tool-disclosure ] [--observability | --no-observability] [--control-ui-port ] [--events=jsonl] [--yes | -y] [--no-ollama-autostart] [--yes-i-accept-third-party-software] +$$nemoclaw onboard [--profile ] [--non-interactive] [--resume | --fresh] [--recreate-sandbox] [--apf-interceptor] [--gpu | --no-gpu] [--from | --from-image @sha256:] [--name ] [--host-mount ] [--sandbox-gpu | --no-sandbox-gpu] [--sandbox-gpu-device ] [--vllm-gpu-device ] [--agent ] [--agents ] [--tool-disclosure ] [--dcode-auto-approval ] [--observability | --no-observability] [--control-ui-port ] [--events=jsonl] [--yes | -y] [--no-ollama-autostart] [--yes-i-accept-third-party-software] ``` @@ -465,6 +471,10 @@ $$nemoclaw onboard --profile llama-cpp.dgx-spark-gb10.single.muse-glimmer-30b If you omit `--profile`, onboarding uses the same provider and model defaults as an installation without this feature. The onboarding review screen identifies the resolved profile, recipe, declared model, served model alias, runtime image, support state, and download estimates before confirmation. +A managed vLLM or managed llama.cpp profile installs during provider selection, before that screen. +Its installer declares the selected profile ID, recipe, runtime image, model, and pinned model download size before acquisition. +Managed vLLM also declares the pinned image download size when the image is not cached on the host. +The managed vLLM confirmation prompt follows that declaration. When onboarding reuses a running vLLM server, its `/v1/models` response must match the requested profile's served alias or declared model root. Otherwise, onboarding stops before it records a route that the profile does not declare. @@ -512,20 +522,40 @@ This surface observes the canonical onboarding session and does not accept input NemoClaw records onboarding progress so interrupted runs can continue. Use `--resume` to continue a resumable onboarding session with the provider, model, sandbox name, agent, observability choice, custom Dockerfile path, read-only host-mount declarations, and any explicitly selected serving-profile provenance recorded by the original run. For a profile-backed session, resume requires the same catalog, preset, and recipe digests and exits before effects if the installed definition changed. Omit `--profile` to reuse that recorded selection, or pass the same profile explicitly; use `--fresh` to adopt a changed catalog definition. Sessions without a serving-profile provenance record can resume when their checkpoint uses schema 4, but they cannot acquire a new `--profile` selection during resume. +If policy application stops or OpenShell refuses the write, `--resume` reuses the selected presets for the same sandbox. +NemoClaw checks the sandbox identity and preset availability before it reapplies the selection. +It clears the saved selection only after live policy readback confirms the presets. +If a saved preset is unavailable, policy recovery stops without silently removing it; use `--fresh` to discard that selection and choose a new policy. +If the sandbox identity changed, preserve the reported state and inspect the sandbox before starting a new onboarding attempt. + -OpenClaw onboarding does not enter the `complete` state until NemoClaw proves that the local CLI operator pairing is settled. Onboarding first observes the canonical local CLI device. If the device is pairing-only, the host runs one bounded request producer on the owning gateway. The in-sandbox watcher is the only component that approves the onboarding upgrade. The host observes through any same-device pending state and verifies the final settled state without sending an approval. +OpenClaw onboarding does not enter the `complete` state until NemoClaw proves that the local CLI operator pairing is settled. +Onboarding first observes the canonical local CLI device. +If the verified device has pairing-only or pairing/read permissions and needs write access, the host runs one bounded request producer on the owning gateway. +This includes a matching CLI device whose connection metadata was refreshed by a probe. +The in-sandbox watcher is the only component that approves the onboarding upgrade. +The host observes through any same-device pending state and verifies the final settled state without sending an approval. Before the configuration review, NemoClaw records the sandbox name and the selected provider and model as an incomplete choice. If onboarding stops at the review prompt, an interactive `--resume` run shows the prompt again. A non-interactive `--resume` run reuses the recorded choice and continues to inference setup. After you choose **Apply configuration**, NemoClaw records the choice before inference setup starts. If inference setup fails, `--resume` reuses the accepted provider, model, and sandbox name. If you choose **Exit onboarding**, onboarding exits with a nonzero status and clears those recorded choices. Run `$$nemoclaw onboard` to make new choices after exit. During a resume without terminal input, `--yes` or `NEMOCLAW_YES=1` also selects non-interactive resume behavior. For a new or fresh session, `--yes` and `NEMOCLAW_YES=1` accept supported confirmations but do not replace `--non-interactive`. If onboarding returns without reaching the final `complete` state, the command exits with status `1`. When that result is resumable, NemoClaw keeps the session `in_progress` at its last checkpoint instead of marking it failed, so correct the reported condition and run `$$nemoclaw onboard --resume`. - + During finalization, NemoClaw stops onboarding when it cannot complete the process check or a required secret-boundary check refuses. It does not report the sandbox as ready. Run `$$nemoclaw doctor`, correct the reported condition, then run `$$nemoclaw onboard --resume`. + + + +During finalization, NemoClaw stops onboarding when it cannot complete the process check or a required secret-boundary check refuses. +It does not report the sandbox as ready. +For a Portable Hermes receipt and registry authority mismatch, preserve both records and follow [Portable Hermes receipt and registry authority do not match](troubleshooting#portable-hermes-receipt-and-registry-authority-do-not-match). +Do not resume onboarding for that authority failure. +For another resumable finalization failure, run `$$nemoclaw doctor`, correct the reported condition, then run `$$nemoclaw onboard --resume`. + #### Inspect retained sandbox recovery @@ -549,7 +579,8 @@ Use the result from `destroy` to choose the next action: - If OpenShell reports the sandbox present and its durable identity matches the recovery record, `destroy` checks that identity during cleanup and immediately before deletion. It can delete the retained sandbox. A failed check or deletion preserves the recovery record. If you cannot prevent another gateway client from replacing the sandbox name during cleanup, use a different explicit name instead. - If OpenShell cannot determine whether the sandbox is present, `destroy` reports unknown presence, removes no resources, and preserves the recovery record. Correct the OpenShell gateway or list failure, then rerun `destroy`. -- If OpenShell confirms the sandbox is absent, `destroy` selects one retained record from its registry generation, gateway, create-attempt evidence, and available identity fingerprint. +- For the existing residual-cleanup path, `destroy` selects one retained record from its registry generation, gateway, create-attempt evidence, and available identity fingerprint. + Cleanup requires the owning OpenShell gateway to confirm sandbox absence. Before pending identity publication, it can instead select one record with a durable identity fingerprint when the pending reservation belongs to the recorded onboarding session, the saved session recovery evidence matches the record, and the registry has no lifecycle identity evidence. Provider and Docker cleanup then apply their own immutable identity checks. `destroy` removes only qualified residual resources and clears the matching recovery record only after verified cleanup. @@ -562,7 +593,26 @@ Only then rerun the owning provider setup workflow to restore those attachments. If you cannot prevent replacement or verify attachment ownership, leave the attachments untouched and use a different sandbox name. Keep the recovery record and retry `destroy` only after resolving the identity drift. -If OpenShell did not return a durable identity fingerprint, `destroy` cannot authorize deletion of a live sandbox. It can still select one recovery record that matches the immutable registry generation, gateway, and create-attempt evidence. It clears that record only after the owning gateway reports absence and verified residual cleanup succeeds. If the sandbox is present or presence is unknown, preserve the record and do not delete by mutable name. If NemoClaw could not save recovery evidence, preserve the registry entry and terminal output. +If OpenShell did not return a durable identity fingerprint, `destroy` cannot authorize deletion of a live sandbox. + +For normal recovery, `destroy` can clear local recovery metadata on native Linux with default Docker when no lifecycle identity was published. +It requires exactly one matching retained record, a recorded Docker ownership marker, and sandbox absence confirmed by the owning gateway. +Docker must report no matching containers or managed state volumes. +When the record includes ownership captured before creation, recovery rechecks the original Docker daemon, gateway binding, and any remaining reservation owner. +Otherwise, it requires a Docker ownership marker predating the recovery record and, while a reservation remains, its matching recovery-only session. +Sandbox-scoped providers or additional resource ownership block recovery. + +Use the failed onboarding attempt's gateway port to select its state root, for example: + +```bash +NEMOCLAW_GATEWAY_PORT=19260 $$nemoclaw destroy --yes +``` + +Success clears the matching recovery metadata and releases the sandbox name without removing runtime resources. +If a local metadata write fails, resolve the reported write error. +Then rerun the same command with that port, even if the reservation was removed. + +If NemoClaw could not save recovery evidence, preserve the registry entry and terminal output. This fail-closed record keeps only the affected sandbox name unavailable. This command does not accept externally supplied identity authority. To onboard another sandbox while the record remains unresolved, supply a different explicit name: @@ -640,7 +690,18 @@ $$nemoclaw onboard --fresh --apf-interceptor --name my-apf-sandbox Choose how the selected agent presents its session-authorized tools to the model. `progressive` is the default: OpenClaw and Hermes use their native Tool Search implementations, while Deep Agents Code initially shows its core tools plus `search_tools` after at least one MCP tool loads successfully. `direct` presents all registered tools directly. This setting changes model context only; it does not bypass OpenShell policy, credentials, approvals, hooks, or sandbox controls. -The flag takes precedence over `NEMOCLAW_TOOL_DISCLOSURE`. A new sandbox defaults to `progressive` when neither is set. NemoClaw records the selected value with the onboarding session and sandbox so rebuilds preserve it and ambient shell variables cannot silently change an internal rebuild. Model-specific compatibility safeguards may downgrade a selected `progressive` mode to direct exposure for that model without changing the recorded preference. To change an existing sandbox, recreate it explicitly: +The flag takes precedence over `NEMOCLAW_TOOL_DISCLOSURE`. New sandboxes default to `progressive` when neither is set. NemoClaw records the selected value with the onboarding session and sandbox so rebuilds preserve it and ambient shell variables cannot silently change an internal rebuild. Model-specific compatibility safeguards may downgrade a selected `progressive` mode to direct exposure for that model without changing the recorded preference. + + + +A fresh managed OpenClaw sandbox using local Ollama or vLLM defaults to `direct` instead. +The accepted Deferred N1x managed-vLLM preview for `nvidia/Qwen3.6-35B-A3B-NVFP4` defaults to `progressive`. +These exceptions apply only to the first creation for that session. +Existing sandbox state and explicit `--tool-disclosure` or `NEMOCLAW_TOOL_DISCLOSURE` selections take precedence. + + + +To change an existing sandbox, recreate it explicitly: ```bash $$nemoclaw onboard --name my-assistant --recreate-sandbox --tool-disclosure direct @@ -650,6 +711,16 @@ Recreation without an explicit flag or environment value preserves the recorded +#### `--dcode-auto-approval ` + +Choose the managed Deep Agents Code auto-approval capability during onboarding. A new sandbox defaults to `disabled`. +Omitting the flag preserves the sandbox registry’s recorded capability, including a previously disabled capability, during resume or recreation. +`thread-opt-in` permits explicit activation inside Deep Agents Code; onboarding does not activate an approval mode or run `dcode -y`. +`thread-opt-in` is rejected for other agents and custom images. Pass `--dcode-auto-approval disabled` to clear a recorded capability when switching agents. +Before sandbox registration, resume preserves the explicit choice saved in the onboarding session. +An explicit capability change for an existing sandbox requires recreation through the existing onboarding lifecycle. +See [Configure Thread Auto-Approval](../manage-sandboxes/operate-sandboxes/run-deep-agents-code#configure-thread-auto-approval) for activation, status, and revocation. + #### `--observability` and `--no-observability` Enable backend-neutral trace export for a LangChain Deep Agents Code sandbox. During initial onboarding, pass `--observability` with the Deep Agents alias. When you use the generic `nemoclaw` entry point, combine it with `--agent langchain-deepagents-code`. NemoClaw rejects the positive flag for OpenClaw and Hermes sandboxes. Use `--no-observability` when you need to clear a recorded Deep Agents Code choice before switching the resumed session to another agent. @@ -789,6 +860,7 @@ Use `llama-cpp.muse-glimmer-30b.spark-single.v1` to select the Meta Muse Glimmer On a qualifying Windows WSL N1x or Station GB300 host, Windows Express leaves provider selection to onboarding. During Windows Express, onboarding accepts one proof-backed N1x GPU identity or a bounded Station GB300 Windows product observation whose reconciled proof includes an `NVIDIA GB300` device, verifies the remaining readiness requirements, and automatically selects the Experimental managed Qwen 3.6 recipe. +The managed Station recipe requires exactly one proved GB300 GPU UUID. The Windows chassis product name does not participate in N1x selection. Before onboarding, unset `DOCKER_HOST` and select Docker's `default` context. Onboarding also requires local Docker Desktop, Arm64, at least 48,000 MiB of Docker and GPU memory, driver version `580.65.06` or later, NVIDIA integration, and successful Docker Desktop GPU passthrough. @@ -814,14 +886,18 @@ After provider selection, the wizard reviews the provider, model, credential sta When you edit inference, NemoClaw clears the credential staged for the discarded selection. NemoClaw preserves the sandbox name. When you edit the sandbox name, NemoClaw preserves the inference selection. The sandbox prompt shows the prior name as its default. After you apply the configuration, routine editing ends. If inference setup fails and offers a `back` recovery action, you can return to provider and model selection and then review the updated configuration again. +For a hosted custom endpoint, the wizard asks for the **policy tier** before it registers inference. +It reuses that selection when it later applies the sandbox policy. + - It then prompts for optional web search and messaging channels, builds and starts the sandbox, and - asks for a **policy tier** that controls the default set of network policy presets applied to the - sandbox. + For other inference providers, it then prompts for optional web search and messaging channels, + builds and starts the sandbox, and asks for a **policy tier** that controls the default set of + network policy presets applied to the sandbox. - It then prompts for optional web search, builds and starts the sandbox, and asks for a **policy - tier** that controls the default set of network policy presets applied to the sandbox. + For other inference providers, it then prompts for optional web search, builds and starts the + sandbox, and asks for a **policy tier** that controls the default set of network policy presets + applied to the sandbox. Four tiers are available: @@ -949,6 +1025,9 @@ If you enable Telegram during onboarding, the wizard can also prompt for whether +Closing stdin during onboarding cancels the run: NemoClaw prints `Installation cancelled`, exits non-zero, and keeps the resumable onboarding session so `nemoclaw onboard --resume` can continue. This holds whether you press `Ctrl-D` while a question is on screen or while the wizard is working between questions, and whether stdin is a terminal or a harness pipe that closes. +On a terminal, `Ctrl-D` cancels while the answer is still empty, including at a masked prompt such as an API key; after you type characters it is ignored until you clear them, the same rule a shell applies. + If you cancel a brand-new onboarding run at the policy-tier selector or either policy-preset selector after sandbox creation, NemoClaw preserves the incomplete sandbox, registry entry, and onboarding session for retained recovery. NemoClaw reports the durable sandbox identity fingerprint when it is available. It does not run OpenShell's mutable-name deletion command because the name may now identify a replacement sandbox. @@ -957,7 +1036,7 @@ A fresh run with a different explicit name can continue while the cancelled sand If you run onboarding again with the same sandbox name and choose a different inference provider or model, NemoClaw detects the drift and recreates the sandbox so the running agent config matches your selection. In interactive mode, the wizard asks for confirmation before delete and recreate. In non-interactive mode, NemoClaw recreates automatically when the stored selection is readable and differs. For managed Deep Agents Code sandboxes, NemoClaw also recreates when the live `dcode identity` selection is unreadable; other agent paths continue to reuse by default when their stored selection cannot be read. Set `NEMOCLAW_RECREATE_SANDBOX=1` to force recreation even when no drift is detected. -Before deleting an existing sandbox during recreation, NemoClaw transfers the complete OpenShell native home/workspace into the replacement. The transfer includes unknown files, agent configuration, history, hooks, plugins, packages, cron data, and child-agent state without consulting an agent-specific file inventory. OpenShell credential storage remains outside the transferred workspace. NemoClaw aborts recreation if the complete transfer cannot be captured or restored. The behaviour matches `$$nemoclaw rebuild --force`. Set `NEMOCLAW_RECREATE_WITHOUT_BACKUP=1` to skip the transfer and start the destination with a fresh workspace. +Before deleting an existing sandbox during recreation, NemoClaw transfers the complete OpenShell native home/workspace into the replacement. The transfer includes unknown files, agent configuration, history, hooks, plugins, packages, cron data, and child-agent state without consulting an agent-specific file inventory. OpenShell credential storage remains outside the transferred workspace. NemoClaw aborts recreation if the complete transfer cannot be captured or restored. If pre-delete backup fails and the source identity remains unchanged, the existing sandbox remains registered and available. If the error identifies credential-bearing content, connect to that sandbox, remove or relocate the content, then retry onboarding. The behaviour matches `$$nemoclaw rebuild --force`. Set `NEMOCLAW_RECREATE_WITHOUT_BACKUP=1` to skip the transfer and start the destination with a fresh workspace. Before deletion, onboarding prints a `Journaled replacement` diagnostic with the replacement identifier, recorded OpenShell gateway, and current phase. If the process stops after this point, rerun the original onboarding command with the same target settings. The rerun continues the active replacement without requiring `--resume`. It accepts a same-name replacement only after its live identity and sandbox registry generation match the journal and it completes or verifies the recorded final handoff. A matching replacement can report not-ready after that handoff. It fails closed if the gateway, source, target, durable source registry fields, or replacement settings changed. @@ -970,7 +1049,7 @@ If the installed OpenShell version falls outside this range, onboarding exits wi For fresh OpenShell installs, NemoClaw queries published OpenShell releases and asks the installer to use a release that fits the blueprint range. If release metadata is unavailable, the installer uses its bundled fallback pin and the post-install version gate still enforces the range. -When NemoClaw finds an existing gateway to reuse, it probes the host gateway HTTP endpoint before declaring the gateway reusable. If the container is running but the upstream is still warming up (for example, immediately after a Docker daemon restart), NemoClaw rebuilds the gateway instead of trusting stale metadata. On the Docker-driver gateway path, preflight stays read-only when it detects a stale gateway (for example, a Docker-driver runtime env hash drift). It prints a `⚠ Gateway will be recreated when sandbox creation starts` notice and defers the actual teardown to step `[2/8] Starting OpenShell gateway`. This means pressing `Ctrl+C` between preflight and step `[2/8]` leaves the running gateway and existing sandbox containers untouched, so `$$nemoclaw onboard` is safe to run just to check preflight output. An interrupted run prints the resume command and exits with status `130` for `Ctrl+C` or `143` for `SIGTERM`. For Linux Docker-driver gateways, onboarding also checks that a helper container on the OpenShell Docker network can reach `host.openshell.internal:`. If a host firewall blocks that sandbox path, onboarding exits with a `sudo ufw allow from to port proto tcp` command before it reports the gateway healthy. Set `NEMOCLAW_AUTO_FIX_FIREWALL=1` to opt in to automatic UFW remediation for this specific failure: NemoClaw uses `sudo -n` only, validates the Docker bridge subnet/gateway/port, applies the narrow UFW rule only after a proven TCP reachability failure, and re-probes before continuing. If passwordless sudo, UFW, or active UFW is unavailable, NemoClaw falls back to the manual guidance path without prompting for a password. +When NemoClaw finds an existing gateway to reuse, it probes the host gateway HTTP endpoint before declaring the gateway reusable. If the container is running but the upstream is still warming up (for example, immediately after a Docker daemon restart), NemoClaw rebuilds the gateway instead of trusting stale metadata. On the Docker-driver gateway path, preflight stays read-only when it detects a stale gateway (for example, a Docker-driver runtime env hash drift). It prints a `⚠ Gateway will be recreated when sandbox creation starts` notice and defers the actual teardown to step `[2/8] Starting OpenShell gateway`. This means pressing `Ctrl+C` between preflight and step `[2/8]` leaves the running gateway and existing sandbox containers untouched, so `$$nemoclaw onboard` is safe to run just to check preflight output. An interrupted run prints the resume command and exits with status `130` for `Ctrl+C` or `143` for `SIGTERM`. This holds when the onboarding output is redirected or captured (for example `$$nemoclaw onboard 2> onboard.log`, or a CI job driving the CLI on a pseudo-terminal): prompts read `Ctrl+C` from the terminal attached to `stdin`, not from where the question is printed. For Linux Docker-driver gateways, onboarding also checks that a helper container on the OpenShell Docker network can reach `host.openshell.internal:`. If a host firewall blocks that sandbox path, onboarding exits with a `sudo ufw allow from to port proto tcp` command before it reports the gateway healthy. Set `NEMOCLAW_AUTO_FIX_FIREWALL=1` to opt in to automatic UFW remediation for this specific failure: NemoClaw uses `sudo -n` only, validates the Docker bridge subnet/gateway/port, applies the narrow UFW rule only after a proven TCP reachability failure, and re-probes before continuing. If passwordless sudo, UFW, or active UFW is unavailable, NemoClaw falls back to the manual guidance path without prompting for a password. #### `--from ` @@ -979,13 +1058,26 @@ NemoClaw validates the complete three-agent publication cohort before selecting If registry or catalog availability prevents resolution, stock onboarding stops before sandbox creation and does not build a shipped Dockerfile. Catalog evidence that is incomplete, mixed, mutable, wrong-platform, or identity-inconsistent also fails closed before sandbox creation. -Build the sandbox image from a custom Dockerfile instead of the stock NemoClaw image. The supplied Dockerfile defines the complete sandbox image, and NemoClaw does not layer it on top of the stock managed runtime. The entire parent directory of the specified file is used as the Docker build context, so any files your Dockerfile references (scripts, config, etc.) must live alongside it. When the supplied path is the selected agent's own managed Dockerfile (for example, `agents/hermes/Dockerfile` in the NemoClaw checkout the CLI runs from), NemoClaw applies one exception and stages the repository root as the build context, exactly as the managed build does, because that Dockerfile copies repository-root paths. This lets you edit the managed Dockerfile in place (for example to add Python packages) and rebuild from it with `--from`. For this managed exception, onboarding applies the `.dockerignore` from the repository root. For every other `--from` path, onboarding applies a `.dockerignore` from the Dockerfile's parent directory while calculating the context size and staging files for Docker. NemoClaw also applies additional secret-safety exclusions that override `.dockerignore` negation rules: credential-style files and directories such as `.env*`, `.ssh/`, `.aws/`, `.netrc`, `.npmrc`, `secrets/`, `*.pem`, and `*.key` are still skipped even if `.dockerignore` tries to include them. Without a `.dockerignore`, onboarding still skips common large or local-only directories (`node_modules`, `.git`, `.venv`, and `__pycache__`) while staging this context. Other build outputs such as `dist/`, `target/`, or `build/` are included unless your `.dockerignore` excludes them. If the staged context is larger than 100 MB, onboarding prints a warning before the Docker build starts. Move the Dockerfile into a smaller dedicated directory or add `.dockerignore` entries for generated artifacts to shrink the context. If the directory contains unreadable files (for example, Windows system files visible in WSL), onboarding exits with an error suggesting you move the Dockerfile to a dedicated directory. +Build the sandbox image from a custom Dockerfile instead of the stock NemoClaw image. +The supplied Dockerfile defines the complete sandbox image, and NemoClaw does not layer it on top of the stock managed runtime. +The entire parent directory of the specified file is used as the Docker build context, so any files your Dockerfile references (scripts, config, etc.) must live alongside it. +When the supplied path is the selected agent's own managed Dockerfile (for example, `agents/hermes/Dockerfile` in the NemoClaw checkout the CLI runs from), NemoClaw applies one exception and stages the repository root as the build context, exactly as the managed build does, because that Dockerfile copies repository-root paths. +This lets you edit the managed Dockerfile in place (for example to add Python packages) and rebuild from it with `--from`. +For this managed exception, onboarding applies the `.dockerignore` from the repository root. +Its credential, key, and certificate rules exclude matching files and directories at every depth, including nested `.env` files, `secrets/` directories, and `*.pem` files. +For every other `--from` path, onboarding applies a `.dockerignore` from the Dockerfile's parent directory while calculating the context size and staging files for Docker. +NemoClaw also applies additional secret-safety exclusions that override `.dockerignore` negation rules: credential-style files and directories such as `.env*`, `.ssh/`, `.aws/`, `.netrc`, `.npmrc`, `secrets/`, `*.pem`, and `*.key` are still skipped even if `.dockerignore` tries to include them. +Without a `.dockerignore`, onboarding still skips common large or local-only directories (`node_modules`, `.git`, `.venv`, and `__pycache__`) while staging this context. +Other build outputs such as `dist/`, `target/`, or `build/` are included unless your `.dockerignore` excludes them. +If the staged context is larger than 100 MB, onboarding prints a warning before the Docker build starts. +Move the Dockerfile into a smaller dedicated directory or add `.dockerignore` entries for generated artifacts to shrink the context. +If the directory contains unreadable files (for example, Windows system files visible in WSL), onboarding exits with an error suggesting you move the Dockerfile to a dedicated directory. - NemoClaw builds user-supplied `--from` contexts with the OpenShell gateway builder. The host-side - local BuildKit prebuild is limited to build contexts generated entirely by NemoClaw. On a local - Docker-driver gateway, a `Local BuildKit build skipped` notice is expected and onboarding - continues with the custom image. + With a local Docker gateway, NemoClaw builds the staged custom context with BuildKit in the + gateway's Docker engine. It checks that the image is available, then passes its image reference to + OpenShell. A build failure stops before sandbox creation. A remote gateway without image + distribution cannot use `--from`. The native Podman provider does not admit custom Dockerfiles. ```bash @@ -1080,7 +1172,7 @@ The flag wins over `NEMOCLAW_SANDBOX_NAME`. When prompting is possible, `NEMOCLA ### `$$nemoclaw onboard --from` -Use a custom Dockerfile for the sandbox image. This variant of `$$nemoclaw onboard` accepts a `--from ` argument to build the sandbox from a user-supplied Dockerfile instead of the default NemoClaw image. The user-supplied context uses the OpenShell gateway builder instead of NemoClaw's host-side local BuildKit prebuild. +Use a custom Dockerfile for the sandbox image. This variant of `$$nemoclaw onboard` accepts a `--from ` argument to build the sandbox from a user-supplied Dockerfile instead of the default NemoClaw image. NemoClaw builds the staged context in the selected local Docker engine and checks the image before sandbox creation. ```bash $$nemoclaw onboard --from ./Dockerfile.custom @@ -1094,7 +1186,7 @@ Set `NEMOCLAW_DOCKER_GPU_PATCH=fallback` to explicitly authorize one native atte If OpenShell rejects the native `--gpu` flag before creation progress, NemoClaw proves that the sandbox and its labeled containers are absent without deleting by name. For another eligible failure, the retry requires verified cleanup. When the managed runtime requires cleanup tied to its recorded resource identities, NemoClaw stops before the compatibility retry. -Sandbox-reported CUDA output alone never authorizes the broader compatibility envelope, even when the operator enabled fallback. That case fails closed and points to the explicit `NEMOCLAW_DOCKER_GPU_PATCH=1` compatibility-only control. NemoClaw retries only after it verifies that no OpenShell-managed Docker container labeled for that sandbox remains; if cleanup cannot be proven safe, onboarding stops and prints cleanup guidance instead. On Docker Desktop WSL and Jetson/Tegra, automatic GPU onboarding uses the compatibility path directly. On ordinary native Linux, the compatibility path uses an available NVIDIA CDI spec before falling back to Docker `--gpus all` or the NVIDIA runtime. On Docker Desktop WSL, the compatibility path skips CDI and tries Docker `--gpus all` before the NVIDIA runtime. On Jetson/Tegra hosts, the compatibility path uses the NVIDIA runtime and adds eligible host group IDs for the supported GPU device nodes. These include selected `/dev/nvmap`, `/dev/nvhost-*`, and `/dev/nvgpu/igpu0/*` nodes plus real `/dev/dri/renderD*` character devices. After compatibility recreation starts, onboarding keeps the pre-patch container as a rollback backup until the replacement passes the Ready, GPU, and applicable local-inference checks. If one of those checks fails before backup removal, onboarding prints failure diagnostics and attempts to restore the pre-patch container. To commit the replacement, NemoClaw first asks OpenShell to stop the sandbox so its durable lifecycle row reaches `Stopped` before any irreversible Docker mutation. It then stops the exact transaction-owned replacement, removes the rollback backup, and asks OpenShell to start the sandbox so OpenShell owns the `Starting` lifecycle fence. NemoClaw verifies a `Ready` row, a working sandbox exec, and that the exact replacement is the sole running labeled container within the final handoff deadline. If that final handoff cannot be confirmed, onboarding exits with the container diagnostics and cleanup guidance instead of reporting success. If rollback fails, onboarding reports that the pre-patch container was not restored and prints container-cleanup guidance. GPU-proof diagnostics are captured before rollback and can print that guidance before the final container state is known, so inspect the sandbox and its labeled Docker containers before running a deletion command. +Sandbox-reported CUDA output alone never authorizes the broader compatibility envelope, even when the operator enabled fallback. That case fails closed and points to the explicit `NEMOCLAW_DOCKER_GPU_PATCH=1` compatibility-only control. NemoClaw retries only after it verifies that no OpenShell-managed Docker container labeled for that sandbox remains; if cleanup cannot be proven safe, onboarding stops and prints cleanup guidance instead. On Docker Desktop WSL and Jetson/Tegra, automatic GPU onboarding uses the compatibility path directly. On ordinary native Linux, the compatibility path uses an available NVIDIA CDI spec before falling back to Docker `--gpus all` or the NVIDIA runtime. On Docker Desktop WSL, the compatibility path skips CDI and tries Docker `--gpus all` before the NVIDIA runtime. On Jetson/Tegra hosts, the compatibility path uses the NVIDIA runtime and adds eligible host group IDs for the supported GPU device nodes. These include selected `/dev/nvmap`, `/dev/nvhost-*`, and `/dev/nvgpu/igpu0/*` nodes plus real `/dev/dri/renderD*` character devices. After compatibility recreation starts, onboarding keeps the pre-patch container as a rollback backup until the replacement reaches the OpenShell Ready or Running phase and passes the GPU and applicable local-inference checks. If one of those checks fails before backup removal, onboarding prints failure diagnostics and attempts to restore the pre-patch container. To commit the replacement, NemoClaw first asks OpenShell to stop the sandbox so its durable lifecycle row reaches `Stopped` before any irreversible Docker mutation. It then stops the exact transaction-owned replacement, removes the rollback backup, and asks OpenShell to start the sandbox so OpenShell owns the `Starting` lifecycle fence. NemoClaw verifies an OpenShell `Ready` or `Running` row, a working sandbox exec, and that the exact replacement is the sole running labeled container within the final handoff deadline. If that final handoff cannot be confirmed, onboarding exits with the container diagnostics and cleanup guidance instead of reporting success. If rollback fails, onboarding reports that the pre-patch container was not restored and prints container-cleanup guidance. GPU-proof diagnostics are captured before rollback and can print that guidance before the final container state is known, so inspect the sandbox and its labeled Docker containers before running a deletion command. Prerequisites: @@ -1161,21 +1253,21 @@ During that lease, another `launch` still verifies these conditions: - The owning OpenShell gateway reports the exact sandbox identity in the `Ready` or `Running` state. - The sandbox registry, agent manifest, and interactive command match the recorded identity, and the current OpenShell policy is readable and valid. The lease stores no policy hash, so trusted host-side policy changes do not invalidate launch readiness. - + - The recorded inference selection matches its provider path, and every configured route serves a valid response to a bounded request for the recorded model. - NVIDIA Endpoints and supported fixed hosted selections verify their recorded sandbox-attached provider and request the model at its native endpoint without a shared-route models probe. - Retained legacy, custom, and local shared routes use `inference.local`. + NVIDIA Endpoints, supported fixed hosted selections, new hosted compatible selections outside the Personal tier, and qualified new local selections verify their recorded sandbox-attached provider and request the model at its native endpoint without a shared-route models probe. + Local NVIDIA NIM, fresh Personal-tier hosted compatible selections, custom endpoints without an attachment, and retained shared selections use `inference.local`. Their models probe must return HTTP 2xx, except that a retained legacy `openrouter-api` shared route can return HTTP 404 for `GET /v1/models` when the bounded model request succeeds. A failed model request rejects readiness before the agent starts. This check is stricter than the HTTP 200–499 reachability diagnostic used by ordinary `connect`. - + - The recorded inference selection matches its provider path, and every configured route serves a valid response to a bounded request for the recorded model. - NVIDIA Endpoints and supported fixed hosted selections verify their recorded sandbox-attached provider and request the model at its native endpoint without a shared-route models probe. - Retained legacy, custom, and local shared routes use `inference.local`. + NVIDIA Endpoints, supported fixed hosted selections, new hosted compatible selections outside the Personal tier, and qualifying new local selections verify their recorded sandbox-attached provider and request the model at its native endpoint without a shared-route models probe. + Owned Local NVIDIA NIM, retained legacy routes, and other custom routes without an attachment use `inference.local`. Their models probe must return HTTP 2xx, except that a retained legacy `openrouter-api` shared route can return HTTP 404 for `GET /v1/models` when the bounded model request succeeds. A failed model request rejects readiness before the agent starts. @@ -1249,9 +1341,12 @@ A recognized broken shared-route result lets `connect` attempt DNS or route repa When the initial shared-route probe cannot return a trusted result, `connect` fails closed before health-driven repair and before opening SSH. It prints a bounded, redacted last-probe detail and points you to `$$nemoclaw doctor`. -For NVIDIA Endpoints and supported fixed hosted selections, `connect` does not inspect or change the unrelated shared route. +For NVIDIA Endpoints, supported fixed hosted selections, new hosted compatible selections outside the Personal tier, and qualified new local selections with an attachment, `connect` does not inspect or change the unrelated shared route. It verifies the recorded sandbox-attached provider and sends a native inference request for the selected model. -The request must return a structurally valid successful inference result before `connect` opens SSH. +For a verified native NVIDIA attachment, HTTP `429`, `500`, `502`, `503`, or `504`, or a confirmed request timeout, lets interactive `connect` open a diagnostic shell with a degraded warning after gateway checks pass. +The failed request leaves model availability unverified; retry after the upstream service recovers. +`connect --probe-only` still requires a successful inference request before it can publish launch-readiness evidence. +Other providers and terminal credential, route, policy, and malformed-response failures stop `connect` before SSH opens. After route discovery succeeds, every configured Deep Agents Code route must also serve a valid response to a bounded request for the recorded model. A failed model request or missing provider or model metadata stops `connect` before SSH opens. @@ -1401,6 +1496,10 @@ This prevents an unused pipe from delaying execution while OpenShell waits for E Nonempty `--message-file` arguments and calls without a recognized inline message preserve a pipe or redirect. The sandbox resolves message-file paths, including symlinks to stdin. For example, the wrapper preserves redirected input for `printf 'ping' | $$nemoclaw my-assistant agent --agent main`. +The producer must close standard input after writing the message. +The managed OpenClaw parser waits up to 30 seconds for piped input, including `--message-file /dev/stdin` and symlinks to stdin. +A positive `--timeout ` sets this input wait as well as the agent turn timeout. +If the input deadline expires, the command exits nonzero with guidance to close the producer or provide an inline message. When the top-level OpenClaw `--json` output flag is present, the wrapper uses a captured no-TTY path with a `64 MiB` buffer so `stdout` stays parseable JSON. Raw `stderr`, including structured JSON diagnostics, is forwarded unchanged. NemoClaw appends failed-tool or untrusted-child provenance only from the `stdout` JSON. The wrapper reads completion markers only from the final matching OpenClaw response envelope: a local `{ payloads, meta }` response or a gateway `{ status, result: { payloads, meta } }` response. It ignores earlier JSON progress or log records. It exits with status `1` when that metadata contains `error.kind: "incomplete_turn"`, `livenessState: "abandoned"`, or a `timeoutPhase` value, even when the envelope reports success. `replayInvalid: true` means replaying the turn may repeat side effects. The wrapper accepts it only with evidence of a completed run, a successful tool summary, and final assistant text matching the reply payload. Otherwise it exits with status `1` and the existing inspect-before-retry guidance. Marker-shaped values inside tool results, tool-call arguments, or other descendants do not change the exit status. A turn can run every tool successfully and still become abandoned before it produces a reply. The wrapper writes the unchanged JSON trace to `stdout` before it reports the incomplete turn, so the partial tool trace remains available. The wrapper writes the verdict, the detected markers, and verify-before-retry guidance to `stderr`. A `timeoutPhase` value names the phase the deadline fired in, so the wrapper writes deadline guidance in place of the generic incomplete-turn text. Tool calls in a partial trace may have already applied side effects, so verify what the turn changed before you retry it. The wrapper passes through an upstream non-zero exit status unchanged. Literal `--json` values consumed by flags such as `-m` or `--reply-channel`, or arguments after `--`, stay on the normal passthrough path. Documented value flags written as `--flag=value`, such as `--session-id=s1`, are recognized the same way as separated value flags. If an unrecognized OpenClaw option appears before `--json`, NemoClaw also keeps the command on the normal passthrough path so OpenClaw remains the argv source of truth. @@ -1677,7 +1776,7 @@ $$nemoclaw my-assistant start When that deadline expires, `start` keeps the existing container, exits non-zero, and prints the `NEMOCLAW_CONNECT_TIMEOUT` value to use on the next run. -After the gateway and forward checks pass, `start` sends one inference request through the sandbox's selected provider path using its recorded provider and model. 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. A reachable provider path can still reject an inference request or return an invalid result, so the command exits non-zero in either case. It prints the probe result, including the HTTP status when the path returned one, and points you to the sandbox doctor command. Ordinary providers request 16 reply tokens; Gemini requests 256 reply tokens so reasoning has room before visible content. The request allows up to 90 seconds, and the host wrapper allows 95 seconds for bounded process startup and cleanup. Each run consumes provider tokens on a hosted path. When the sandbox records no provider or no model, `start` skips the request and exits `0`. For a shared gateway route, `doctor` still classifies an HTTP `401` or `403` response as reachable. The native NVIDIA doctor probe instead requires a 2xx response from the sandbox-attached provider. Correct the provider credential when `start` reports either status. +After the gateway and forward checks pass, `start` sends one inference request through the sandbox's selected provider path using its recorded provider and model. NVIDIA Endpoints, supported fixed hosted providers, new hosted compatible selections outside the Personal tier, and qualified new local selections use native endpoints through sandbox-attached OpenShell providers. Owned Local NVIDIA NIM, fresh Personal-tier hosted compatible selections, custom endpoints without an attachment, and retained shared routes use `inference.local`. After an OpenClaw sandbox and gateway become Ready, a verified native NVIDIA attachment can start with degraded inference when the request returns HTTP `429`, `500`, `502`, `503`, or `504`, or a confirmed timeout. The command clears the stop record and exits `0`, but the failed request leaves model availability unverified. A terminal credential, route, policy, or malformed-response failure still exits non-zero. Other providers also exit non-zero when the inference request fails. For terminal failures, the command prints the probe result, including any HTTP status, and points you to the sandbox doctor command. Ordinary providers request 16 reply tokens; Gemini requests 256 reply tokens so reasoning has room before visible content. The request allows up to 90 seconds, and the host wrapper allows 95 seconds for bounded process startup and cleanup. Each run consumes provider tokens on a hosted path. When the sandbox records no provider or no model, `start` skips the request and exits `0`. For a shared gateway route, `doctor` still classifies an HTTP `401` or `403` response as reachable. The native NVIDIA doctor probe instead requires a 2xx response from the sandbox-attached provider. Correct the provider credential when `start` reports either status. ### `$$nemoclaw status` @@ -1692,13 +1791,30 @@ nonzero. A stopped runtime without recorded stop intent remains a For a `compatible-endpoint` route that uses `openai-completions`, the text output prints `Reasoning effort` as `low`, `medium`, `high`, or `endpoint-default`. The line is omitted for another provider or API family. -Pass `--json` to emit a structured per-sandbox report instead of the text renderer. The JSON output includes at least `schemaVersion`, `name`, `found`, `agent`, `agentDisplayName`, `agentRuntime`, `dcodeAutoApprovalMode`, `model`, `provider`, `recordedRoute`, `liveRoute`, `routeDrift`, `phase`, `gatewayState`, `inferenceHealth`, `inferenceProbeSuppressed`, `rpcIssue`, `hostGpuDetected`, `sandboxGpuEnabled`, `sandboxGpuMode`, `sandboxGpuDevice`, `openshellDriver`, `openshellVersion`, `policies`, `policiesAvailable`, `llamaCpp`, `failureLayer`, `terminalRuntimeHealth`, `servingProcessHealth`, and `dockerPaused`. `policies` is derived from the current OpenShell policy; NemoClaw does not persist a second preset list or baseline-exclusion ledger. `policiesAvailable` is `false` when that live policy cannot be read or parsed, distinguishing an unavailable result from a verified empty `policies` array; text status prints `Policies: unavailable` for the same state. When the live gateway route matches the sandbox's recorded llama.cpp route, `llamaCpp.kind` is `attached`, `managed`, or `unavailable`. An attached route also includes its fixed loopback `llamaCpp.endpointUrl`. An unavailable result means NemoClaw could not safely verify the managed ownership receipt; it does not include an endpoint and provides a secret-free diagnostic and recovery action. During route drift, `status` omits the `llamaCpp` route attribution; inspect `routeDrift` before acting on endpoint information. Text status can still show managed-runtime details from the sandbox-owned receipt. The schema-version `1` `model` and `provider` fields keep their established live-route meaning when the gateway route is readable, except that sandboxes with native NVIDIA or fixed hosted provider attachments report their recorded sandbox-scoped route because the shared route is unrelated. Use `recordedRoute` for the sandbox's durable provider and model and `liveRoute` for the gateway-global route. When the live shared route differs for a shared-route provider, text output prints both routes and JSON output sets `routeDrift.live`, `routeDrift.recorded`, and `routeDrift.canConnect`. Native NVIDIA and fixed hosted provider attachments do not report shared-route drift. When `routeDrift.canConnect` is `false`, `connect` cannot safely restore the recorded route because provider-global identity differs or required route or gateway metadata is incomplete. Refer to [Use Shared Gateway Routes](../inference/manage-inference/use-shared-gateway-routes) for the route-sharing workflow. `openshellDriver` and `openshellVersion` are always strings (falling back to `"unknown"` when the registry has no value), so consumers can rely on `typeof` checks. `agent` is always a string and reports `openclaw` when the registry records no agent for the sandbox. `failureLayer` is `null` when no preflight failure was detected and otherwise one of `docker_unreachable`, `sandbox_container_stopped`, or `sandbox_dashboard_port_conflict`; when set, `inferenceHealth` is suppressed to `null` so automation does not see a stale remote-provider healthy status during a local outage. `inferenceHealth.ok` reports whether the selected provider path returned a structurally valid result for one request sent from inside the sandbox. The result must match Chat Completions, Responses, or Anthropic Messages for the selected route. An empty body, malformed JSON, provider-error envelope, or wrong response shape reports `unhealthy`, even with a 2xx status. The probe captures at most 64 KiB and does not include the response body in diagnostics. The path probe treats any final HTTP status from `200` through `499` as reachable, so a route with an invalidated provider credential answers HTTP `401` while the path is up. Shared-route requests use the live gateway route's provider and model, then fall back to the recorded values when the live route is unreadable. Native NVIDIA and hosted requests always use the sandbox's recorded provider and model. When the live shared provider matches the recorded provider, the request uses the sandbox's recorded API family, even when only the model differs. This includes `openai-responses`. When the live shared provider differs, NemoClaw does not carry the recorded API family to that provider. Each attempt requests 16 reply tokens for ordinary providers or 256 for Gemini. The request allows up to 90 seconds, and the host wrapper allows 95 seconds for bounded process startup and cleanup. Hosted requests consume provider tokens on every attempt. When the inference request returns HTTP `429`, `502`, `503`, or `504`, `status` retries the provider path and inference request together up to three total attempts, with a two-second delay between failed attempts, because those statuses are transient gateway and availability answers rather than evidence that the path is broken. Before each retry, it writes the failed probe boundary, an HTTP status when one is available, the next attempt, total attempts, and delay to stderr; `--json` keeps stdout machine-readable. On an ordinary run, every other failure is final on the first attempt with no delay: HTTP `401`, `403`, `404`, and `500`, an invalid 2xx response body, a request that returned no HTTP status, and a failing provider-path probe. When the same run recovers a managed gateway, `status` retries any failed route or inference probe on that schedule instead, while the restarted delivery chain settles. Each route probe has a 10-second timeout. Three complete route probes plus their 95-second inference wrappers and two delays can take about 319 seconds. When NemoClaw sends an inference request, `inferenceHealth.subprobes` reports the provider-path result as the `route reachability` hop, so a failing verdict still shows that the path itself answered. `inferenceHealth.failureLabel` reports why the inference request failed: +Pass `--json` to emit a structured per-sandbox report instead of the text renderer. The JSON output includes at least `schemaVersion`, `name`, `found`, `agent`, `agentDisplayName`, `agentRuntime`, `dcodeAutoApprovalMode`, `model`, `provider`, `recordedRoute`, `liveRoute`, `routeDrift`, `phase`, `gatewayState`, `inferenceHealth`, `rpcIssue`, `hostGpuDetected`, `sandboxGpuEnabled`, `sandboxGpuMode`, `sandboxGpuDevice`, `openshellDriver`, `openshellVersion`, `policies`, `policiesAvailable`, `llamaCpp`, `failureLayer`, `terminalRuntimeHealth`, `servingProcessHealth`, and `dockerPaused`. `policies` is derived from the current OpenShell policy; NemoClaw does not persist a second preset list or baseline-exclusion ledger. `policiesAvailable` is `false` when that live policy cannot be read or parsed, distinguishing an unavailable result from a verified empty `policies` array; text status prints `Policies: unavailable` for the same state. When the live gateway route matches the sandbox's recorded llama.cpp route, `llamaCpp.kind` is `attached`, `managed`, or `unavailable`. An attached route also includes its fixed loopback `llamaCpp.endpointUrl`. An unavailable result means NemoClaw could not safely verify the managed ownership receipt; it does not include an endpoint and provides a secret-free diagnostic and recovery action. During route drift, `status` omits the `llamaCpp` route attribution; inspect `routeDrift` before acting on endpoint information. Text status can still show managed-runtime details from the sandbox-owned receipt. The schema-version `1` `model` and `provider` fields keep their established live-route meaning when the gateway route is readable, except that sandboxes with native NVIDIA, fixed hosted, or Deep Agents Code, Hermes, or OpenClaw native local provider attachments report their recorded sandbox-scoped route because the shared route is unrelated. Use `recordedRoute` for the sandbox's durable provider and model and `liveRoute` for the gateway-global route. When the live shared route differs for a shared-route provider, text output prints both routes and JSON output sets `routeDrift.live`, `routeDrift.recorded`, and `routeDrift.canConnect`. Native NVIDIA, fixed hosted, and Deep Agents Code, Hermes, or OpenClaw native local provider attachments do not report shared-route drift. When `routeDrift.canConnect` is `false`, `connect` cannot safely restore the recorded route because provider-global identity differs or required route or gateway metadata is incomplete. Refer to [Use Shared Gateway Routes](../inference/manage-inference/use-shared-gateway-routes) for the route-sharing workflow. `openshellDriver` and `openshellVersion` are always strings (falling back to `"unknown"` when the registry has no value), so consumers can rely on `typeof` checks. `agent` is always a string and reports `openclaw` when the registry records no agent for the sandbox. `failureLayer` is `null` when no preflight failure was detected and otherwise one of `docker_unreachable`, `sandbox_container_stopped`, or `sandbox_dashboard_port_conflict`; when set, `inferenceHealth` is suppressed to `null` so automation does not see a stale remote-provider healthy status during a local outage. `inferenceHealth.ok` can mean a valid model response, a reachable route without a request, or a degraded native NVIDIA result. Inspect `degraded` and `probed` before treating it as verified model health. The result must match Chat Completions, Responses, or Anthropic Messages for the selected route. An empty body, malformed JSON, provider-error envelope, or wrong response shape reports `unhealthy`, even with a 2xx status. The probe captures at most 64 KiB and does not include the response body in diagnostics. The path probe treats any final HTTP status from `200` through `499` as reachable, so a route with an invalidated provider credential answers HTTP `401` while the path is up. Shared-route requests use the live gateway route's provider and model, then fall back to the recorded values when the live route is unreadable. Native NVIDIA, hosted, and Deep Agents Code, Hermes, or OpenClaw native local requests always use the sandbox's recorded provider and model. When the live shared provider matches the recorded provider, the request uses the sandbox's recorded API family, even when only the model differs. This includes `openai-responses`. When the live shared provider differs, NemoClaw does not carry the recorded API family to that provider. Each attempt requests 16 reply tokens for ordinary providers or 256 for Gemini. The request allows up to 90 seconds, and the host wrapper allows 95 seconds for bounded process startup and cleanup. Hosted requests consume provider tokens on every attempt. When the inference request returns HTTP `429`, `500`, `502`, `503`, or `504`, `status` retries the selected provider path and request up to three total attempts, with a two-second delay between failed attempts, because those statuses are transient gateway and availability answers rather than evidence that the path is broken. Before each retry, it writes the failed probe boundary, an HTTP status when one is available, the next attempt, total attempts, and delay to stderr; `--json` keeps stdout machine-readable. On an ordinary run, terminal HTTP `401`, `403`, or `404`, an invalid 2xx response body, an unconfirmed statusless failure, and a failing provider-path probe are final on the first attempt. When the same run recovers a managed gateway, `status` retries any failed route or inference probe on that schedule instead, while the restarted delivery chain settles. Each route probe has a 10-second timeout. Three complete route probes plus their 95-second inference wrappers and two delays can take about 319 seconds. When NemoClaw sends an inference request, `inferenceHealth.subprobes` reports the provider-path result as the `route reachability` hop, so a failing verdict still shows that the path itself answered. `inferenceHealth.failureLabel` reports why the inference request failed: - `unauthorized` when the route rejected it with HTTP `401` or `403`. - `unhealthy` when the route returned another failing HTTP status or an invalid 2xx response body. - `unreachable` when the request returned no HTTP status, including a probe that could not run. -A host-side upstream probe under `inferenceHealth.subprobes` stays a diagnostic and does not change `inferenceHealth.ok`, because the sandbox route is the one the agent uses. When the route probe failed, or the sandbox records no provider or no model, NemoClaw skips the inference request and `inferenceHealth` reports the route probe result alone. `dockerPaused` is `true` when NemoClaw detects that the Docker-driver sandbox container is paused. In that case, text output keeps OpenShell's authoritative phase but prints a `docker unpause ` recovery hint instead of sending you directly to rebuild. For terminal runtime sandboxes, the command also checks cgroup OOM kill counters. If the counter records an OOM kill, text output prints `Runtime health: degraded (... OOM kill recorded)` and points you to `$$nemoclaw rebuild`; JSON output reports `terminalRuntimeHealth.kind: "degraded"` with the OOM kill count and source counter path. For a present gateway runtime, text output prints `Serving process ( gateway): not checked`, and JSON output reports `servingProcessHealth: { "checked": false }`. The existing inference probes run in a fresh sandbox command, so they do not attest that the long-running gateway process has equivalent inference access. NemoClaw does not probe the serving process yet. For terminal runtimes, `servingProcessHealth` is `null` and the text output omits this line because there is no long-running gateway process. The command exits non-zero when the sandbox is missing locally, the gateway state is neither `present` nor `missing` with confirmed `phase: "Stopped"`, the gateway reports a schema/protobuf mismatch (mirrored as `rpcIssue`), `failureLayer` is non-null, the authoritative in-sandbox inference route fails or cannot be probed, managed llama.cpp ownership is unavailable, or a terminal runtime sandbox reports a recorded OOM kill. When the canonical text command targets an unregistered name, it reports that the sandbox is not registered and tells you to run `$$nemoclaw list`. The alias form `$$nemoclaw status --json` requires the sandbox to be registered locally; the canonical form `$$nemoclaw sandbox status --json` is the one to use from automation that may run against an unknown sandbox name, since it still emits a JSON document with `found: false` instead of a text error. + + +For a Hermes native NVIDIA route, `status` also verifies the agent's managed credential reference independently of the provider-path request. +If the verifier confirms an invalid or stale reference, `inferenceHealth` reports `ok: false`, `probed: false`, and `failureLabel: "unauthorized"`, even when the provider-path request succeeded. +The text output reports `not probed` for the agent credential check. For a confirmed rejection, it directs you to `$$nemoclaw rebuild` to refresh the managed credential. +After rebuilding, rerun `$$nemoclaw status`; healthy inference requires both a successful provider-path request and a verified managed credential reference. +If verification is unavailable because the credential check times out, sandbox access fails, or the installed image lacks the verifier, the agent credential result reports `failureLabel: "unreachable"`, `ok: false`, and `probed: false`. +If the provider-path result already failed, `inferenceHealth` keeps that result and adds the unavailable credential result to `subprobes`. +Otherwise, the unavailable credential result becomes the main inference result. +When a credential failure becomes the main result, the provider-path result and its existing diagnostics remain in `subprobes`. +The command exits nonzero in each failure case. +If status reports that the installed image lacks the verifier, rebuild the sandbox to install it, then rerun status. +For other unavailable-verification results, retry status. If verification remains unavailable, check sandbox health and recover access before retrying. +Retained shared NVIDIA routes do not use this additional check. + + + +A host-side upstream probe under `inferenceHealth.subprobes` stays a diagnostic and does not change `inferenceHealth.ok`, because the sandbox route is the one the agent uses. When the route probe failed, or the sandbox records no provider or no model, NemoClaw skips the inference request and `inferenceHealth` reports the route probe result alone. `dockerPaused` is `true` when NemoClaw detects that the Docker-driver sandbox container is paused. In that case, text output keeps OpenShell's authoritative phase but prints a `docker unpause ` recovery hint instead of sending you directly to rebuild. For terminal runtime sandboxes, the command also checks cgroup OOM kill counters. If the counter records an OOM kill, text output prints `Runtime health: degraded (... OOM kill recorded)` and points you to `$$nemoclaw rebuild`; JSON output reports `terminalRuntimeHealth.kind: "degraded"` with the OOM kill count and source counter path. For a present gateway runtime, text output prints `Serving process ( gateway): not checked`, and JSON output reports `servingProcessHealth: { "checked": false }`. The existing inference probes run in a fresh sandbox command, so they do not attest that the long-running gateway process has equivalent inference access. NemoClaw does not probe the serving process yet. For terminal runtimes, `servingProcessHealth` is `null` and the text output omits this line because there is no long-running gateway process. The command exits non-zero when the sandbox is missing locally, the gateway state is neither `present` nor `missing` with confirmed `phase: "Stopped"`, the gateway reports a schema/protobuf mismatch (mirrored as `rpcIssue`), `failureLayer` is non-null, the authoritative in-sandbox inference route fails or cannot be probed outside a degraded native NVIDIA transient result, managed llama.cpp ownership is unavailable, or a terminal runtime sandbox reports a recorded OOM kill. When the canonical text command targets an unregistered name, it reports that the sandbox is not registered and tells you to run `$$nemoclaw list`. The alias form `$$nemoclaw status --json` requires the sandbox to be registered locally; the canonical form `$$nemoclaw sandbox status --json` is the one to use from automation that may run against an unknown sandbox name, since it still emits a JSON document with `found: false` instead of a text error. For a sandbox that owns managed llama.cpp, text output also reports the recipe ID, model digest, image reference, `https://inference.local/v1` endpoint, and lifecycle state. It does not print the managed API key or its fingerprint. The lifecycle state is one of these values: @@ -1713,6 +1829,10 @@ For a sandbox that owns managed llama.cpp, text output also reports the recipe I The managed llama.cpp check forces a nonzero exit for `absent`, `conflict`, or `unknown`. Other sandbox and inference checks can also make the command fail. Rerun the same `NEMOCLAW_PROVIDER=install-llama-cpp` and `NEMOCLAW_LLAMACPP_RECIPE` onboarding selection to recover a stopped or interrupted runtime. Inspect and correct an identity conflict before retrying. +An existing Windows WSL Qwen runtime with the former pinned image cannot start or resume. +After a qualified native image is pinned, save any sandbox files you need, run `$$nemoclaw destroy` to remove the owning sandbox and its managed runtime, and onboard again. +The shared model cache is preserved. See [Upgrade or Roll Back](../inference/local-inference/set-up-llama-cpp#upgrade-or-roll-back). + For a Deep Agents sandbox, text output includes `DCode auto-approval capability: disabled` or `DCode auto-approval capability: thread-opt-in`. JSON output reports the same configured value in `dcodeAutoApprovalMode`. This value does not attest that auto-approval is active in any live TUI thread. @@ -1725,27 +1845,20 @@ $$nemoclaw my-assistant status --json $$nemoclaw sandbox status my-assistant --json ``` -On a normal status read, the command probes the selected provider path from inside the sandbox. -When that probe reports the path reachable, it sends an inference request over the same path. 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. That inference request is the authoritative inference health check, and both checks exercise the path that agent traffic uses. The main `Inference` line reports one of these states: +The command probes the selected provider path from inside the sandbox, and when that probe reports the path reachable it sends an inference request over the same path. NVIDIA Endpoints, supported fixed hosted providers, new hosted compatible selections outside the Personal tier, and qualified new local selections use native endpoints through sandbox-attached OpenShell providers. Owned Local NVIDIA NIM, fresh Personal-tier hosted compatible selections, custom endpoints without an attachment, and retained shared routes use `inference.local`. The inference request verifies the selected provider path, and both checks exercise the path that agent traffic uses. For provider-path results, the main `Inference` line uses these states: | State | Meaning | | -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `healthy` | The route returned a structurally valid result for the inference request. | +| `degraded` | A verified native NVIDIA route had a transient request failure after bounded retries. The model response remains unverified, but `status` exits `0`. | | `unauthorized` | The route rejected the inference request with HTTP `401` or `403`. | | `reachable` | The route returned an HTTP status from `200` through `499` and NemoClaw did not send an inference request. | -| `unhealthy` | The route returned HTTP `500` through `599`, another failing status, or an invalid 2xx response body. | -| `unreachable` | The route had a transport failure, returned no final HTTP status (`000` or an interim `100` through `199`), returned an invalid status outside `100` through `599`, or the inference request returned no HTTP status. | +| `unhealthy` | The route returned a failing HTTP status or invalid 2xx response body outside a degraded native NVIDIA result. | +| `unreachable` | The route had a transport failure, no final HTTP status, or an invalid status, or the request returned no HTTP status without a confirmed native NVIDIA timeout. | | `not probed` | NemoClaw could not run the authoritative route probe from a reachable sandbox. | | `not verified` | NemoClaw could not verify the sandbox or gateway state, so it skips inference probing. | -When another lifecycle operation is in progress and NemoClaw confirms that no Portable authority exists, status returns a best-effort, read-only snapshot that can show transitional state. -It does not run inference health checks or send an inference request. -It does not repair the gateway, host forward, stop-intent record, or Hermes tool gateway broker. -JSON output sets `inferenceProbeSuppressed` to `true`. -If NemoClaw finds or cannot rule out Portable authority, status fails fast. -If Portable authority appears during the snapshot, status reports a lifecycle conflict after it finishes the snapshot. - -An authentication response on a shared gateway route probe confirms that the route is reachable, not that provider credentials are valid. For those shared routes, `$$nemoclaw doctor` sends no inference request, so it reports an HTTP `401` or `403` route response as reachable and exits `0` where `status` reports `unauthorized`. Native hosted doctor checks verify the recorded provider identity and sandbox attachment, then require a successful inference request through the selected native endpoint. The native NVIDIA doctor probe verifies the sandbox-attached provider directly and requires a 2xx response. The command can also print direct host-side provider checks such as `Inference (upstream)` and provider-specific subprobes. For supported remote providers, this diagnostic sends an authenticated request to the configured model and accepts only a recognized Chat Completions, streaming Chat Completions, or Anthropic Messages response. It uses a 3-second connection timeout, a 5-second total timeout, and an 8-token output limit. If the request reaches the time limit, NemoClaw reports the provider as `not probed` and leaves model health unverified instead of reporting it as unhealthy. These checks are diagnostic only and do not override the authoritative selected-provider result or determine the command exit status. +An authentication response on a shared gateway route probe confirms that the route is reachable, not that provider credentials are valid. For those shared routes, `$$nemoclaw doctor` sends no inference request, so it reports an HTTP `401` or `403` route response as reachable and exits `0` where `status` reports `unauthorized`. Native hosted and Deep Agents Code, Hermes, and OpenClaw native local doctor checks verify the recorded provider identity and sandbox attachment, then require a successful inference request through the selected native endpoint. The native NVIDIA doctor probe verifies the sandbox-attached provider directly and requires a 2xx response. The command can also print direct host-side provider checks such as `Inference (upstream)` and provider-specific subprobes. For supported remote providers, this diagnostic sends an authenticated request to the configured model and accepts only a recognized Chat Completions, streaming Chat Completions, or Anthropic Messages response. It uses a 3-second connection timeout, a 5-second total timeout, and an 8-token output limit. If that host-side request reaches the time limit, `Inference (upstream)` reports `not probed` and leaves model health unverified. A confirmed timeout of the authoritative native NVIDIA request instead reports `degraded` after bounded retries. Host-side checks are diagnostic only and do not override the authoritative selected-provider result or determine the command exit status. The `Inference (upstream)` check authenticates with the host credential that NemoClaw resolves for the provider, such as `NVIDIA_INFERENCE_API_KEY`. OpenShell stores the credential that the sandbox's selected provider path uses. The CLI cannot read the stored value back, so the two credentials can hold different secrets. When the managed sandbox path has already served the inference request, an `unauthorized` result on `Inference (upstream)` describes the host credential. NemoClaw then reports that check as `not probed` and names both credential sources. An `Inference (upstream)` check that fails for another reason, such as `unreachable`, still reports its own state. Local backend and auth proxy checks, such as `Inference (auth proxy)`, always report their own state and their own repair step. For a shared route, `$$nemoclaw doctor` sends no inference request, so it reports the `Inference (upstream)` state that it measured. @@ -1758,7 +1871,7 @@ When the sandbox's recorded driver is `docker` and the host Docker daemon is not When the host Docker daemon is reachable but the per-sandbox container is stopped without a matching intentional-stop record, the initial preflight records the `sandbox_container_stopped` failure layer and suppresses the host-side `Inference` probe. A matching intentional-stop record instead produces the clean `Stopped` result described above. If the owning OpenShell gateway is healthy but no longer lists the registered sandbox, status preserves the local registration and reports the missing OpenShell state without directly starting, unpausing, renaming, or replacing a container. -When lifecycle locks are available and OpenShell reports the registered Docker-driver sandbox as present and `Ready`, status verifies the OpenClaw gateway and host forward. +If OpenShell already reports the registered Docker-driver sandbox as present and `Ready`, status verifies the OpenClaw gateway and host forward. It recovers either component when the verification reports it absent. When status finds a running sandbox but cannot clear its stale intentional-stop record, it exits non-zero and reports the `stop_intent_update_failed` state. @@ -1842,7 +1955,15 @@ Expected output: ... ``` -If the sandbox is running an older Hermes version than this NemoClaw release expects, `status` and `connect` add an `Update` line pointing at `nemohermes rebuild` to pick up the newer version. The rebuild reuses the existing sandbox name and transfers the complete native home while OpenShell keeps credential stores under its own lifecycle. +If a non-Portable sandbox runs an older Hermes version than this NemoClaw release expects, `status` and `connect` add an `Update` line that points to `nemohermes rebuild`. +The rebuild reuses the existing sandbox name and transfers the complete native home while OpenShell keeps credential stores under its lifecycle. + +Portable Hermes does not support `rebuild`. +Replace an older Portable Hermes image through a fresh Portable onboarding run: + +```bash +nemohermes onboard --experimental-profile portable --fresh --name --recreate-sandbox +``` @@ -1888,7 +2009,8 @@ The `Registered gateway binding` result depends on the sandbox registry: - For a registered sandbox with an invalid binding, the check fails, and `doctor` does not select, probe, or recover a gateway from that binding. - For an unregistered sandbox name, `doctor` uses the gateway selected by `NEMOCLAW_GATEWAY_PORT` for its other gateway checks and omits the `Registered gateway binding` check. -For inference health, `doctor` treats the selected provider path inside the sandbox as authoritative. Providers that still use the shared route probe the shared gateway route at `https://inference.local/v1/models`; responses from `200` through `499`, including `401` and `403`, pass that reachability check. NVIDIA Endpoints instead probes its sandbox-attached provider at `https://integrate.api.nvidia.com/v1/models` and requires a 2xx response. For the shared route, HTTP `500` through `599`, interim `100` through `199`, transport failures with status `000`, invalid status values, and an unavailable authoritative probe fail the check. For native NVIDIA, any non-2xx response or unavailable probe fails it. Fixed hosted providers verify their recorded attachment and make an inference request to their native endpoint; a healthy shared route cannot satisfy that check. Host-side upstream probes use the same authenticated model-invocation checks as status and remain diagnostic only, so their failure does not fail `doctor` when the authoritative in-sandbox path is reachable. For gateway runtimes, `doctor` also reports an informational `Serving process: not checked` result because its fresh sandbox probes do not attest the long-running gateway process. This result does not fail the readiness check. Terminal runtimes omit it because they have no long-running gateway process. The `Inference` `Route` check warns when either the provider or model is unknown. After the gateway is healthy, run `$$nemoclaw status` to refresh the route information. +For inference health, `doctor` treats the selected provider path inside the sandbox as authoritative. Providers that still use the shared route probe the shared gateway route at `https://inference.local/v1/models`; responses from `200` through `499`, including `401` and `403`, pass that reachability check. NVIDIA Endpoints instead probes its sandbox-attached provider at `https://integrate.api.nvidia.com/v1/models` and requires a 2xx response. For the shared route, HTTP `500` through `599`, interim `100` through `199`, transport failures with status `000`, invalid status values, and an unavailable authoritative probe fail the check. For native NVIDIA, any non-2xx response or unavailable probe fails it. Fixed hosted providers, new hosted compatible selections outside the Personal tier, and qualified new local selections verify their recorded attachment and make an inference request to their native endpoint. +A healthy shared route cannot satisfy that check. Host-side upstream probes use the same authenticated model-invocation checks as status and remain diagnostic only, so their failure does not fail `doctor` when the authoritative in-sandbox path is reachable. For gateway runtimes, `doctor` also reports an informational `Serving process: not checked` result because its fresh sandbox probes do not attest the long-running gateway process. This result does not fail the readiness check. Terminal runtimes omit it because they have no long-running gateway process. The `Inference` `Route` check warns when either the provider or model is unknown. After the gateway is healthy, run `$$nemoclaw status` to refresh the route information. Warnings do not make the command fail. Failed checks, including a failed or unavailable authoritative inference route, exit non-zero so scripts can use `doctor` as a readiness gate. Use `--json` for machine-readable output. For a `compatible-endpoint` route that uses `openai-completions`, the JSON report includes an informational `Inference` check labeled `Reasoning effort`. The check reports `low`, `medium`, `high`, or `endpoint-default` and never includes credentials. Because the check has `info` status, it does not change the command's exit status. @@ -1982,7 +2104,9 @@ Use `--since ` to show recent logs only, such as `5m`, `1h`, or `30s`. OpenShell log entries. If NemoClaw cannot enable OpenShell audit logs, it prints a warning and policy-denial events can be -missing. +missing. With `NEMOCLAW_NO_AUTO_AUDIT_LOGS=1`, NemoClaw leaves the audit setting unchanged and does +not print that warning; policy-denial events can also be missing if audit logging was disabled. See +[the audit-setting guidance](./troubleshooting#a-request-inside-the-sandbox-fails-with-connect-tunnel-failed-response-403). NemoClaw labels nonempty OpenClaw gateway log lines with `[gateway]` after any recognized leading @@ -2014,6 +2138,9 @@ URL=$($$nemoclaw my-assistant dashboard-url --quiet) When onboarding records a non-loopback `CHAT_UI_URL`, the command returns that browser-facing origin with the OpenClaw authentication fragment. The host forward remains bound to loopback unless you explicitly configure remote binding. +If you change or clear `CHAT_UI_URL` when onboarding reuses an existing sandbox, onboarding records the new URL, but the running dashboard keeps accepting only the previous origins. +Run `$$nemoclaw rebuild` before you open the new URL. +If onboarding recreates the sandbox instead, the replacement starts with the new URL. Without a recorded external URL, the command uses the recorded local dashboard port. @@ -2087,7 +2214,7 @@ The sandbox must be running for `nemohermes my-assistant gateway-token --quiet` -`gateway-token` is not applicable to Deep Agents sandboxes because there is no OpenClaw gateway token. 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. +`gateway-token` is not applicable to Deep Agents sandboxes because there is no OpenClaw gateway token. NVIDIA Endpoints, supported fixed hosted providers, and new Ollama, standalone vLLM, llama.cpp, hosted compatible outside the Personal tier, and qualifying host-local compatible selections use native endpoints through sandbox-attached OpenShell providers. Owned Local NVIDIA NIM, retained legacy routes, and other custom routes without an attachment use `inference.local`. @@ -2135,6 +2262,11 @@ If you want to upgrade the sandbox while preserving state, use `$$nemoclaw channels remove ` -Clear the stored credentials for a messaging channel and rebuild the sandbox so the image drops the channel. Running `remove` for a channel that was never configured is a no-op against the credentials file and normally still triggers the rebuild prompt. OpenClaw WeChat also checks for orphaned physical session state when no channel or policy entry exists; if cleanup cannot be confirmed, removal stops before rebuilding. When the bridge provider is attached to a live sandbox, NemoClaw detaches it before deleting the provider from the OpenShell gateway. If deletion fails, NemoClaw attempts to restore the attachment before returning the failure. If restoration also fails, the diagnostic names the provider and sandbox and warns that channel delivery may remain interrupted. If the matching built-in policy preset is applied, NemoClaw also removes that preset from the current OpenShell policy so the upstream API is no longer allow-listed after the channel is gone. When removing Teams, NemoClaw removes Teams-owned Microsoft login credential bindings from matching Outlook policy endpoints. It refuses to remove a binding owned by another integration. No session preset list exists to synchronize. - -For QR-paired channels (today: WhatsApp), NemoClaw destructively clears the in-sandbox session directories before the rebuild so the complete native-home transfer does not restore the removed auth blob and let the channel reconnect: +Clear the stored credentials for a messaging channel and rebuild the sandbox so the image drops the channel. +For a registered sandbox, `channels remove whatsapp` checks the messaging plan and live OpenShell policy presets. +When policy inspection succeeds and neither contains WhatsApp, the command reports that WhatsApp is not configured and exits successfully. +It leaves the messaging plan unchanged and does not prompt for or queue a rebuild. +If WhatsApp has no plan entry and NemoClaw cannot inspect the live policy, the command exits nonzero without changes. +Restore OpenShell gateway access. +Then retry the removal command. +Disabled WhatsApp entries and applied WhatsApp policy presets still follow the removal process. +Entries awaiting removal continue teardown without repeating session cleanup when no configured entry or applied preset remains. + +OpenClaw WeChat also checks for orphaned physical session state when no channel or policy entry exists; if cleanup cannot be confirmed, removal stops before rebuilding. +When the bridge provider is attached to a live sandbox, NemoClaw detaches it before deleting the provider from the OpenShell gateway. +If deletion fails, NemoClaw attempts to restore the attachment before returning the failure. +If restoration also fails, the diagnostic names the provider and sandbox and warns that channel delivery may remain interrupted. +If the matching built-in policy preset is applied, NemoClaw also removes that preset from the current OpenShell policy so the upstream API is no longer allow-listed after the channel is gone. +When removing Teams, NemoClaw removes Teams-owned Microsoft login credential bindings from matching Outlook policy endpoints. +It refuses to remove a binding owned by another integration. +No session preset list exists to synchronize. + +For QR-paired channels (today: WhatsApp), session cleanup requires a configured messaging plan entry or an applied policy preset. +Without either, removal does not clear session files or confirm a fresh pairing state. +When that prerequisite holds, NemoClaw clears these in-sandbox session directories before rebuilding so the native-home transfer does not restore the removed credentials: - OpenClaw: `/sandbox/.openclaw//` (for example `/sandbox/.openclaw/whatsapp/`). - Hermes: `/sandbox/.hermes/platforms//` (for example `/sandbox/.hermes/platforms/whatsapp/`). For WhatsApp, NemoClaw also clears compatibility sessions left by older images at `/sandbox/.hermes/profiles/dashboard-home/platforms/whatsapp/session/` and `/sandbox/.hermes/dashboard-home/platforms/whatsapp/session/`. @@ -2528,7 +2679,9 @@ $$nemoclaw my-assistant channels remove telegram | ----------- | ----------------------------------------------------------------------------------- | | `--dry-run` | Report the channel that would be removed without clearing credentials or rebuilding | -As with `channels add`, `NEMOCLAW_NON_INTERACTIVE=1` or a run without a terminal on stdin skips the rebuild prompt and queues the change for a manual `$$nemoclaw rebuild`. `channels start` and `channels stop` follow the same rule. If you omit the required `` argument, the CLI prints the `channels remove ` usage with the supported channel list. +When removal requires a rebuild, `NEMOCLAW_NON_INTERACTIVE=1` or a run without a terminal on stdin skips the prompt and queues a manual `$$nemoclaw rebuild`. +`channels start` and `channels stop` follow the same rule. +If you omit the required `` argument, the CLI prints the `channels remove ` usage with the supported channel list. Host-side removal is the supported path because managed startup (or an explicit custom image build) materializes agent channel config as image-owned state (`/sandbox/.openclaw/openclaw.json` for OpenClaw and `/sandbox/.hermes/.env` for Hermes); agent-specific channel removals inside the sandbox would modify the running config but not persist changes across rebuilds. @@ -2581,7 +2734,11 @@ For an OpenClaw WhatsApp sandbox, `--channel whatsapp` probes the sandbox to sep | Support period | Keep the probe only while a supported Hermes image can place dashboard-paired credentials outside the durable path. | | Retirement | [Issue #8947](https://github.com/NVIDIA/NemoClaw/issues/8947) tracks removal after every supported Hermes image uses the durable path for dashboard pairing and gateway startup. | -After validation, the command checks the configured path and reports a `Session path override` signal. An unsupported path produces a warning, and the report uses the default gateway path. If the dashboard path has credentials and the gateway path is empty, the report tells you to run `$$nemoclaw channels remove whatsapp` and then `$$nemoclaw channels add whatsapp`, because a rebuild restores the legacy session instead of dropping it. Pair again from the dashboard so credentials use `/sandbox/.hermes/platforms/whatsapp/session`. Rerun `$$nemoclaw channels status --channel whatsapp`. NemoClaw does not treat a Hermes session file as live inbound-health evidence. +After validation, the command checks the configured path and reports a `Session path override` signal. +An unsupported path produces a warning, and the report uses the default gateway path. +If only the dashboard path has credentials, follow the Hermes recovery procedure in [Set Up WhatsApp](/user-guide/hermes/manage-sandboxes/messaging-channels/set-up-whatsapp#pair-the-sandbox). +That procedure states the cleanup prerequisite and when to stop before adding the channel again. +NemoClaw does not treat a Hermes session file as live inbound-health evidence. For Telegram, `--channel telegram` probes the sandbox to report the gateway process, Bot API reachability, and inbound delivery alongside the config comparison. Detailed non-wait JSON keeps the schema-version-1 `{schemaVersion,sandbox,channel,report}` envelope. When a probe-capable channel is paused, the command skips the live probe, returns `report.verdict` as `info` with paused registration and runtime-health signals, and exits 0. It classifies the state as `healthy`, `idle`, `token_rejected`, `unreachable`, `not_started`, `policy_gap`, `config_gap`, `unknown`, or `probe_failed`. A network or egress failure, or a non-authentication Bot API startup HTTP error, produces `unreachable`; a 401 or 404 response produces `token_rejected`. A missing, malformed, mismatched, identityless, or non-OpenShell runtime credential also produces `token_rejected`. It reads the gateway's own startup and poll log breadcrumbs rather than issuing its own Bot API request, so the resolved bot token never leaves the gateway. The verdict reflects the most recent evidence in the log window, so a bridge that recovered after a blocked start reports `healthy` while one blocked again reports `unreachable`. Telegram health is probed only for OpenClaw sandboxes; a Hermes Telegram sandbox uses the basic config report. @@ -2785,7 +2942,7 @@ Add a local skill directory to a running sandbox. NemoClaw validates and private $$nemoclaw my-assistant skill install ./my-skill/ ``` -The skill directory must contain a `SKILL.md` file with YAML frontmatter that includes a `name` field. Skill names must contain only alphanumeric characters, dots, hyphens, and underscores. For a registered sandbox, skill commands select the agent from its registry record. They ignore another sandbox's latest onboarding selection. +The skill directory must contain a `SKILL.md` file with YAML frontmatter that includes a `name` field. Skill names must be non-empty, contain only alphanumeric characters, dots, hyphens, and underscores, cannot be `.` or `..`, and cannot exceed 64 characters. For a registered sandbox, skill commands select the agent from its registry record. They ignore another sandbox's latest onboarding selection. @@ -2848,7 +3005,9 @@ Removal delegates to `dcode skills delete --agent agent --force --json`. $$nemoclaw my-assistant skill remove my-skill ``` -Use the skill name from the `SKILL.md` frontmatter, not the local directory name. Skill names must contain only alphanumeric characters, dots, hyphens, and underscores, and cannot be `.` or `..`. +Use the skill name from the `SKILL.md` frontmatter, not the local directory name. +Skill names must be non-empty, contain only alphanumeric characters, dots, hyphens, and underscores, and cannot be `.` or `..`. +Removal accepts previously installed names longer than 64 characters; new installations enforce the 64-character limit. @@ -2896,6 +3055,15 @@ Pass `-f` / `--file ` to point at the manifest; `--yes` confirms th + + +### `$$nemoclaw sessions` + +Session listing is not supported for LangChain Deep Agents Code sandboxes. +The command reports an unsupported-capability error and exits with status `1` before running an in-sandbox command. + + + ### `$$nemoclaw sessions` @@ -2921,6 +3089,15 @@ $$nemoclaw my-assistant sessions --source cli --limit 20 + + +### `$$nemoclaw sessions list` + +Session listing is not supported for LangChain Deep Agents Code sandboxes. +The command reports an unsupported-capability error and exits with status `1` before running an in-sandbox command. + + + ### `$$nemoclaw sessions list` @@ -3074,6 +3251,8 @@ Other failures use a different nonzero status. The command downloads to a fresh private temporary directory on the host, verifies that OpenShell wrote an artifact, publishes the artifact to your destination, and removes the temporary directory. An existing destination directory is resolved to its canonical path before publication. The command refuses an existing file destination that is a symbolic link and a new destination below a symbolic-link parent. +It checks every component of the destination parent, so it refuses the destination whether or not the directories below the symbolic link already exist. +Pass the canonical path, or an existing destination directory, to publish below a symbolic link on purpose. Regular files are published through a private temporary entry and atomically replace an existing regular file. Relative host destinations resolve against the caller's working directory. Absolute host destinations do not use caller-working-directory resolution. @@ -3149,6 +3328,13 @@ $$nemoclaw my-assistant upload ./agent-skills/ /sandbox/.deepagents/agent/skills Upgrade a sandbox to the current agent version while preserving its complete native home/workspace. The command captures that complete tree and the current OpenShell policy in private temporary handoffs, destroys the old sandbox, recreates it with the current image, and restores the complete tree. + + +Portable Hermes does not support `rebuild`. +To replace a Portable Hermes sandbox, run `nemohermes onboard --experimental-profile portable --fresh --name --recreate-sandbox`. + + + If the sandbox or its retained recovery record belongs to another local OpenShell gateway registry, NemoClaw runs the rebuild or recovery retirement from that registry. It asks for confirmation before it starts the delegated rebuild worker unless you pass `--yes` or `--force`. The worker uses the sandbox's recorded gateway state and credentials; you do not need to select the gateway first. @@ -3253,13 +3439,25 @@ After restore, the command runs `openclaw doctor --fix` for cross-version struct After restore, the command starts the rebuilt Hermes gateway with the complete source native home, including its `/sandbox/.hermes` config and unknown agent-written paths. +For a native local or native NVIDIA selection, NemoClaw refreshes only the managed credential references before restart, preserving restored model and provider settings. +The refresh must match the replacement sandbox identity and recorded route; an unsafe or changed source stops activation and retains the recovery backup. A rebuild creates a new sandbox home and a new Hermes API bearer token. After the rebuild succeeds, retrieve the replacement token with `nemohermes my-assistant gateway-token --quiet` before reconnecting API clients. -After restore, the command starts Deep Agents with the complete source native home, including `config.toml`, hooks, skills, memories, histories, packages, and unrelated native entries. Before changing the sandbox, rebuild verifies that the recorded provider path is still reachable and that the target provider, model, reasoning settings, web search selection, base image, current agent MCP source, and current live OpenShell policy can be captured. 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. If those checks fail after backup, NemoClaw keeps the existing sandbox intact. Use rebuild after a failed Deep Agents version check, after enabling Tavily Search, or as the apply step for legacy MCP migration. +After restore, the command starts Deep Agents with the complete source native home, including `config.toml`, hooks, skills, memories, histories, packages, and unrelated native entries. Before changing the sandbox, rebuild verifies that the recorded provider path is still reachable and that the target provider, model, reasoning settings, web search selection, base image, current agent MCP source, and current live OpenShell policy can be captured. NVIDIA Endpoints and supported fixed hosted providers use native endpoints through sandbox-attached OpenShell providers. +Deep Agents also uses attached providers for hosted compatible endpoints outside the Personal tier and qualified local endpoints; a fresh Personal-tier hosted selection stays on the shared route. +Local NVIDIA NIM, other agents' shared local selections, and custom endpoints without an attachment retain the shared `inference.local` route. If those checks fail after backup, NemoClaw keeps the existing sandbox intact. Use rebuild after a failed Deep Agents version check, after enabling Tavily Search, or as the apply step for legacy MCP migration. +Legacy Deep Agents Code local sandboxes without an attachment stop before rebuild. Local NVIDIA NIM retains its shared rebuild path. +Back up the sandbox data before running `nemo-deepagents onboard --fresh --name --recreate-sandbox`. + + + + + +Legacy OpenClaw local sandboxes without a native attachment stop before rebuild. Back up the sandbox data before running `$$nemoclaw onboard --fresh --name --recreate-sandbox`. @@ -3525,7 +3723,7 @@ When at least one sandbox is registered and the named NemoClaw gateway is unreac ### `$$nemoclaw inference get` Show the provider and model for the selected inference path. -When the selected sandbox has a valid native NVIDIA or hosted provider attachment, the command reports its recorded provider, model, and native endpoint without reading the shared gateway route. +When the selected sandbox has a valid native NVIDIA, hosted, or Deep Agents Code, Hermes, or OpenClaw native local provider attachment, the command reports its recorded provider, model, and native endpoint without reading the shared gateway route. For providers that still use the shared route, the command reports the active live route from the NemoClaw-managed OpenShell gateway that `NEMOCLAW_GATEWAY_PORT` selects. For a compatible custom provider, also show the persisted endpoint URL when the selected gateway's matching registry metadata is safe, unambiguous, and reusable. Use this command when you want the selected inference path without the rest of the sandbox status output. @@ -3536,13 +3734,13 @@ $$nemoclaw inference get $$nemoclaw inference get --json ``` -A valid native NVIDIA or hosted attachment adds its native endpoint to the recorded provider-and-model output. +A valid native NVIDIA, hosted, or Deep Agents Code, Hermes, or OpenClaw native local attachment adds its native endpoint to the recorded provider-and-model output. Other managed providers keep the provider-and-model output. -Compatible providers add the endpoint only when published same-gateway metadata matches the live route and is safe to display; otherwise the command keeps the live provider and model and returns credential-free recovery information. +Compatible providers on the shared route add the endpoint only when published same-gateway metadata matches the live route and is safe to display; otherwise the command keeps the live provider and model and returns credential-free recovery information. Refer to [View the Selected Inference Path](../inference/manage-inference/view-active-inference-route) for the exact text and JSON fields, omission states, safety rules, and recovery procedures. For the sandbox-first grammar, `NEMOCLAW_GATEWAY_PORT` first selects the sandbox registry and fallback gateway. -When `` has a valid native NVIDIA or hosted provider attachment, the command reports its recorded provider, model, and native endpoint without reading the shared gateway route. +When `` has a valid native NVIDIA, hosted, or Deep Agents Code, Hermes, or OpenClaw native local provider attachment, the command reports its recorded provider, model, and native endpoint without reading the shared gateway route. Otherwise, when that registry contains ``, the command resolves the sandbox's recorded gateway and reads that gateway's live route. It does not search registries for other gateway ports. When the live provider and model match the sandbox's recorded route, text and JSON output identify a `llama-cpp-local` route as `managed` or `attached`. @@ -3563,12 +3761,27 @@ $$nemoclaw my-assistant inference get -Switch the active inference provider or model for a NemoClaw-managed OpenClaw sandbox. For NVIDIA Endpoints, OpenAI, Anthropic, Gemini, OpenRouter, and Hermes Provider, the command attaches or updates the selected sandbox's native provider. Custom endpoints and local providers retain their existing shared OpenShell route. It then patches the selected running agent config to match the selected inference path, recomputes the config hash, and updates the NemoClaw registry. It is also available in sandbox-first form as `$$nemoclaw inference set --provider --model `. For OpenClaw, the patch updates the OpenClaw config provider namespace and selected model. After any changed config sync, NemoClaw uses the managed supervisor to restart only the OpenClaw gateway and verify its health and forwards. The sandbox remains running, but agent requests are briefly interrupted. If the restart fails, the selected inference path and config remain committed; run `$$nemoclaw gateway restart` to finish applying the switch. After every changed synchronized inference selection, NemoClaw also verifies that the local CLI device has the managed gateway's required pairing scopes before it reports success. If pairing does not converge, the selected inference path and config remain committed. Run `$$nemoclaw doctor --fix`, then retry the agent turn. +Switch the active inference provider or model for a NemoClaw-managed OpenClaw sandbox. For NVIDIA Endpoints, OpenAI, Anthropic, Gemini, OpenRouter, and Hermes Provider, the command attaches or updates the selected sandbox's native provider. A hosted compatible endpoint outside the Personal tier uses a native provider during `inference set` only when this sandbox already records a valid native attachment. The command can then attach or update the selected custom provider. A sandbox created with a Personal-tier hosted selection, Local NVIDIA NIM, custom endpoints without an attachment, and retained shared selections use the shared OpenShell route. It then patches the selected running agent config to match the selected inference path, recomputes the config hash, and updates the NemoClaw registry. It is also available in sandbox-first form as `$$nemoclaw inference set --provider --model `. For OpenClaw, the patch updates the OpenClaw config provider namespace and selected model. After any changed config sync, NemoClaw uses the managed supervisor to restart only the OpenClaw gateway and verify its health and forwards. The sandbox remains running, but agent requests are briefly interrupted. If the restart fails, the selected inference path and config remain committed; run `$$nemoclaw gateway restart` to finish applying the switch. After every changed synchronized inference selection, NemoClaw also verifies that the local CLI device has the managed gateway's required pairing scopes before it reports success. If pairing does not converge, the selected inference path and config remain committed. Run `$$nemoclaw doctor --fix`, then retry the agent turn. -Switch the active inference provider or model for a NemoClaw-managed Hermes sandbox. For NVIDIA Endpoints, OpenAI, Anthropic, Gemini, OpenRouter, and Hermes Provider, the command attaches or updates the selected sandbox's native provider. Custom endpoints and local providers retain their existing shared OpenShell route. It then patches the selected running agent config to match the selected inference path, recomputes the config hash, and updates the NemoClaw registry. It is also available in sandbox-first form as `$$nemoclaw inference set --provider --model `. For Hermes, the patch updates the shared native `/sandbox/.hermes/config.yaml` (`model.default`, `model.base_url`, `model.provider: custom`, API-family mode when needed, and the OpenShell proxy API-key placeholder) and does not rebuild or restart the gateway. The gateway, CLI, TUI, and Web Dashboard read that same configuration. Keeping the placeholder preserves dashboard and API authentication after provider switches. Under the `nemohermes` alias, the command uses the registered Hermes sandbox when exactly one exists; otherwise pass `--sandbox ` to target one explicitly. +Switch the active inference provider or model for a NemoClaw-managed Hermes sandbox. +For NVIDIA Endpoints, OpenAI, Anthropic, Gemini, OpenRouter, and Hermes Provider, the command attaches or updates the selected sandbox's native provider. A hosted compatible endpoint outside the Personal tier uses a native provider during `inference set` only when this sandbox already records a valid native attachment. The command can then attach or update the selected custom provider. +New Ollama, standalone vLLM, llama.cpp, and qualifying host-local compatible selections also use sandbox-attached providers. +Owned Local NVIDIA NIM, nonqualifying custom endpoints, and retained legacy shared routes keep their shared OpenShell route. +It then patches the shared native `/sandbox/.hermes/config.yaml`, recomputes the config hash, and updates the NemoClaw registry. +Changes between shared routes do not rebuild or restart Hermes. +If the current or selected route uses a native hosted or local provider, NemoClaw restarts the Hermes gateway after configuration sync. +Active agent requests can be interrupted during the restart. +If the restart fails, the route and configuration remain committed. +Run `$$nemoclaw gateway restart` to apply the switch. + +Shared routes use the OpenShell proxy API-key placeholder. On a live NVIDIA Endpoints or native local switch, NemoClaw writes the newly attached provider's scoped OpenShell credential reference into the Hermes config. Other native hosted providers use their managed credential placeholders. None of these values is a raw provider credential. The gateway, CLI, TUI, and Web Dashboard read the same configuration. + +A legacy local sandbox without a valid Hermes attachment must be recreated before a native local switch. Back up required state, then rerun `nemohermes onboard --fresh --name --recreate-sandbox`. Live qualification of the Hermes native local lifecycle is pending. + +The command is also available in sandbox-first form as `$$nemoclaw inference set --provider --model `. Under the `nemohermes` alias, it uses the registered Hermes sandbox when exactly one exists; otherwise pass `--sandbox ` to target one explicitly. @@ -3576,7 +3789,7 @@ Switch the active inference provider or model for a NemoClaw-managed Hermes sand By default, the command syncs the default registered sandbox. -NVIDIA Endpoints and the five fixed hosted providers use sandbox-attached providers without changing the shared route. The following route-conflict rules apply to providers that still use the shared gateway route, including custom endpoints and local providers. +During onboarding, NVIDIA Endpoints, the five fixed hosted providers, and new hosted compatible selections outside the Personal tier use sandbox-attached providers without changing the shared route. Qualified new local selections also receive native attachments during onboarding. At runtime, `inference set` can attach a custom native provider when the sandbox already records a valid native attachment; a retained shared-route sandbox stays on the shared route. Hermes also supports native local switches through `inference set`. Deep Agents Code requires the onboarding recreation workflow to change its provider or model. The following route-conflict rules apply whenever the command changes the shared gateway route, including owned Local NVIDIA NIM, retained legacy and other custom shared routes, and Pi local routes. Before changing the route, NemoClaw compares it with every same-gateway registry entry, including stopped sandboxes. When only the provider or model differs, the command names the affected sandboxes and warns immediately before it re-points the shared route. Those sandboxes use the new live route until `connect`, onboarding, or another `inference set` command re-points it. @@ -3599,7 +3812,7 @@ You can also name the sandbox in sandbox-first position instead of passing `--sa $$nemoclaw my-assistant inference set --provider nvidia-prod --model nvidia/nemotron-3-super-120b-a12b ``` -Pass both `--provider` and `--model` to select the provider and model for the target sandbox. For NVIDIA Endpoints and the five fixed hosted providers, NemoClaw attaches or updates the selected sandbox's native provider and syncs its agent config without changing the shared route. Custom endpoints and local providers retain their existing shared-route workflow. NemoClaw resolves the OpenShell gateway from the target sandbox's recorded gateway binding, including non-default `NEMOCLAW_GATEWAY_PORT` deployments. Do not run `openshell inference set` directly on a shared NemoClaw gateway because that bypasses registry compatibility checks and can break other sandboxes. When either flag is missing, `$$nemoclaw inference set` reports both required flags without suggesting a raw OpenShell command. The command updates the host registry after the selected inference path changes. +Pass both `--provider` and `--model` to select the provider and model for the target sandbox. For NVIDIA Endpoints and the five fixed hosted providers, NemoClaw attaches or updates the selected sandbox's native provider and syncs its agent config without changing the shared route. Hermes qualified local switches use native attachments. OpenClaw model switches on recorded native Ollama, standalone vLLM, and llama.cpp attachments also leave the shared route unchanged; selecting a different local provider without an attachment requires a backup and fresh sandbox. Nonqualifying custom endpoints, Local NVIDIA NIM, and retained shared local selections retain their existing shared-route workflow. Use onboarding to create a new Deep Agents Code native local selection. NemoClaw resolves the OpenShell gateway from the target sandbox's recorded gateway binding, including non-default `NEMOCLAW_GATEWAY_PORT` deployments. Do not run `openshell inference set` directly on a shared NemoClaw gateway because that bypasses registry compatibility checks and can break other sandboxes. When either flag is missing, `$$nemoclaw inference set` reports both required flags without suggesting a raw OpenShell command. The command updates the host registry after the selected inference path changes. @@ -3682,7 +3895,7 @@ For Deep Agents sandboxes, run `$$nemoclaw onboard --fresh --name The `$$nemoclaw setup` command is deprecated. Use `$$nemoclaw onboard` instead. -This command remains as a compatibility alias to `$$nemoclaw onboard` and accepts the same flags: `--profile `, `--non-interactive`, `--resume`, `--fresh`, `--recreate-sandbox`, `--apf-interceptor`, `--gpu` / `--no-gpu`, `--from`, `--from-image`, `--name`, `--host-mount`, `--sandbox-gpu` / `--no-sandbox-gpu`, `--sandbox-gpu-device`, `--vllm-gpu-device`, `--agent`, `--agents `, `--tool-disclosure `, `--observability` / `--no-observability`, `--control-ui-port`, `--yes` / `-y`, `--no-ollama-autostart`, `--yes-i-accept-third-party-software`. +This command remains as a compatibility alias to `$$nemoclaw onboard` and accepts the same flags: `--profile `, `--non-interactive`, `--resume`, `--fresh`, `--recreate-sandbox`, `--apf-interceptor`, `--gpu` / `--no-gpu`, `--from`, `--from-image`, `--name`, `--host-mount`, `--sandbox-gpu` / `--no-sandbox-gpu`, `--sandbox-gpu-device`, `--vllm-gpu-device`, `--agent`, `--agents `, `--tool-disclosure `, `--dcode-auto-approval `, `--observability` / `--no-observability`, `--control-ui-port`, `--yes` / `-y`, `--no-ollama-autostart`, `--yes-i-accept-third-party-software`. ```bash $$nemoclaw setup @@ -3695,7 +3908,7 @@ $$nemoclaw setup onboard` instead, because current OpenShell releases handle the older DGX Spark cgroup behavior. -This command remains as a compatibility alias to `$$nemoclaw onboard` and accepts the same flags: `--profile `, `--non-interactive`, `--resume`, `--fresh`, `--recreate-sandbox`, `--apf-interceptor`, `--gpu` / `--no-gpu`, `--from`, `--from-image`, `--name`, `--host-mount`, `--sandbox-gpu` / `--no-sandbox-gpu`, `--sandbox-gpu-device`, `--vllm-gpu-device`, `--agent`, `--agents `, `--tool-disclosure `, `--observability` / `--no-observability`, `--control-ui-port`, `--yes` / `-y`, `--no-ollama-autostart`, `--yes-i-accept-third-party-software`. +This command remains as a compatibility alias to `$$nemoclaw onboard` and accepts the same flags: `--profile `, `--non-interactive`, `--resume`, `--fresh`, `--recreate-sandbox`, `--apf-interceptor`, `--gpu` / `--no-gpu`, `--from`, `--from-image`, `--name`, `--host-mount`, `--sandbox-gpu` / `--no-sandbox-gpu`, `--sandbox-gpu-device`, `--vllm-gpu-device`, `--agent`, `--agents `, `--tool-disclosure `, `--dcode-auto-approval `, `--observability` / `--no-observability`, `--control-ui-port`, `--yes` / `-y`, `--no-ollama-autostart`, `--yes-i-accept-third-party-software`. ```bash $$nemoclaw setup-spark @@ -3763,6 +3976,8 @@ $$nemoclaw credentials list Register a provider credential with the OpenShell gateway by name and type. Each `--credential` takes the env variable name whose value the gateway should read; export the value first so it is not placed in argv. Pass either repeatable `--credential ` or `--from-existing`, but do not combine them. With `--from-existing`, NemoClaw inspects the provider profile and rejects registration when one of its credential keys is reserved by a managed MCP server. After the gateway accepts the provider, rebuild each sandbox that should use it. +After a successful provider creation or attachment, NemoClaw compares a previously verified profile with its current gateway definition. If it warns that verification did not complete or the profile changed, the successful operation remains successful. Ask the gateway operator to inspect the profile before relying on its credential boundary. + Registered providers are gateway-wide and attach to every sandbox you build or rebuild after the call. `nemoclaw credentials reset ` removes the provider from the gateway and detaches it from every sandbox currently using it; it cannot limit the provider to selected sandboxes. To replace a credential, reset the provider, register the replacement, and rebuild each detached sandbox. Tavily requires a provider profile that permits the intended agent runtime. @@ -3880,6 +4095,17 @@ This differs from a managed `NEMOCLAW_OPENSHELL_GATEWAY_STATE_DIR` override, whi + + + For a Docker OpenClaw sandbox that uses the NemoClaw-managed image, uninstall removes its managed + `/sandbox/.openclaw` state volume even without `--destroy-user-data`, as `$$nemoclaw destroy` + does. Back up required OpenClaw state first. When the gateway is externally supervised, uninstall + does not delete the sandbox and keeps its state volume. NemoClaw removes only a volume with exact + ownership labels; inspection or removal failure exits nonzero and preserves registry state for + retry. + + + ```bash $$nemoclaw uninstall [--yes] [--keep-openshell] [--delete-models] [--destroy-user-data] [--all-gateway-ports] [--gateway ] ``` @@ -4141,6 +4367,8 @@ The environment precedence is `NEMOCLAW_LOG_LEVEL`, then `NEMOCLAW_DEBUG`, follo Commands whose parser owns the base logging options also accept the hidden long-form `--debug` and `--quiet` flags, even though these options do not appear in command help. The flags are mutually exclusive. `--debug` overrides the environment-derived threshold and selects `debug`, while `--quiet` caps verbosity at `warn` without increasing an environment-derived `error` threshold. There is no global `-q` logging shorthand. Passthrough commands do not consume flags intended for the downstream command as host logging options, so use the environment variables when you need unambiguous host logging around a passthrough invocation. +Set `NEMOCLAW_NO_AUTO_AUDIT_LOGS=1` to prevent `$$nemoclaw logs` and failed `$$nemoclaw exec` policy checks from enabling OpenShell OCSF JSON audit logging. Setting `NEMOCLAW_NO_POLICY_HINT=1` skips the failed-`exec` policy-denial probe and its audit-setting attempt entirely. NemoClaw prints a notice before attempting to enable the setting when automatic audit logging remains active. Policy denial hints may be unavailable if audit logging remains disabled. + | Variable | Default | Service | | ------------------------------- | --------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `NEMOCLAW_GATEWAY_PORT` | A recorded automatic alternate port, otherwise 8080 | OpenShell gateway port. An explicit supported value remains authoritative. See [Installer Reports That the Systemd User Manager Is Unavailable](./troubleshooting#installer-reports-that-the-systemd-user-manager-is-unavailable). | @@ -4237,7 +4465,7 @@ The following variables let you tune onboarding without editing the Dockerfile o | `NEMOCLAW_PROVIDER` | provider key (e.g. `build`, `openrouter`, `openai`, `anthropic`, `anthropicCompatible`, `gemini`, `ollama`, `custom`, `vllm`, `nim-local`, `routed`, `hermes-provider`, `llama-cpp`, `install-llama-cpp`, `install-vllm`, `install-ollama`, `install-windows-ollama`, `start-windows-ollama`) | Selects the inference provider during onboarding. The wizard skips the provider menu in both interactive and non-interactive runs when this is set. On a qualified N1x host, `install-vllm` supplies Deferred preview intent, while another provider supplies standard-onboarding intent and retains its existing requirements. Local NVIDIA NIM remains unavailable on N1x. `llama-cpp` selects attachment of an authenticated, operator-managed llama.cpp server on loopback port `8081`. Set `NEMOCLAW_LLAMACPP_LOCAL_TOKEN`; set `NEMOCLAW_MODEL` to the served alias when the server exposes multiple models. `install-llama-cpp` selects the compatible experimental managed path on DGX Spark, generic NVIDIA GPU, or Windows WSL N1x or Station GB300 hosts and rejects `NEMOCLAW_MODEL`; use `NEMOCLAW_LLAMACPP_RECIPE` for an explicit declarative selection. A qualifying Windows WSL N1x or Station GB300 host automatically selects this provider and its Qwen 3.6 recipe when no provider is requested or recorded. If an operator-managed server does not provide consistent native llama.cpp evidence, select `custom`. Aliases: `cloud` → `build`, `open-router` / `openrouterai` → `openrouter`, `nim` → `nim-local`, `hermes` / `nous` / `nous-portal` → `hermes-provider`, `anthropiccompatible` → `anthropicCompatible`. Invalid values fail fast with the list of accepted keys. | | `NEMOCLAW_LLAMACPP_RECIPE` | repository-owned managed-inference recipe ID | Selects the managed llama.cpp recipe when `NEMOCLAW_PROVIDER=install-llama-cpp`, including a compatible lower-priority profile. When unset, NemoClaw selects the unique highest-priority compatible automatic profile. An unknown recipe, an ambiguous selection, or a stale or incompatible readiness report fails before image, model, or runtime effects. | | `NEMOCLAW_MODEL` | model ID | Selects an explicit model for a non-interactive onboarding run. For NVIDIA Endpoints, NemoClaw ignores a retired configured model and uses the agent default. Otherwise, NemoClaw preserves the explicit model across a detected provider switch, even when it matches the recorded provider's default. When this variable is unset during such a switch, NemoClaw ignores the `NEMOCLAW_PROVIDER_MODEL` compatibility fallback and uses normal provider model selection. | -| `NEMOCLAW_TOOL_DISCLOSURE` | `progressive` or `direct` | Selects progressive tool discovery or direct exposure. Defaults to `progressive`; `--tool-disclosure` takes precedence when both are set. | +| `NEMOCLAW_TOOL_DISCLOSURE` | `progressive` or `direct` | Selects progressive tool discovery or direct exposure. A new sandbox with no recorded mode defaults to `progressive`. A fresh managed OpenClaw sandbox using local Ollama or vLLM defaults to `direct`, except the accepted Deferred N1x managed-vLLM preview for `nvidia/Qwen3.6-35B-A3B-NVFP4`, which defaults to `progressive`. Existing recorded state takes precedence. `--tool-disclosure` takes precedence over this variable. | | `NEMOCLAW_ENDPOINT_URL` | URL | Custom endpoint URL. Used together with `NEMOCLAW_PROVIDER=custom` for OpenAI-compatible endpoints or `NEMOCLAW_PROVIDER=anthropicCompatible` for Anthropic-compatible endpoints. Onboarding rejects a URL that contains userinfo, query, or fragment components. It also rejects a URL that contains control characters, percent-encoded control characters, spaces within the URL, shell metacharacters, or other characters outside the URL-safe ASCII set, and a value that is not an absolute HTTP or HTTPS URL. NemoClaw trims ASCII spaces at the start and end of the URL before validation. | | `NEMOCLAW_COMPATIBLE_AUTH_MODE` | `none` or unset | Explicitly selects no authentication during non-interactive onboarding for an OpenAI-compatible HTTP endpoint on `localhost`, `127.0.0.1`, or `[::1]` and the port selected by `NEMOCLAW_VLLM_PORT` (`8000` by default) or port `11434`. Protected service ports remain unavailable. New endpoints cannot use port `11435`; recovery can retain a recorded legacy route on that port only after the auth proxy moves to a different free port and no other protected service owns `11435`. | | `NEMOCLAW_TRUSTED_PRIVATE_HOSTS` | comma-separated exact hostnames or IP literals | Allows operator-owned RFC1918, CGNAT, or IPv6 unique local destinations through supported inference, managed MCP, and custom-policy registration paths. Link-local metadata and other reserved ranges remain blocked; DNS resolution and address pinning remain active; wildcards are not supported. | @@ -4251,7 +4479,7 @@ The following variables let you tune onboarding without editing the Dockerfile o | `NEMOCLAW_INFERENCE_INPUTS` | comma-separated list of `text` and/or `image` | OpenClaw only. - Declares model input modalities. Unsupported or duplicate values are rejected. | | + Declares model input modalities. Unsupported or duplicate values are rejected. An explicit valid value takes precedence. Hosted `nvidia/nemotron-3.5-super-vl-120b-a12b` defaults to `text,image` in both interactive and unattended onboarding. Unattended onboarding also selects `text,image` for registered multimodal managed-vLLM models such as Super VL. | | `NEMOCLAW_OPENCLAW_OTEL` | `1` to enable | Enables OpenClaw conversation diagnostics export through the `diagnostics-otel` plugin. Disabled by default. | | `NEMOCLAW_OPENCLAW_OTEL_ENDPOINT` | OTLP/HTTP URL | Sets the OpenTelemetry collector endpoint for OpenClaw diagnostics. Defaults to @@ -4283,13 +4511,17 @@ registered served model name | Selects the model the managed-vLLM install path s authoritative during DGX Station installer setup. Slugs, full model IDs, and registered served model names are case-insensitive. Recognized slugs: `qwen3.6-27b`, `qwen3.6-35b-a3b-nvfp4`, `muse-glimmer-30b`, `nemotron-3.5-lightning-30b`, `nemotron-3-nano-4b`, `deepseek-v4-flash`, -`nemotron-3-ultra-550b-a55b`, `deepseek-r1-distill-70b`. The `muse-glimmer-30b` and +`nemotron-3.5-super-vl-120b`, `nemotron-3-ultra-550b-a55b`, +`deepseek-r1-distill-70b`. The `muse-glimmer-30b` and `nemotron-3.5-lightning-30b` profiles are Experimental on DGX Spark and Linux x86_64 with a qualifying NVIDIA GPU. NemoClaw does not enable vision or DFlash speculative decoding for Muse -Glimmer. Station Express selects `nemotron-3-ultra-550b-a55b`; a qualified reciprocal pair uses the -distributed topology, while no qualifying pair retains the single-Station Ultra topology. Outside -Station Express, unset uses the per-platform profile default. Gated models (for example, -`deepseek-r1-distill-70b`) require `HF_TOKEN` or `HUGGING_FACE_HUB_TOKEN`. | | +Glimmer. When unset, managed vLLM uses the serving catalog's per-platform default. For a new single +DGX Station, that default is the Experimental `nemotron-3.5-super-vl-120b` NVFP4 profile. +Station Express first checks for a qualified reciprocal pair and selects distributed Ultra when +one qualifies. Without a qualifying pair, a new installation uses the single-Station catalog +default; an existing Ultra workload retains Ultra. Explicit model choices remain authoritative. +Gated models (for example, `deepseek-r1-distill-70b`) require `HF_TOKEN` or +`HUGGING_FACE_HUB_TOKEN`. | | `NEMOCLAW_DGX_STATION_PEER` | SSH host or `user@host` | Selects one exact, already-trusted DGX Station peer for Nemotron 3 Ultra pair qualification. The peer must match the reciprocal private `/30` rail and hardware checks; an explicit peer failure stops setup instead of falling back. @@ -4441,7 +4673,17 @@ Array-shape example (paths defaulted): #### Linux Ollama install mode details -Set `NEMOCLAW_OLLAMA_INSTALL_MODE=system` to run the official `https://ollama.com/install.sh` installer, which uses sudo, writes to `/usr/local`, and configures systemd. Set `NEMOCLAW_OLLAMA_INSTALL_MODE=user` to extract the release tarball to `${HOME}/.local` without sudo and launch the daemon manually without systemd persistence. Leave `NEMOCLAW_OLLAMA_INSTALL_MODE` empty or unset to let NemoClaw auto-detect the mode. Auto-detection selects `system` when the current user is root or passwordless `sudo` works. Auto-detection selects `user` in non-interactive runs without passwordless `sudo`. An interactive shell falls back to `system` so the official installer can prompt for the password. NemoClaw rejects any other value. On upgrades, NemoClaw rejects `user` because a user-local install cannot replace the system daemon on `:11434`. On upgrades, NemoClaw also rejects `system` under `NEMOCLAW_NON_INTERACTIVE=1` when passwordless `sudo` is unavailable because the installer would hang on a hidden sudo prompt. The run exits with an actionable diagnostic instead. +Set `NEMOCLAW_OLLAMA_INSTALL_MODE=system` to run a pinned snapshot of the official Ollama installer after NemoClaw verifies its SHA-256 digest. +The system installer uses sudo, writes to `/usr/local`, and configures systemd. +Set `NEMOCLAW_OLLAMA_INSTALL_MODE=user` to extract the release tarball to `${HOME}/.local` without sudo and launch the daemon manually without systemd persistence. +Leave `NEMOCLAW_OLLAMA_INSTALL_MODE` empty or unset to let NemoClaw auto-detect the mode. +Auto-detection selects `system` when the current user is root or passwordless `sudo` works. +Auto-detection selects `user` in non-interactive runs without passwordless `sudo`. +An interactive shell falls back to `system` so the official installer can prompt for the password. +NemoClaw rejects any other value. +On upgrades, NemoClaw rejects `user` because a user-local install cannot replace the system daemon on `:11434`. +On upgrades, NemoClaw also rejects `system` under `NEMOCLAW_NON_INTERACTIVE=1` when passwordless `sudo` is unavailable because the installer would hang on a hidden sudo prompt. +The run exits with an actionable diagnostic instead. ### Experimental NemoCUA @@ -4583,8 +4825,8 @@ The following variables tune how long internal probes wait before giving up. Def | Variable | Default | Effect | | -------------------------------------------- | --------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `NEMOCLAW_MCP_PROVIDER_SYNC_TIMEOUT_SECONDS` | `30` | Maximum time to wait for an OpenShell MCP provider credential handle to become active or fully revoked inside the sandbox. Integer seconds; raise only when provider synchronization is unusually slow. | -| `NEMOCLAW_SANDBOX_EXEC_TIMEOUT_MS` | per call site (typically `15000`) | Overrides the default timeout for `openshell sandbox exec` calls issued by recovery and lifecycle helpers. Integer milliseconds; non-positive or non-numeric values fall back to the per-call-site default. | -| `NEMOCLAW_STATUS_PROBE_TIMEOUT_MS` | built-in default | Overrides the timeout for the OpenShell status probe used by `$$nemoclaw status`. Integer milliseconds; non-positive or non-numeric values fall back to the default. | +| `NEMOCLAW_SANDBOX_EXEC_TIMEOUT_MS` | per call site (typically `15000`) | Overrides the default timeout for `openshell sandbox exec` calls issued by recovery and lifecycle helpers. Integer milliseconds up to `2147483647`; other values fall back to the per-call-site default. | +| `NEMOCLAW_STATUS_PROBE_TIMEOUT_MS` | built-in default | Overrides the timeout for the OpenShell status probe used by `$$nemoclaw status`. Integer milliseconds up to `2147483647`; other values fall back to the default. | | `NEMOCLAW_WSL_GPU_PROOF_TIMEOUT_MS` | `180000` | Maximum time for the selected provider's bounded CUDA workload on an eligible ARM64 Linux host. A positive integer overrides the default and is capped at `900000` (15 minutes). Invalid, infinite, zero, and negative values use the default. | ### Onboard and Sandbox Readiness Timeouts From abf5c31780928c29a1379f2641f241bce2bbbd3c Mon Sep 17 00:00:00 2001 From: Rebecca Sliter Date: Mon, 26 Oct 2026 13:33:21 -0700 Subject: [PATCH 12/17] docs: restore unlocked status guidance after branch update Signed-off-by: Rebecca Sliter <571084+rsliter@users.noreply.github.com> --- docs/reference/commands.mdx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/docs/reference/commands.mdx b/docs/reference/commands.mdx index 2d2d91e870c..b37720bf368 100644 --- a/docs/reference/commands.mdx +++ b/docs/reference/commands.mdx @@ -1791,7 +1791,7 @@ nonzero. A stopped runtime without recorded stop intent remains a For a `compatible-endpoint` route that uses `openai-completions`, the text output prints `Reasoning effort` as `low`, `medium`, `high`, or `endpoint-default`. The line is omitted for another provider or API family. -Pass `--json` to emit a structured per-sandbox report instead of the text renderer. The JSON output includes at least `schemaVersion`, `name`, `found`, `agent`, `agentDisplayName`, `agentRuntime`, `dcodeAutoApprovalMode`, `model`, `provider`, `recordedRoute`, `liveRoute`, `routeDrift`, `phase`, `gatewayState`, `inferenceHealth`, `rpcIssue`, `hostGpuDetected`, `sandboxGpuEnabled`, `sandboxGpuMode`, `sandboxGpuDevice`, `openshellDriver`, `openshellVersion`, `policies`, `policiesAvailable`, `llamaCpp`, `failureLayer`, `terminalRuntimeHealth`, `servingProcessHealth`, and `dockerPaused`. `policies` is derived from the current OpenShell policy; NemoClaw does not persist a second preset list or baseline-exclusion ledger. `policiesAvailable` is `false` when that live policy cannot be read or parsed, distinguishing an unavailable result from a verified empty `policies` array; text status prints `Policies: unavailable` for the same state. When the live gateway route matches the sandbox's recorded llama.cpp route, `llamaCpp.kind` is `attached`, `managed`, or `unavailable`. An attached route also includes its fixed loopback `llamaCpp.endpointUrl`. An unavailable result means NemoClaw could not safely verify the managed ownership receipt; it does not include an endpoint and provides a secret-free diagnostic and recovery action. During route drift, `status` omits the `llamaCpp` route attribution; inspect `routeDrift` before acting on endpoint information. Text status can still show managed-runtime details from the sandbox-owned receipt. The schema-version `1` `model` and `provider` fields keep their established live-route meaning when the gateway route is readable, except that sandboxes with native NVIDIA, fixed hosted, or Deep Agents Code, Hermes, or OpenClaw native local provider attachments report their recorded sandbox-scoped route because the shared route is unrelated. Use `recordedRoute` for the sandbox's durable provider and model and `liveRoute` for the gateway-global route. When the live shared route differs for a shared-route provider, text output prints both routes and JSON output sets `routeDrift.live`, `routeDrift.recorded`, and `routeDrift.canConnect`. Native NVIDIA, fixed hosted, and Deep Agents Code, Hermes, or OpenClaw native local provider attachments do not report shared-route drift. When `routeDrift.canConnect` is `false`, `connect` cannot safely restore the recorded route because provider-global identity differs or required route or gateway metadata is incomplete. Refer to [Use Shared Gateway Routes](../inference/manage-inference/use-shared-gateway-routes) for the route-sharing workflow. `openshellDriver` and `openshellVersion` are always strings (falling back to `"unknown"` when the registry has no value), so consumers can rely on `typeof` checks. `agent` is always a string and reports `openclaw` when the registry records no agent for the sandbox. `failureLayer` is `null` when no preflight failure was detected and otherwise one of `docker_unreachable`, `sandbox_container_stopped`, or `sandbox_dashboard_port_conflict`; when set, `inferenceHealth` is suppressed to `null` so automation does not see a stale remote-provider healthy status during a local outage. `inferenceHealth.ok` can mean a valid model response, a reachable route without a request, or a degraded native NVIDIA result. Inspect `degraded` and `probed` before treating it as verified model health. The result must match Chat Completions, Responses, or Anthropic Messages for the selected route. An empty body, malformed JSON, provider-error envelope, or wrong response shape reports `unhealthy`, even with a 2xx status. The probe captures at most 64 KiB and does not include the response body in diagnostics. The path probe treats any final HTTP status from `200` through `499` as reachable, so a route with an invalidated provider credential answers HTTP `401` while the path is up. Shared-route requests use the live gateway route's provider and model, then fall back to the recorded values when the live route is unreadable. Native NVIDIA, hosted, and Deep Agents Code, Hermes, or OpenClaw native local requests always use the sandbox's recorded provider and model. When the live shared provider matches the recorded provider, the request uses the sandbox's recorded API family, even when only the model differs. This includes `openai-responses`. When the live shared provider differs, NemoClaw does not carry the recorded API family to that provider. Each attempt requests 16 reply tokens for ordinary providers or 256 for Gemini. The request allows up to 90 seconds, and the host wrapper allows 95 seconds for bounded process startup and cleanup. Hosted requests consume provider tokens on every attempt. When the inference request returns HTTP `429`, `500`, `502`, `503`, or `504`, `status` retries the selected provider path and request up to three total attempts, with a two-second delay between failed attempts, because those statuses are transient gateway and availability answers rather than evidence that the path is broken. Before each retry, it writes the failed probe boundary, an HTTP status when one is available, the next attempt, total attempts, and delay to stderr; `--json` keeps stdout machine-readable. On an ordinary run, terminal HTTP `401`, `403`, or `404`, an invalid 2xx response body, an unconfirmed statusless failure, and a failing provider-path probe are final on the first attempt. When the same run recovers a managed gateway, `status` retries any failed route or inference probe on that schedule instead, while the restarted delivery chain settles. Each route probe has a 10-second timeout. Three complete route probes plus their 95-second inference wrappers and two delays can take about 319 seconds. When NemoClaw sends an inference request, `inferenceHealth.subprobes` reports the provider-path result as the `route reachability` hop, so a failing verdict still shows that the path itself answered. `inferenceHealth.failureLabel` reports why the inference request failed: +Pass `--json` to emit a structured per-sandbox report instead of the text renderer. The JSON output includes at least `schemaVersion`, `name`, `found`, `agent`, `agentDisplayName`, `agentRuntime`, `dcodeAutoApprovalMode`, `model`, `provider`, `recordedRoute`, `liveRoute`, `routeDrift`, `phase`, `gatewayState`, `inferenceHealth`, `inferenceProbeSuppressed`, `rpcIssue`, `hostGpuDetected`, `sandboxGpuEnabled`, `sandboxGpuMode`, `sandboxGpuDevice`, `openshellDriver`, `openshellVersion`, `policies`, `policiesAvailable`, `llamaCpp`, `failureLayer`, `terminalRuntimeHealth`, `servingProcessHealth`, and `dockerPaused`. `policies` is derived from the current OpenShell policy; NemoClaw does not persist a second preset list or baseline-exclusion ledger. `policiesAvailable` is `false` when that live policy cannot be read or parsed, distinguishing an unavailable result from a verified empty `policies` array; text status prints `Policies: unavailable` for the same state. When the live gateway route matches the sandbox's recorded llama.cpp route, `llamaCpp.kind` is `attached`, `managed`, or `unavailable`. An attached route also includes its fixed loopback `llamaCpp.endpointUrl`. An unavailable result means NemoClaw could not safely verify the managed ownership receipt; it does not include an endpoint and provides a secret-free diagnostic and recovery action. During route drift, `status` omits the `llamaCpp` route attribution; inspect `routeDrift` before acting on endpoint information. Text status can still show managed-runtime details from the sandbox-owned receipt. The schema-version `1` `model` and `provider` fields keep their established live-route meaning when the gateway route is readable, except that sandboxes with native NVIDIA, fixed hosted, or Deep Agents Code, Hermes, or OpenClaw native local provider attachments report their recorded sandbox-scoped route because the shared route is unrelated. Use `recordedRoute` for the sandbox's durable provider and model and `liveRoute` for the gateway-global route. When the live shared route differs for a shared-route provider, text output prints both routes and JSON output sets `routeDrift.live`, `routeDrift.recorded`, and `routeDrift.canConnect`. Native NVIDIA, fixed hosted, and Deep Agents Code, Hermes, or OpenClaw native local provider attachments do not report shared-route drift. When `routeDrift.canConnect` is `false`, `connect` cannot safely restore the recorded route because provider-global identity differs or required route or gateway metadata is incomplete. Refer to [Use Shared Gateway Routes](../inference/manage-inference/use-shared-gateway-routes) for the route-sharing workflow. `openshellDriver` and `openshellVersion` are always strings (falling back to `"unknown"` when the registry has no value), so consumers can rely on `typeof` checks. `agent` is always a string and reports `openclaw` when the registry records no agent for the sandbox. `failureLayer` is `null` when no preflight failure was detected and otherwise one of `docker_unreachable`, `sandbox_container_stopped`, or `sandbox_dashboard_port_conflict`; when set, `inferenceHealth` is suppressed to `null` so automation does not see a stale remote-provider healthy status during a local outage. `inferenceHealth.ok` can mean a valid model response, a reachable route without a request, or a degraded native NVIDIA result. Inspect `degraded` and `probed` before treating it as verified model health. The result must match Chat Completions, Responses, or Anthropic Messages for the selected route. An empty body, malformed JSON, provider-error envelope, or wrong response shape reports `unhealthy`, even with a 2xx status. The probe captures at most 64 KiB and does not include the response body in diagnostics. The path probe treats any final HTTP status from `200` through `499` as reachable, so a route with an invalidated provider credential answers HTTP `401` while the path is up. Shared-route requests use the live gateway route's provider and model, then fall back to the recorded values when the live route is unreadable. Native NVIDIA, hosted, and Deep Agents Code, Hermes, or OpenClaw native local requests always use the sandbox's recorded provider and model. When the live shared provider matches the recorded provider, the request uses the sandbox's recorded API family, even when only the model differs. This includes `openai-responses`. When the live shared provider differs, NemoClaw does not carry the recorded API family to that provider. Each attempt requests 16 reply tokens for ordinary providers or 256 for Gemini. The request allows up to 90 seconds, and the host wrapper allows 95 seconds for bounded process startup and cleanup. Hosted requests consume provider tokens on every attempt. When the inference request returns HTTP `429`, `500`, `502`, `503`, or `504`, `status` retries the selected provider path and request up to three total attempts, with a two-second delay between failed attempts, because those statuses are transient gateway and availability answers rather than evidence that the path is broken. Before each retry, it writes the failed probe boundary, an HTTP status when one is available, the next attempt, total attempts, and delay to stderr; `--json` keeps stdout machine-readable. On an ordinary run, terminal HTTP `401`, `403`, or `404`, an invalid 2xx response body, an unconfirmed statusless failure, and a failing provider-path probe are final on the first attempt. When the same run recovers a managed gateway, `status` retries any failed route or inference probe on that schedule instead, while the restarted delivery chain settles. Each route probe has a 10-second timeout. Three complete route probes plus their 95-second inference wrappers and two delays can take about 319 seconds. When NemoClaw sends an inference request, `inferenceHealth.subprobes` reports the provider-path result as the `route reachability` hop, so a failing verdict still shows that the path itself answered. `inferenceHealth.failureLabel` reports why the inference request failed: - `unauthorized` when the route rejected it with HTTP `401` or `403`. - `unhealthy` when the route returned another failing HTTP status or an invalid 2xx response body. @@ -1845,7 +1845,7 @@ $$nemoclaw my-assistant status --json $$nemoclaw sandbox status my-assistant --json ``` -The command probes the selected provider path from inside the sandbox, and when that probe reports the path reachable it sends an inference request over the same path. NVIDIA Endpoints, supported fixed hosted providers, new hosted compatible selections outside the Personal tier, and qualified new local selections use native endpoints through sandbox-attached OpenShell providers. Owned Local NVIDIA NIM, fresh Personal-tier hosted compatible selections, custom endpoints without an attachment, and retained shared routes use `inference.local`. The inference request verifies the selected provider path, and both checks exercise the path that agent traffic uses. For provider-path results, the main `Inference` line uses these states: +On a normal status read, the command probes the selected provider path from inside the sandbox, and when that probe reports the path reachable it sends an inference request over the same path. NVIDIA Endpoints, supported fixed hosted providers, new hosted compatible selections outside the Personal tier, and qualified new local selections use native endpoints through sandbox-attached OpenShell providers. Owned Local NVIDIA NIM, fresh Personal-tier hosted compatible selections, custom endpoints without an attachment, and retained shared routes use `inference.local`. The inference request verifies the selected provider path, and both checks exercise the path that agent traffic uses. For provider-path results, the main `Inference` line uses these states: | State | Meaning | | -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -1858,6 +1858,13 @@ The command probes the selected provider path from inside the sandbox, and when | `not probed` | NemoClaw could not run the authoritative route probe from a reachable sandbox. | | `not verified` | NemoClaw could not verify the sandbox or gateway state, so it skips inference probing. | +When another lifecycle operation is in progress and NemoClaw confirms that no Portable authority exists, status returns a best-effort, read-only snapshot that can show transitional state. +It does not run inference health checks or send an inference request. +It does not repair the gateway, host forward, stop-intent record, or Hermes tool gateway broker. +JSON output sets `inferenceProbeSuppressed` to `true`. +If NemoClaw finds or cannot rule out Portable authority, status fails fast. +If Portable authority appears during the snapshot, status reports a lifecycle conflict after it finishes the snapshot. + An authentication response on a shared gateway route probe confirms that the route is reachable, not that provider credentials are valid. For those shared routes, `$$nemoclaw doctor` sends no inference request, so it reports an HTTP `401` or `403` route response as reachable and exits `0` where `status` reports `unauthorized`. Native hosted and Deep Agents Code, Hermes, and OpenClaw native local doctor checks verify the recorded provider identity and sandbox attachment, then require a successful inference request through the selected native endpoint. The native NVIDIA doctor probe verifies the sandbox-attached provider directly and requires a 2xx response. The command can also print direct host-side provider checks such as `Inference (upstream)` and provider-specific subprobes. For supported remote providers, this diagnostic sends an authenticated request to the configured model and accepts only a recognized Chat Completions, streaming Chat Completions, or Anthropic Messages response. It uses a 3-second connection timeout, a 5-second total timeout, and an 8-token output limit. If that host-side request reaches the time limit, `Inference (upstream)` reports `not probed` and leaves model health unverified. A confirmed timeout of the authoritative native NVIDIA request instead reports `degraded` after bounded retries. Host-side checks are diagnostic only and do not override the authoritative selected-provider result or determine the command exit status. The `Inference (upstream)` check authenticates with the host credential that NemoClaw resolves for the provider, such as `NVIDIA_INFERENCE_API_KEY`. OpenShell stores the credential that the sandbox's selected provider path uses. The CLI cannot read the stored value back, so the two credentials can hold different secrets. When the managed sandbox path has already served the inference request, an `unauthorized` result on `Inference (upstream)` describes the host credential. NemoClaw then reports that check as `not probed` and names both credential sources. An `Inference (upstream)` check that fails for another reason, such as `unreachable`, still reports its own state. Local backend and auth proxy checks, such as `Inference (auth proxy)`, always report their own state and their own repair step. For a shared route, `$$nemoclaw doctor` sends no inference request, so it reports the `Inference (upstream)` state that it measured. @@ -1871,7 +1878,7 @@ When the sandbox's recorded driver is `docker` and the host Docker daemon is not When the host Docker daemon is reachable but the per-sandbox container is stopped without a matching intentional-stop record, the initial preflight records the `sandbox_container_stopped` failure layer and suppresses the host-side `Inference` probe. A matching intentional-stop record instead produces the clean `Stopped` result described above. If the owning OpenShell gateway is healthy but no longer lists the registered sandbox, status preserves the local registration and reports the missing OpenShell state without directly starting, unpausing, renaming, or replacing a container. -If OpenShell already reports the registered Docker-driver sandbox as present and `Ready`, status verifies the OpenClaw gateway and host forward. +When lifecycle locks are available and OpenShell reports the registered Docker-driver sandbox as present and `Ready`, status verifies the OpenClaw gateway and host forward. It recovers either component when the verification reports it absent. When status finds a running sandbox but cannot clear its stale intentional-stop record, it exits non-zero and reports the `stop_intent_update_failed` state. From 90385347671f5bb0df23f9bebb423ab8debb43e1 Mon Sep 17 00:00:00 2001 From: Rebecca Sliter Date: Tue, 27 Oct 2026 02:52:50 -0700 Subject: [PATCH 13/17] docs(status): qualify inference checks during lifecycle reads Signed-off-by: Rebecca Sliter <571084+rsliter@users.noreply.github.com> --- docs/inference/set-up-ollama.mdx | 2 ++ docs/inference/verify-inference-route.mdx | 2 ++ docs/reference/commands.mdx | 2 +- docs/reference/troubleshooting.mdx | 4 +++- docs/security/credential-rotation.mdx | 3 ++- 5 files changed, 10 insertions(+), 3 deletions(-) diff --git a/docs/inference/set-up-ollama.mdx b/docs/inference/set-up-ollama.mdx index f815893f452..84635e6ff02 100644 --- a/docs/inference/set-up-ollama.mdx +++ b/docs/inference/set-up-ollama.mdx @@ -290,6 +290,8 @@ The host-side proxy liveness check treats any HTTP response, including `401`, as The `status` and `doctor` route probe runs inside the sandbox and reports HTTP `200` through `499` as reachable, HTTP `500` through `599` as `unhealthy`, and transport failures or unavailable probes as `unreachable` or `not probed`. `status` then sends an inference request over the reachable route and reports `healthy` when the route served it, or `unauthorized` when the proxy token is no longer accepted. +These checks apply to a normal status read. If status reports `Inference: not probed (another lifecycle operation is in progress)`, it skipped route and inference probes and JSON output sets `inferenceProbeSuppressed: true`. Repeat status after the lifecycle operation completes before using it to verify the route or proxy token. + If Ollama is already bound to a non-loopback address, onboarding restarts it on `127.0.0.1:11434` so the proxy becomes the only network path. ## Allow the Docker Bridge Through a Firewall diff --git a/docs/inference/verify-inference-route.mdx b/docs/inference/verify-inference-route.mdx index 344d58461ae..0a49476b298 100644 --- a/docs/inference/verify-inference-route.mdx +++ b/docs/inference/verify-inference-route.mdx @@ -34,6 +34,8 @@ Run the named sandbox status command. $$nemoclaw status ``` +The checks below apply to a normal status read. If status reports `Inference: not probed (another lifecycle operation is in progress)`, it did not verify the route or send an inference request. JSON output sets `inferenceProbeSuppressed: true`. Repeat status after the lifecycle operation completes before treating its result as inference evidence. + For NVIDIA Endpoints, the `Inference` row verifies the recorded sandbox attachment. It then sends a native Chat Completions request to `https://integrate.api.nvidia.com/v1`. It does not probe `https://inference.local/v1/models` for this provider. diff --git a/docs/reference/commands.mdx b/docs/reference/commands.mdx index 839de4ea6c6..5b243e0627c 100644 --- a/docs/reference/commands.mdx +++ b/docs/reference/commands.mdx @@ -1791,7 +1791,7 @@ nonzero. A stopped runtime without recorded stop intent remains a For a `compatible-endpoint` route that uses `openai-completions`, the text output prints `Reasoning effort` as `low`, `medium`, `high`, or `endpoint-default`. The line is omitted for another provider or API family. -Pass `--json` to emit a structured per-sandbox report instead of the text renderer. The JSON output includes at least `schemaVersion`, `name`, `found`, `agent`, `agentDisplayName`, `agentRuntime`, `dcodeAutoApprovalMode`, `model`, `provider`, `recordedRoute`, `liveRoute`, `routeDrift`, `phase`, `gatewayState`, `inferenceHealth`, `inferenceProbeSuppressed`, `rpcIssue`, `hostGpuDetected`, `sandboxGpuEnabled`, `sandboxGpuMode`, `sandboxGpuDevice`, `openshellDriver`, `openshellVersion`, `policies`, `policiesAvailable`, `llamaCpp`, `failureLayer`, `terminalRuntimeHealth`, `servingProcessHealth`, and `dockerPaused`. `policies` is derived from the current OpenShell policy; NemoClaw does not persist a second preset list or baseline-exclusion ledger. `policiesAvailable` is `false` when that live policy cannot be read or parsed, distinguishing an unavailable result from a verified empty `policies` array; text status prints `Policies: unavailable` for the same state. When the live gateway route matches the sandbox's recorded llama.cpp route, `llamaCpp.kind` is `attached`, `managed`, or `unavailable`. An attached route also includes its fixed loopback `llamaCpp.endpointUrl`. An unavailable result means NemoClaw could not safely verify the managed ownership receipt; it does not include an endpoint and provides a secret-free diagnostic and recovery action. During route drift, `status` omits the `llamaCpp` route attribution; inspect `routeDrift` before acting on endpoint information. Text status can still show managed-runtime details from the sandbox-owned receipt. The schema-version `1` `model` and `provider` fields keep their established live-route meaning when the gateway route is readable, except that sandboxes with native NVIDIA, fixed hosted, or Deep Agents Code, Hermes, or OpenClaw native local provider attachments report their recorded sandbox-scoped route because the shared route is unrelated. Use `recordedRoute` for the sandbox's durable provider and model and `liveRoute` for the gateway-global route. When the live shared route differs for a shared-route provider, text output prints both routes and JSON output sets `routeDrift.live`, `routeDrift.recorded`, and `routeDrift.canConnect`. Native NVIDIA, fixed hosted, and Deep Agents Code, Hermes, or OpenClaw native local provider attachments do not report shared-route drift; `status` does not read the shared gateway route for those sandboxes, so `liveRoute` and `routeDrift` are always `null` even while the attached provider serves requests. Use `recordedRoute` and `inferenceHealth` to check a native provider attachment. When `routeDrift.canConnect` is `false`, `connect` cannot safely restore the recorded route because provider-global identity differs or required route or gateway metadata is incomplete. Refer to [Use Shared Gateway Routes](../inference/manage-inference/use-shared-gateway-routes) for the route-sharing workflow. `openshellDriver` and `openshellVersion` are always strings (falling back to `"unknown"` when the registry has no value), so consumers can rely on `typeof` checks. `agent` is always a string and reports `openclaw` when the registry records no agent for the sandbox. `failureLayer` is `null` when no preflight failure was detected and otherwise one of `docker_unreachable`, `sandbox_container_stopped`, or `sandbox_dashboard_port_conflict`; when set, `inferenceHealth` is suppressed to `null` so automation does not see a stale remote-provider healthy status during a local outage. `inferenceHealth.ok` can mean a valid model response, a reachable route without a request, or a degraded native NVIDIA result. Inspect `degraded` and `probed` before treating it as verified model health. The result must match Chat Completions, Responses, or Anthropic Messages for the selected route. An empty body, malformed JSON, provider-error envelope, or wrong response shape reports `unhealthy`, even with a 2xx status. The probe captures at most 64 KiB and does not include the response body in diagnostics. The path probe treats any final HTTP status from `200` through `499` as reachable, so a route with an invalidated provider credential answers HTTP `401` while the path is up. Shared-route requests use the live gateway route's provider and model, then fall back to the recorded values when the live route is unreadable. Native NVIDIA, hosted, and Deep Agents Code, Hermes, or OpenClaw native local requests always use the sandbox's recorded provider and model. When the live shared provider matches the recorded provider, the request uses the sandbox's recorded API family, even when only the model differs. This includes `openai-responses`. When the live shared provider differs, NemoClaw does not carry the recorded API family to that provider. Each attempt requests 16 reply tokens for ordinary providers or 256 for Gemini. The request allows up to 90 seconds, and the host wrapper allows 95 seconds for bounded process startup and cleanup. Hosted requests consume provider tokens on every attempt. When the inference request returns HTTP `429`, `500`, `502`, `503`, or `504`, `status` retries the selected provider path and request up to three total attempts, with a two-second delay between failed attempts, because those statuses are transient gateway and availability answers rather than evidence that the path is broken. Before each retry, it writes the failed probe boundary, an HTTP status when one is available, the next attempt, total attempts, and delay to stderr; `--json` keeps stdout machine-readable. On an ordinary run, terminal HTTP `401`, `403`, or `404`, an invalid 2xx response body, an unconfirmed statusless failure, and a failing provider-path probe are final on the first attempt. When the same run recovers a managed gateway, `status` retries any failed route or inference probe on that schedule instead, while the restarted delivery chain settles. Each route probe has a 10-second timeout. Three complete route probes plus their 95-second inference wrappers and two delays can take about 319 seconds. When NemoClaw sends an inference request, `inferenceHealth.subprobes` reports the provider-path result as the `route reachability` hop, so a failing verdict still shows that the path itself answered. `inferenceHealth.failureLabel` reports why the inference request failed: +Pass `--json` to emit a structured per-sandbox report instead of the text renderer. The JSON output includes at least `schemaVersion`, `name`, `found`, `agent`, `agentDisplayName`, `agentRuntime`, `dcodeAutoApprovalMode`, `model`, `provider`, `recordedRoute`, `liveRoute`, `routeDrift`, `phase`, `gatewayState`, `inferenceHealth`, `rpcIssue`, `hostGpuDetected`, `sandboxGpuEnabled`, `sandboxGpuMode`, `sandboxGpuDevice`, `openshellDriver`, `openshellVersion`, `policies`, `policiesAvailable`, `llamaCpp`, `failureLayer`, `terminalRuntimeHealth`, `servingProcessHealth`, and `dockerPaused`. `policies` is derived from the current OpenShell policy; NemoClaw does not persist a second preset list or baseline-exclusion ledger. `policiesAvailable` is `false` when that live policy cannot be read or parsed, distinguishing an unavailable result from a verified empty `policies` array; text status prints `Policies: unavailable` for the same state. When the live gateway route matches the sandbox's recorded llama.cpp route, `llamaCpp.kind` is `attached`, `managed`, or `unavailable`. An attached route also includes its fixed loopback `llamaCpp.endpointUrl`. An unavailable result means NemoClaw could not safely verify the managed ownership receipt; it does not include an endpoint and provides a secret-free diagnostic and recovery action. During route drift, `status` omits the `llamaCpp` route attribution; inspect `routeDrift` before acting on endpoint information. Text status can still show managed-runtime details from the sandbox-owned receipt. The schema-version `1` `model` and `provider` fields keep their established live-route meaning when the gateway route is readable, except that sandboxes with native NVIDIA, fixed hosted, or Deep Agents Code, Hermes, or OpenClaw native local provider attachments report their recorded sandbox-scoped route because the shared route is unrelated. Use `recordedRoute` for the sandbox's durable provider and model and `liveRoute` for the gateway-global route. When the live shared route differs for a shared-route provider, text output prints both routes and JSON output sets `routeDrift.live`, `routeDrift.recorded`, and `routeDrift.canConnect`. Native NVIDIA, fixed hosted, and Deep Agents Code, Hermes, or OpenClaw native local provider attachments do not report shared-route drift; `status` does not read the shared gateway route for those sandboxes, so `liveRoute` and `routeDrift` are always `null` even while the attached provider serves requests. Use `recordedRoute` and `inferenceHealth` to check a native provider attachment. When `routeDrift.canConnect` is `false`, `connect` cannot safely restore the recorded route because provider-global identity differs or required route or gateway metadata is incomplete. Refer to [Use Shared Gateway Routes](../inference/manage-inference/use-shared-gateway-routes) for the route-sharing workflow. `openshellDriver` and `openshellVersion` are always strings (falling back to `"unknown"` when the registry has no value), so consumers can rely on `typeof` checks. `agent` is always a string and reports `openclaw` when the registry records no agent for the sandbox. `failureLayer` is `null` when no preflight failure was detected and otherwise one of `docker_unreachable`, `sandbox_container_stopped`, or `sandbox_dashboard_port_conflict`; when set, `inferenceHealth` is suppressed to `null` so automation does not see a stale remote-provider healthy status during a local outage. `inferenceHealth.ok` can mean a valid model response, a reachable route without a request, or a degraded native NVIDIA result. Inspect `degraded` and `probed` before treating it as verified model health. The result must match Chat Completions, Responses, or Anthropic Messages for the selected route. An empty body, malformed JSON, provider-error envelope, or wrong response shape reports `unhealthy`, even with a 2xx status. The probe captures at most 64 KiB and does not include the response body in diagnostics. The path probe treats any final HTTP status from `200` through `499` as reachable, so a route with an invalidated provider credential answers HTTP `401` while the path is up. Shared-route requests use the live gateway route's provider and model, then fall back to the recorded values when the live route is unreadable. Native NVIDIA, hosted, and Deep Agents Code, Hermes, or OpenClaw native local requests always use the sandbox's recorded provider and model. When the live shared provider matches the recorded provider, the request uses the sandbox's recorded API family, even when only the model differs. This includes `openai-responses`. When the live shared provider differs, NemoClaw does not carry the recorded API family to that provider. Each attempt requests 16 reply tokens for ordinary providers or 256 for Gemini. The request allows up to 90 seconds, and the host wrapper allows 95 seconds for bounded process startup and cleanup. Hosted requests consume provider tokens on every attempt. When the inference request returns HTTP `429`, `500`, `502`, `503`, or `504`, `status` retries the selected provider path and request up to three total attempts, with a two-second delay between failed attempts, because those statuses are transient gateway and availability answers rather than evidence that the path is broken. Before each retry, it writes the failed probe boundary, an HTTP status when one is available, the next attempt, total attempts, and delay to stderr; `--json` keeps stdout machine-readable. On an ordinary run, terminal HTTP `401`, `403`, or `404`, an invalid 2xx response body, an unconfirmed statusless failure, and a failing provider-path probe are final on the first attempt. When the same run recovers a managed gateway, `status` retries any failed route or inference probe on that schedule instead, while the restarted delivery chain settles. Each route probe has a 10-second timeout. Three complete route probes plus their 95-second inference wrappers and two delays can take about 319 seconds. When NemoClaw sends an inference request, `inferenceHealth.subprobes` reports the provider-path result as the `route reachability` hop, so a failing verdict still shows that the path itself answered. `inferenceHealth.failureLabel` reports why the inference request failed: - `unauthorized` when the route rejected it with HTTP `401` or `403`. - `unhealthy` when the route returned another failing HTTP status or an invalid 2xx response body. diff --git a/docs/reference/troubleshooting.mdx b/docs/reference/troubleshooting.mdx index b69c22bf7fa..c3d0e9f396c 100644 --- a/docs/reference/troubleshooting.mdx +++ b/docs/reference/troubleshooting.mdx @@ -2104,7 +2104,9 @@ Verify that the inference provider endpoint is reachable from the host. Check th $$nemoclaw status ``` -The main `Inference` line checks the provider path from inside the sandbox and sends an inference request over the path the agent uses. For shared-route providers, including owned Local NVIDIA NIM, `status` probes `https://inference.local/v1/models` before it sends the request through `https://inference.local`. For NVIDIA Endpoints, fixed hosted selections, new hosted compatible selections outside the Personal tier, and qualified new local selections with a recorded native attachment, it verifies that attachment and sends the request to the selected native endpoint; it does not probe `inference.local`. When an inference request returns a transient gateway status, `status` makes up to three request attempts before it reports a failure. Shared-route retries repeat the route probe and request, while native providers retry only the native request. It prints the next attempt and two-second delay to stderr before each retry. Each inference request attempt has a 90-second request timeout. If a verified native NVIDIA attachment returns HTTP `429`, `500`, `502`, `503`, or `504`, or a confirmed timeout after bounded retries, `status` reports `degraded` and exits `0`. The model response remains unverified. Run `$$nemoclaw connect --probe-only` to require a successful inference request before accepting readiness. If the main line shows `unauthorized`, `unhealthy`, `unreachable`, or `not probed`, inspect the labeled diagnostic lines to identify the failing hop. An `unauthorized` line means the route answered but rejected the request, so refresh the provider credential rather than the route. +On a normal status read, the main `Inference` line checks the provider path from inside the sandbox and sends an inference request over the path the agent uses. For shared-route providers, including owned Local NVIDIA NIM, `status` probes `https://inference.local/v1/models` before it sends the request through `https://inference.local`. For NVIDIA Endpoints, fixed hosted selections, new hosted compatible selections outside the Personal tier, and qualified new local selections with a recorded native attachment, it verifies that attachment and sends the request to the selected native endpoint; it does not probe `inference.local`. When an inference request returns a transient gateway status, `status` makes up to three request attempts before it reports a failure. Shared-route retries repeat the route probe and request, while native providers retry only the native request. It prints the next attempt and two-second delay to stderr before each retry. Each inference request attempt has a 90-second request timeout. If a verified native NVIDIA attachment returns HTTP `429`, `500`, `502`, `503`, or `504`, or a confirmed timeout after bounded retries, `status` reports `degraded` and exits `0`. The model response remains unverified. Run `$$nemoclaw connect --probe-only` to require a successful inference request before accepting readiness. If the main line shows `unauthorized`, `unhealthy`, `unreachable`, or `not probed`, inspect the labeled diagnostic lines to identify the failing hop. An `unauthorized` line means the route answered but rejected the request, so refresh the provider credential rather than the route. + +If status reports `Inference: not probed (another lifecycle operation is in progress)`, the unlocked read skipped provider-path and inference probes; JSON output sets `inferenceProbeSuppressed: true`. Wait for the lifecycle operation to finish and run status again before diagnosing the route or credential. For Hermes native NVIDIA routes, status also checks the managed credential reference in the Hermes configuration. If this check reports an invalid or stale credential, run `$$nemoclaw rebuild --yes` to refresh it. Then rerun `$$nemoclaw status` and confirm inference is healthy. If status reports that the installed image lacks the credential verifier, rebuild to install it, then rerun status. For other unavailable-verification results, follow the printed sandbox health and access recovery guidance. diff --git a/docs/security/credential-rotation.mdx b/docs/security/credential-rotation.mdx index b5f599fb904..29377de5ac4 100644 --- a/docs/security/credential-rotation.mdx +++ b/docs/security/credential-rotation.mdx @@ -304,7 +304,8 @@ Plan for recreation downtime when automating messaging or web search rotation. `$$nemoclaw credentials list` confirms that a provider exists, but it does not reveal or validate the stored value. `$$nemoclaw status` performs host-side reachability checks without sending cloud API keys, so even an HTTP `401` or `403` can count as reachable there. -`$$nemoclaw status` also sends an inference request through the stored provider credential and reports `unauthorized` when the route rejects it with HTTP `401` or `403`. It does not retry that rejection. +On a normal read, `$$nemoclaw status` also sends an inference request through the stored provider credential and reports `unauthorized` when the route rejects it with HTTP `401` or `403`. It does not retry that rejection. +If status reports `Inference: not probed (another lifecycle operation is in progress)`, the credential was not checked; JSON output sets `inferenceProbeSuppressed: true`. Repeat status after the lifecycle operation completes before accepting it as credential evidence. `$$nemoclaw inference get` reports the active route and does not authenticate a model request. Complete a real request through the rotated integration before declaring the rotation successful. From 0faf867907781dea12dcbb7b1c99826bcdfd1777 Mon Sep 17 00:00:00 2001 From: Rebecca Sliter Date: Tue, 27 Oct 2026 03:21:50 -0700 Subject: [PATCH 14/17] docs(status): qualify inference requests by verified state Signed-off-by: Rebecca Sliter <571084+rsliter@users.noreply.github.com> --- docs/inference/set-up-ollama.mdx | 2 +- docs/inference/verify-inference-route.mdx | 2 +- docs/reference/troubleshooting.mdx | 2 +- docs/security/credential-rotation.mdx | 3 ++- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/inference/set-up-ollama.mdx b/docs/inference/set-up-ollama.mdx index 84635e6ff02..a99a1b00733 100644 --- a/docs/inference/set-up-ollama.mdx +++ b/docs/inference/set-up-ollama.mdx @@ -290,7 +290,7 @@ The host-side proxy liveness check treats any HTTP response, including `401`, as The `status` and `doctor` route probe runs inside the sandbox and reports HTTP `200` through `499` as reachable, HTTP `500` through `599` as `unhealthy`, and transport failures or unavailable probes as `unreachable` or `not probed`. `status` then sends an inference request over the reachable route and reports `healthy` when the route served it, or `unauthorized` when the proxy token is no longer accepted. -These checks apply to a normal status read. If status reports `Inference: not probed (another lifecycle operation is in progress)`, it skipped route and inference probes and JSON output sets `inferenceProbeSuppressed: true`. Repeat status after the lifecycle operation completes before using it to verify the route or proxy token. +These checks apply to a normal status read when gateway and sandbox state are verified. If either state is not verified, status reports `Inference: not verified (gateway/sandbox state not verified)` and sends no inference request. If status reports `Inference: not probed (another lifecycle operation is in progress)`, it skipped route and inference probes and JSON output sets `inferenceProbeSuppressed: true` for that unlocked read. Repeat status after the lifecycle operation completes before using it to verify the route or proxy token. If Ollama is already bound to a non-loopback address, onboarding restarts it on `127.0.0.1:11434` so the proxy becomes the only network path. diff --git a/docs/inference/verify-inference-route.mdx b/docs/inference/verify-inference-route.mdx index 0a49476b298..ef48202005b 100644 --- a/docs/inference/verify-inference-route.mdx +++ b/docs/inference/verify-inference-route.mdx @@ -34,7 +34,7 @@ Run the named sandbox status command. $$nemoclaw status ``` -The checks below apply to a normal status read. If status reports `Inference: not probed (another lifecycle operation is in progress)`, it did not verify the route or send an inference request. JSON output sets `inferenceProbeSuppressed: true`. Repeat status after the lifecycle operation completes before treating its result as inference evidence. +The checks below apply to a normal status read when gateway and sandbox state are verified. If either state is not verified, status reports `Inference: not verified (gateway/sandbox state not verified)` and sends no inference request. If status reports `Inference: not probed (another lifecycle operation is in progress)`, it did not verify the route or send an inference request. JSON output sets `inferenceProbeSuppressed: true` for that unlocked read. Repeat status after the lifecycle operation completes before treating its result as inference evidence. For NVIDIA Endpoints, the `Inference` row verifies the recorded sandbox attachment. It then sends a native Chat Completions request to `https://integrate.api.nvidia.com/v1`. diff --git a/docs/reference/troubleshooting.mdx b/docs/reference/troubleshooting.mdx index c3d0e9f396c..a4324d0ba7b 100644 --- a/docs/reference/troubleshooting.mdx +++ b/docs/reference/troubleshooting.mdx @@ -2104,7 +2104,7 @@ Verify that the inference provider endpoint is reachable from the host. Check th $$nemoclaw status ``` -On a normal status read, the main `Inference` line checks the provider path from inside the sandbox and sends an inference request over the path the agent uses. For shared-route providers, including owned Local NVIDIA NIM, `status` probes `https://inference.local/v1/models` before it sends the request through `https://inference.local`. For NVIDIA Endpoints, fixed hosted selections, new hosted compatible selections outside the Personal tier, and qualified new local selections with a recorded native attachment, it verifies that attachment and sends the request to the selected native endpoint; it does not probe `inference.local`. When an inference request returns a transient gateway status, `status` makes up to three request attempts before it reports a failure. Shared-route retries repeat the route probe and request, while native providers retry only the native request. It prints the next attempt and two-second delay to stderr before each retry. Each inference request attempt has a 90-second request timeout. If a verified native NVIDIA attachment returns HTTP `429`, `500`, `502`, `503`, or `504`, or a confirmed timeout after bounded retries, `status` reports `degraded` and exits `0`. The model response remains unverified. Run `$$nemoclaw connect --probe-only` to require a successful inference request before accepting readiness. If the main line shows `unauthorized`, `unhealthy`, `unreachable`, or `not probed`, inspect the labeled diagnostic lines to identify the failing hop. An `unauthorized` line means the route answered but rejected the request, so refresh the provider credential rather than the route. +On a normal status read with verified gateway and sandbox state, the main `Inference` line checks the provider path from inside the sandbox and sends an inference request over the reachable path the agent uses. If gateway or sandbox state is not verified, status reports `Inference: not verified (gateway/sandbox state not verified)` and sends no inference request. For shared-route providers, including owned Local NVIDIA NIM, `status` probes `https://inference.local/v1/models` before it sends the request through `https://inference.local`. For NVIDIA Endpoints, fixed hosted selections, new hosted compatible selections outside the Personal tier, and qualified new local selections with a recorded native attachment, it verifies that attachment and sends the request to the selected native endpoint; it does not probe `inference.local`. When an inference request returns a transient gateway status, `status` makes up to three request attempts before it reports a failure. Shared-route retries repeat the route probe and request, while native providers retry only the native request. It prints the next attempt and two-second delay to stderr before each retry. Each inference request attempt has a 90-second request timeout. If a verified native NVIDIA attachment returns HTTP `429`, `500`, `502`, `503`, or `504`, or a confirmed timeout after bounded retries, `status` reports `degraded` and exits `0`. The model response remains unverified. Run `$$nemoclaw connect --probe-only` to require a successful inference request before accepting readiness. If the main line shows `unauthorized`, `unhealthy`, `unreachable`, or `not probed`, inspect the labeled diagnostic lines to identify the failing hop. An `unauthorized` line means the route answered but rejected the request, so refresh the provider credential rather than the route. If status reports `Inference: not probed (another lifecycle operation is in progress)`, the unlocked read skipped provider-path and inference probes; JSON output sets `inferenceProbeSuppressed: true`. Wait for the lifecycle operation to finish and run status again before diagnosing the route or credential. diff --git a/docs/security/credential-rotation.mdx b/docs/security/credential-rotation.mdx index 29377de5ac4..7fcac0525cc 100644 --- a/docs/security/credential-rotation.mdx +++ b/docs/security/credential-rotation.mdx @@ -304,7 +304,8 @@ Plan for recreation downtime when automating messaging or web search rotation. `$$nemoclaw credentials list` confirms that a provider exists, but it does not reveal or validate the stored value. `$$nemoclaw status` performs host-side reachability checks without sending cloud API keys, so even an HTTP `401` or `403` can count as reachable there. -On a normal read, `$$nemoclaw status` also sends an inference request through the stored provider credential and reports `unauthorized` when the route rejects it with HTTP `401` or `403`. It does not retry that rejection. +On a normal read with verified gateway and sandbox state, `$$nemoclaw status` checks the provider path and sends an inference request through the stored credential when the path is reachable. It reports `unauthorized` when the route rejects the request with HTTP `401` or `403` and does not retry that rejection. +If gateway or sandbox state is not verified, status reports `Inference: not verified (gateway/sandbox state not verified)` and sends no inference request. If status reports `Inference: not probed (another lifecycle operation is in progress)`, the credential was not checked; JSON output sets `inferenceProbeSuppressed: true`. Repeat status after the lifecycle operation completes before accepting it as credential evidence. `$$nemoclaw inference get` reports the active route and does not authenticate a model request. From e751b3fe69c531f0b8c873efc4aebf06b91d35eb Mon Sep 17 00:00:00 2001 From: Rebecca Sliter Date: Tue, 27 Oct 2026 03:51:09 -0700 Subject: [PATCH 15/17] docs(status): distinguish snapshots from inference readiness Signed-off-by: Rebecca Sliter <571084+rsliter@users.noreply.github.com> --- docs/deployment/deploy-to-headless-server.mdx | 4 +++- docs/inference/set-up-ollama.mdx | 2 +- docs/inference/verify-inference-route.mdx | 2 +- docs/monitoring/monitor-sandbox-activity.mdx | 4 +++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/deployment/deploy-to-headless-server.mdx b/docs/deployment/deploy-to-headless-server.mdx index bf5983e5241..e2b8678850b 100644 --- a/docs/deployment/deploy-to-headless-server.mdx +++ b/docs/deployment/deploy-to-headless-server.mdx @@ -206,7 +206,9 @@ $$nemoclaw headless-agent status $$nemoclaw headless-agent connect --probe-only ``` -`$$nemoclaw headless-agent status` exits nonzero when the sandbox, gateway, local container, or authoritative inference route is not verified, except for a degraded native NVIDIA result. Its main `Inference` line probes the selected provider path from inside the sandbox. Shared providers use `https://inference.local/v1/models`, then send an inference request over the same route when that probe reports the route reachable. NVIDIA Endpoints, supported fixed hosted providers, new hosted compatible endpoints outside the Personal tier, and qualified new local selections verify the recorded sandbox-attached OpenShell provider with an inference request. A fresh Personal-tier hosted compatible selection verifies the shared route and has no native attachment. Status repeats inference requests up to three total attempts when they return a transient gateway status; refer to the [CLI commands reference](../reference/commands) for the retried statuses and their token cost. The line reports `healthy` when the route served the request, `unauthorized` when the route rejected it with HTTP `401` or `403`, and `unhealthy` after other final failures. A verified native NVIDIA route instead reports `degraded` and exits `0` after a final HTTP `429`, `500`, `502`, `503`, or `504` response or a confirmed request timeout. The model response remains unverified. +On a normal read, `$$nemoclaw headless-agent status` exits nonzero when the sandbox, gateway, local container, or authoritative inference route is not verified, except for a degraded native NVIDIA result. When gateway and sandbox state are verified and probes are not suppressed, its main `Inference` line checks an available selected provider path from inside the sandbox. Shared providers use `https://inference.local/v1/models`, then send an inference request over the same route when that probe reports the route reachable. NVIDIA Endpoints, supported fixed hosted providers, new hosted compatible endpoints outside the Personal tier, and qualified new local selections verify the recorded sandbox-attached OpenShell provider with an inference request. A fresh Personal-tier hosted compatible selection verifies the shared route and has no native attachment. Status repeats inference requests up to three total attempts when they return a transient gateway status; refer to the [CLI commands reference](../reference/commands) for the retried statuses and their token cost. The line reports `healthy` when the route served the request, `unauthorized` when the route rejected it with HTTP `401` or `403`, and `unhealthy` after other final failures. A verified native NVIDIA route instead reports `degraded` and exits `0` after a final HTTP `429`, `500`, `502`, `503`, or `504` response or a confirmed request timeout. The model response remains unverified. + +During an ordinary lifecycle operation, status can instead return a read-only snapshot with `Inference: not probed (another lifecycle operation is in progress)` and exit status `0`; JSON output sets `inferenceProbeSuppressed: true`. This snapshot is not inference or readiness evidence. Wait for the lifecycle operation to finish and rerun status before requiring an unsuppressed `healthy` inference result. diff --git a/docs/inference/set-up-ollama.mdx b/docs/inference/set-up-ollama.mdx index a99a1b00733..12b01e047b4 100644 --- a/docs/inference/set-up-ollama.mdx +++ b/docs/inference/set-up-ollama.mdx @@ -290,7 +290,7 @@ The host-side proxy liveness check treats any HTTP response, including `401`, as The `status` and `doctor` route probe runs inside the sandbox and reports HTTP `200` through `499` as reachable, HTTP `500` through `599` as `unhealthy`, and transport failures or unavailable probes as `unreachable` or `not probed`. `status` then sends an inference request over the reachable route and reports `healthy` when the route served it, or `unauthorized` when the proxy token is no longer accepted. -These checks apply to a normal status read when gateway and sandbox state are verified. If either state is not verified, status reports `Inference: not verified (gateway/sandbox state not verified)` and sends no inference request. If status reports `Inference: not probed (another lifecycle operation is in progress)`, it skipped route and inference probes and JSON output sets `inferenceProbeSuppressed: true` for that unlocked read. Repeat status after the lifecycle operation completes before using it to verify the route or proxy token. +These checks apply to a normal status read when gateway and sandbox state are verified. If either state is not verified, status reports `Inference: not verified (gateway/sandbox state not verified)` and sends no inference request. If status reports `Inference: not probed (another lifecycle operation is in progress)`, it skips provider-health and inference-invocation probes but may still observe the shared route. JSON output sets `inferenceProbeSuppressed: true` for that unlocked read. Repeat status after the lifecycle operation completes before using it to verify the route or proxy token. If Ollama is already bound to a non-loopback address, onboarding restarts it on `127.0.0.1:11434` so the proxy becomes the only network path. diff --git a/docs/inference/verify-inference-route.mdx b/docs/inference/verify-inference-route.mdx index ef48202005b..7f551124c0f 100644 --- a/docs/inference/verify-inference-route.mdx +++ b/docs/inference/verify-inference-route.mdx @@ -34,7 +34,7 @@ Run the named sandbox status command. $$nemoclaw status ``` -The checks below apply to a normal status read when gateway and sandbox state are verified. If either state is not verified, status reports `Inference: not verified (gateway/sandbox state not verified)` and sends no inference request. If status reports `Inference: not probed (another lifecycle operation is in progress)`, it did not verify the route or send an inference request. JSON output sets `inferenceProbeSuppressed: true` for that unlocked read. Repeat status after the lifecycle operation completes before treating its result as inference evidence. +The checks below apply to a normal status read when gateway and sandbox state are verified. If either state is not verified, status reports `Inference: not verified (gateway/sandbox state not verified)` and sends no inference request. If status reports `Inference: not probed (another lifecycle operation is in progress)`, it sends no inference request. For shared-route providers, it may still observe the live route without probing its health. JSON output sets `inferenceProbeSuppressed: true` for that unlocked read. Repeat status after the lifecycle operation completes before treating its result as inference evidence. For NVIDIA Endpoints, the `Inference` row verifies the recorded sandbox attachment. It then sends a native Chat Completions request to `https://integrate.api.nvidia.com/v1`. diff --git a/docs/monitoring/monitor-sandbox-activity.mdx b/docs/monitoring/monitor-sandbox-activity.mdx index a0124561494..f76607b0783 100644 --- a/docs/monitoring/monitor-sandbox-activity.mdx +++ b/docs/monitoring/monitor-sandbox-activity.mdx @@ -27,9 +27,11 @@ Run the status command to view sandbox state, gateway health, and the active inf $$nemoclaw status ``` -`$$nemoclaw status` probes the selected provider path from inside the sandbox as the authoritative inference check. Shared providers use `https://inference.local/v1/models`. NVIDIA Endpoints, supported fixed hosted providers, new hosted compatible endpoints outside the Personal tier, and qualified new local selections verify the recorded sandbox-attached OpenShell provider with an inference request to its native endpoint. A fresh Personal-tier hosted compatible selection verifies the shared route and has no native attachment. +On a normal read with verified gateway and sandbox state, `$$nemoclaw status` checks an available selected provider path from inside the sandbox as the authoritative inference check. Shared providers use `https://inference.local/v1/models`. NVIDIA Endpoints, supported fixed hosted providers, new hosted compatible endpoints outside the Personal tier, and qualified new local selections verify the recorded sandbox-attached OpenShell provider with an inference request to its native endpoint. A fresh Personal-tier hosted compatible selection verifies the shared route and has no native attachment. For local Ollama and local vLLM routes, it also prints labeled host-side backend diagnostics that help identify which hop failed. +During ordinary lifecycle contention, status may return a read-only snapshot with `Inference: not probed (another lifecycle operation is in progress)` and `inferenceProbeSuppressed: true` in JSON. It may still observe a shared route, but it does not verify inference health. Wait for the lifecycle operation to finish and rerun status before using the result as inference evidence. + Review these output fields. - Sandbox details show the configured model, provider, GPU mode, and applied policy presets. From 38ca76094f91608863bf8ed3b54f843c0bacf3f7 Mon Sep 17 00:00:00 2001 From: Rebecca Sliter Date: Tue, 27 Oct 2026 04:31:55 -0700 Subject: [PATCH 16/17] fix(status): distinguish ordinary Hermes from Portable authority Signed-off-by: Rebecca Sliter <571084+rsliter@users.noreply.github.com> --- docs/deployment/deploy-to-headless-server.mdx | 2 +- docs/monitoring/monitor-sandbox-activity.mdx | 2 +- .../sandbox/oclif-command-adapters.test.ts | 67 +++++++++++++++++++ src/lib/cli/nemoclaw-oclif-command.test.ts | 17 +++-- src/lib/cli/nemoclaw-oclif-command.ts | 6 +- 5 files changed, 80 insertions(+), 14 deletions(-) diff --git a/docs/deployment/deploy-to-headless-server.mdx b/docs/deployment/deploy-to-headless-server.mdx index e2b8678850b..a8c7c0ed404 100644 --- a/docs/deployment/deploy-to-headless-server.mdx +++ b/docs/deployment/deploy-to-headless-server.mdx @@ -208,7 +208,7 @@ $$nemoclaw headless-agent connect --probe-only On a normal read, `$$nemoclaw headless-agent status` exits nonzero when the sandbox, gateway, local container, or authoritative inference route is not verified, except for a degraded native NVIDIA result. When gateway and sandbox state are verified and probes are not suppressed, its main `Inference` line checks an available selected provider path from inside the sandbox. Shared providers use `https://inference.local/v1/models`, then send an inference request over the same route when that probe reports the route reachable. NVIDIA Endpoints, supported fixed hosted providers, new hosted compatible endpoints outside the Personal tier, and qualified new local selections verify the recorded sandbox-attached OpenShell provider with an inference request. A fresh Personal-tier hosted compatible selection verifies the shared route and has no native attachment. Status repeats inference requests up to three total attempts when they return a transient gateway status; refer to the [CLI commands reference](../reference/commands) for the retried statuses and their token cost. The line reports `healthy` when the route served the request, `unauthorized` when the route rejected it with HTTP `401` or `403`, and `unhealthy` after other final failures. A verified native NVIDIA route instead reports `degraded` and exits `0` after a final HTTP `429`, `500`, `502`, `503`, or `504` response or a confirmed request timeout. The model response remains unverified. -During an ordinary lifecycle operation, status can instead return a read-only snapshot with `Inference: not probed (another lifecycle operation is in progress)` and exit status `0`; JSON output sets `inferenceProbeSuppressed: true`. This snapshot is not inference or readiness evidence. Wait for the lifecycle operation to finish and rerun status before requiring an unsuppressed `healthy` inference result. +During an ordinary lifecycle operation, status can return a read-only snapshot only when receipt and registry checks confirm that no Portable authority exists before and after the read. The snapshot shows `Inference: not probed (another lifecycle operation is in progress)` and exits `0`; JSON output sets `inferenceProbeSuppressed: true`. If Portable authority exists, cannot be checked, or appears during the read, status rejects the snapshot and reports lifecycle contention. A snapshot is not inference or readiness evidence. Wait for the lifecycle operation to finish and rerun status before requiring an unsuppressed `healthy` inference result. diff --git a/docs/monitoring/monitor-sandbox-activity.mdx b/docs/monitoring/monitor-sandbox-activity.mdx index f76607b0783..e42083763f9 100644 --- a/docs/monitoring/monitor-sandbox-activity.mdx +++ b/docs/monitoring/monitor-sandbox-activity.mdx @@ -30,7 +30,7 @@ $$nemoclaw status On a normal read with verified gateway and sandbox state, `$$nemoclaw status` checks an available selected provider path from inside the sandbox as the authoritative inference check. Shared providers use `https://inference.local/v1/models`. NVIDIA Endpoints, supported fixed hosted providers, new hosted compatible endpoints outside the Personal tier, and qualified new local selections verify the recorded sandbox-attached OpenShell provider with an inference request to its native endpoint. A fresh Personal-tier hosted compatible selection verifies the shared route and has no native attachment. For local Ollama and local vLLM routes, it also prints labeled host-side backend diagnostics that help identify which hop failed. -During ordinary lifecycle contention, status may return a read-only snapshot with `Inference: not probed (another lifecycle operation is in progress)` and `inferenceProbeSuppressed: true` in JSON. It may still observe a shared route, but it does not verify inference health. Wait for the lifecycle operation to finish and rerun status before using the result as inference evidence. +During ordinary lifecycle contention, status may return a read-only snapshot only when receipt and registry checks confirm that no Portable authority exists before and after the read. The snapshot shows `Inference: not probed (another lifecycle operation is in progress)` and `inferenceProbeSuppressed: true` in JSON. If Portable authority exists, cannot be checked, or appears during the read, status rejects the snapshot and reports lifecycle contention. A snapshot may still observe a shared route, but it does not verify inference health. Wait for the lifecycle operation to finish and rerun status before using the result as inference evidence. Review these output fields. diff --git a/src/commands/sandbox/oclif-command-adapters.test.ts b/src/commands/sandbox/oclif-command-adapters.test.ts index b418b871b91..9cd5f4cacab 100644 --- a/src/commands/sandbox/oclif-command-adapters.test.ts +++ b/src/commands/sandbox/oclif-command-adapters.test.ts @@ -8,7 +8,10 @@ import path from "node:path"; import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; import * as portableAgentLifecycle from "../../lib/onboard/experimental/portable-agent-lifecycle"; import * as receiptAuthority from "../../lib/onboard/experimental/hermes-portable-receipt"; +import { isUnlockedSandboxStatusRead } from "../../lib/actions/sandbox/status-snapshot"; import { isMcpLifecycleLockHeld } from "../../lib/state/mcp-lifecycle-lock-acquisition"; +import { portableHostFencePath } from "../../lib/state/portable-uninstall-retirement"; +import { acquireProcessBoundLockAt, releaseProcessBoundLock } from "../../lib/state/registry/lock"; const mocks = vi.hoisted(() => { class SandboxConfigError extends Error { @@ -272,6 +275,70 @@ describe("sandbox oclif command adapters", () => { expect(process.exitCode).toBe(1); }); + it("routes real text status through the unlocked read during ordinary host contention (#11903)", async () => { + vi.stubEnv("HOME", stateDir); + vi.stubEnv("NEMOCLAW_TEST_BASE_HOME", stateDir); + const output: string[] = []; + vi.spyOn(console, "log").mockImplementation((...parts: unknown[]) => { + output.push(parts.map(String).join(" ")); + }); + mocks.showSandboxStatus.mockImplementationOnce(async (name: string) => { + expect(name).toBe("alpha"); + expect(isUnlockedSandboxStatusRead()).toBe(true); + expect(isMcpLifecycleLockHeld(name)).toBe(false); + console.log("Inference: not probed (another lifecycle operation is in progress)"); + }); + const fence = acquireProcessBoundLockAt(portableHostFencePath(stateDir)); + try { + await SandboxStatusCommand.run(["alpha"], rootDir); + } finally { + releaseProcessBoundLock(fence); + } + + expect(mocks.showSandboxStatus).toHaveBeenCalledWith("alpha"); + expect(output.join("\n")).toContain( + "Inference: not probed (another lifecycle operation is in progress)", + ); + }); + + it("routes real JSON status through the unlocked read during ordinary host contention (#11903)", async () => { + vi.stubEnv("HOME", stateDir); + vi.stubEnv("NEMOCLAW_TEST_BASE_HOME", stateDir); + const output: string[] = []; + vi.spyOn(console, "log").mockImplementation((...parts: unknown[]) => { + output.push(parts.map(String).join(" ")); + }); + vi.spyOn(process.stdout, "write").mockImplementation((chunk) => { + output.push(String(chunk)); + return true; + }); + mocks.getSandboxStatusReport.mockImplementationOnce(async (name: string) => { + expect(name).toBe("alpha"); + expect(isUnlockedSandboxStatusRead()).toBe(true); + expect(isMcpLifecycleLockHeld(name)).toBe(false); + return { + schemaVersion: 1, + name, + found: true, + gatewayState: "present", + inferenceProbeSuppressed: true, + }; + }); + const fence = acquireProcessBoundLockAt(portableHostFencePath(stateDir)); + try { + await SandboxStatusCommand.run(["alpha", "--json"], rootDir); + } finally { + releaseProcessBoundLock(fence); + } + + expect(mocks.getSandboxStatusReport).toHaveBeenCalledWith("alpha"); + expect(JSON.parse(output.join("\n"))).toMatchObject({ + schemaVersion: 1, + name: "alpha", + inferenceProbeSuppressed: true, + }); + }); + it("keeps policy list pending until the asynchronous action completes", async () => { let finish!: () => void; mocks.listSandboxPolicies.mockImplementationOnce( diff --git a/src/lib/cli/nemoclaw-oclif-command.test.ts b/src/lib/cli/nemoclaw-oclif-command.test.ts index d896677f079..0cb3b0394c0 100644 --- a/src/lib/cli/nemoclaw-oclif-command.test.ts +++ b/src/lib/cli/nemoclaw-oclif-command.test.ts @@ -366,7 +366,7 @@ describe("NemoClawCommand", () => { expect(portableHostAuthority.withCurrentPortableHostFenceTry).toHaveBeenCalledOnce(); }); - it("fails closed on registry-only Hermes Portable authority for another sandbox (#11903)", async () => { + it("permits unlocked status with an ordinary Docker Hermes lifecycle generation (#11903)", async () => { vi.spyOn(portableHostAuthority, "withCurrentPortableHostFenceTry").mockRejectedValue( new Error(portableHostAuthority.PORTABLE_HOST_FENCE_BUSY_MESSAGE), ); @@ -378,16 +378,18 @@ describe("NemoClawCommand", () => { lifecycleGeneration: "generation-1", } as never, ]); - const operation = vi.fn(async () => undefined); + const operation = vi.fn(async () => { + expect(isUnlockedSandboxStatusRead()).toBe(true); + }); ParsedSupportedSandboxCommand.operation = operation; - await expect(ParsedSupportedSandboxCommand.run(["alpha"], process.cwd())).rejects.toThrow( - "Another NemoClaw lifecycle operation is in progress on this host.", - ); - expect(operation).not.toHaveBeenCalled(); + await expect( + ParsedSupportedSandboxCommand.run(["alpha"], process.cwd()), + ).resolves.toBeUndefined(); + expect(operation).toHaveBeenCalledOnce(); }); - it("rejects an unlocked status read when Hermes Portable registry authority appears during it (#11903)", async () => { + it("rejects an unlocked status read when Hermes Portable profile appears during it (#11903)", async () => { const fence = acquireProcessBoundLockAt(portableHostAuthority.portableHostFencePath(stateDir)); let registryReads = 0; vi.spyOn(registryCrossPort, "listInferenceRouteOwnersAcrossGatewayRoots").mockImplementation( @@ -401,6 +403,7 @@ describe("NemoClawCommand", () => { agent: "hermes", openshellDriver: "docker", lifecycleGeneration: "generation-1", + portableLifecycleProfile: "hermes", } as never, ]; }, diff --git a/src/lib/cli/nemoclaw-oclif-command.ts b/src/lib/cli/nemoclaw-oclif-command.ts index c78b3bedd80..24618f4144c 100644 --- a/src/lib/cli/nemoclaw-oclif-command.ts +++ b/src/lib/cli/nemoclaw-oclif-command.ts @@ -94,11 +94,7 @@ const REMOVED_IMMUTABILITY_REMEDIATION_COMMANDS = new Set([ function hasPortableRegistryAuthorityOnHost(): boolean { return listInferenceRouteOwnersAcrossGatewayRoots(process.env.HOME || os.homedir()).some( - (entry) => - entry.portableLifecycleProfile !== undefined || - (entry.agent === "hermes" && - entry.openshellDriver === "docker" && - typeof entry.lifecycleGeneration === "string"), + (entry) => entry.portableLifecycleProfile !== undefined, ); } From c6b53f14fa735870ef5c43a17ea52f3e8a578368 Mon Sep 17 00:00:00 2001 From: Rebecca Sliter Date: Tue, 27 Oct 2026 05:00:19 -0700 Subject: [PATCH 17/17] fix(status): clarify snapshot exits and routing evidence Signed-off-by: Rebecca Sliter <571084+rsliter@users.noreply.github.com> --- docs/deployment/deploy-to-headless-server.mdx | 2 +- .../sandbox/oclif-command-adapters.test.ts | 25 ++----------------- 2 files changed, 3 insertions(+), 24 deletions(-) diff --git a/docs/deployment/deploy-to-headless-server.mdx b/docs/deployment/deploy-to-headless-server.mdx index a8c7c0ed404..88f45439e1d 100644 --- a/docs/deployment/deploy-to-headless-server.mdx +++ b/docs/deployment/deploy-to-headless-server.mdx @@ -208,7 +208,7 @@ $$nemoclaw headless-agent connect --probe-only On a normal read, `$$nemoclaw headless-agent status` exits nonzero when the sandbox, gateway, local container, or authoritative inference route is not verified, except for a degraded native NVIDIA result. When gateway and sandbox state are verified and probes are not suppressed, its main `Inference` line checks an available selected provider path from inside the sandbox. Shared providers use `https://inference.local/v1/models`, then send an inference request over the same route when that probe reports the route reachable. NVIDIA Endpoints, supported fixed hosted providers, new hosted compatible endpoints outside the Personal tier, and qualified new local selections verify the recorded sandbox-attached OpenShell provider with an inference request. A fresh Personal-tier hosted compatible selection verifies the shared route and has no native attachment. Status repeats inference requests up to three total attempts when they return a transient gateway status; refer to the [CLI commands reference](../reference/commands) for the retried statuses and their token cost. The line reports `healthy` when the route served the request, `unauthorized` when the route rejected it with HTTP `401` or `403`, and `unhealthy` after other final failures. A verified native NVIDIA route instead reports `degraded` and exits `0` after a final HTTP `429`, `500`, `502`, `503`, or `504` response or a confirmed request timeout. The model response remains unverified. -During an ordinary lifecycle operation, status can return a read-only snapshot only when receipt and registry checks confirm that no Portable authority exists before and after the read. The snapshot shows `Inference: not probed (another lifecycle operation is in progress)` and exits `0`; JSON output sets `inferenceProbeSuppressed: true`. If Portable authority exists, cannot be checked, or appears during the read, status rejects the snapshot and reports lifecycle contention. A snapshot is not inference or readiness evidence. Wait for the lifecycle operation to finish and rerun status before requiring an unsuppressed `healthy` inference result. +During an ordinary lifecycle operation, status can return a read-only snapshot only when receipt and registry checks confirm that no Portable authority exists before and after the read. The snapshot shows `Inference: not probed (another lifecycle operation is in progress)`; JSON output sets `inferenceProbeSuppressed: true`. The exit status still reflects the observed sandbox and gateway state and may be nonzero. If Portable authority exists, cannot be checked, or appears during the read, status rejects the snapshot and reports lifecycle contention. A snapshot is not inference or readiness evidence. Wait for the lifecycle operation to finish and rerun status before requiring an unsuppressed `healthy` inference result. diff --git a/src/commands/sandbox/oclif-command-adapters.test.ts b/src/commands/sandbox/oclif-command-adapters.test.ts index 9cd5f4cacab..b561c89d1d6 100644 --- a/src/commands/sandbox/oclif-command-adapters.test.ts +++ b/src/commands/sandbox/oclif-command-adapters.test.ts @@ -275,18 +275,13 @@ describe("sandbox oclif command adapters", () => { expect(process.exitCode).toBe(1); }); - it("routes real text status through the unlocked read during ordinary host contention (#11903)", async () => { + it("routes the text status command through the unlocked read during ordinary host contention (#11903)", async () => { vi.stubEnv("HOME", stateDir); vi.stubEnv("NEMOCLAW_TEST_BASE_HOME", stateDir); - const output: string[] = []; - vi.spyOn(console, "log").mockImplementation((...parts: unknown[]) => { - output.push(parts.map(String).join(" ")); - }); mocks.showSandboxStatus.mockImplementationOnce(async (name: string) => { expect(name).toBe("alpha"); expect(isUnlockedSandboxStatusRead()).toBe(true); expect(isMcpLifecycleLockHeld(name)).toBe(false); - console.log("Inference: not probed (another lifecycle operation is in progress)"); }); const fence = acquireProcessBoundLockAt(portableHostFencePath(stateDir)); try { @@ -296,22 +291,11 @@ describe("sandbox oclif command adapters", () => { } expect(mocks.showSandboxStatus).toHaveBeenCalledWith("alpha"); - expect(output.join("\n")).toContain( - "Inference: not probed (another lifecycle operation is in progress)", - ); }); - it("routes real JSON status through the unlocked read during ordinary host contention (#11903)", async () => { + it("routes the JSON status command through the unlocked read during ordinary host contention (#11903)", async () => { vi.stubEnv("HOME", stateDir); vi.stubEnv("NEMOCLAW_TEST_BASE_HOME", stateDir); - const output: string[] = []; - vi.spyOn(console, "log").mockImplementation((...parts: unknown[]) => { - output.push(parts.map(String).join(" ")); - }); - vi.spyOn(process.stdout, "write").mockImplementation((chunk) => { - output.push(String(chunk)); - return true; - }); mocks.getSandboxStatusReport.mockImplementationOnce(async (name: string) => { expect(name).toBe("alpha"); expect(isUnlockedSandboxStatusRead()).toBe(true); @@ -332,11 +316,6 @@ describe("sandbox oclif command adapters", () => { } expect(mocks.getSandboxStatusReport).toHaveBeenCalledWith("alpha"); - expect(JSON.parse(output.join("\n"))).toMatchObject({ - schemaVersion: 1, - name: "alpha", - inferenceProbeSuppressed: true, - }); }); it("keeps policy list pending until the asynchronous action completes", async () => {