Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/reference/commands.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ The host observes through any same-device pending state and verifies the final s

</AgentOnly>

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`.
Before the configuration review, NemoClaw records the sandbox name and the selected provider and model as an incomplete choice. For a custom endpoint, the choice also includes the endpoint URL, the API family, and the name of the credential environment variable, but not the credential value. If onboarding stops at the review prompt, an interactive `--resume` run shows the prompt again. A custom-endpoint choice recorded by an earlier NemoClaw release has no endpoint URL or API family. An interactive `--resume` run asks you to choose the provider and model again. A non-interactive `--resume` run stops with an incomplete custom-route error. In that case, run `$$nemoclaw onboard --fresh` and make the selection again. No sandbox exists yet at this point, so you do not need to remove one. 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`.

<AgentOnly variant="openclaw">

Expand Down
3 changes: 3 additions & 0 deletions src/lib/onboard/machine/handlers/provider-inference.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ describe("handleProviderInferenceState", () => {
expect(calls.startStep).toHaveBeenNthCalledWith(2, "provider_selection", {
provider: "nvidia-prod",
model: "nvidia/test",
endpointUrl: "https://integrate.api.nvidia.com/v1",
credentialEnv: "NVIDIA_INFERENCE_API_KEY",
preferredInferenceApi: "openai-responses",
});
expect(calls.startStep).toHaveBeenNthCalledWith(3, "inference", {
provider: "nvidia-prod",
Expand Down
39 changes: 38 additions & 1 deletion src/lib/onboard/machine/handlers/provider-inference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
type CurrentGatewayRouteCompatibilityCheck,
type CurrentGatewayRouteDiscoveryPreflight,
type GatewayRouteDiscoveryConstraints,
gatewayRouteIdentityConflictReasons,
isAdvisoryGatewayRouteConflict,
} from "../../../inference/gateway-route-compatibility";
import { withModelRouterPortLifecycleLock } from "../../../inference/gateway-route-mutation-lock";
Expand Down Expand Up @@ -275,7 +276,13 @@ export interface ProviderInferenceStateOptions<Gpu, Agent, Host> {
) => Promise<boolean>;
startRecordedStep(
stepName: string,
updates?: { provider?: string | null; model?: string | null },
updates?: {
provider?: string | null;
model?: string | null;
endpointUrl?: string | null;
credentialEnv?: string | null;
preferredInferenceApi?: string | null;
},
): Promise<void>;
recordStepComplete(stepName: string, updates: SessionUpdates): Promise<Session>;
recordStepRejected(stepName: string): Promise<Session>;
Expand Down Expand Up @@ -1089,6 +1096,18 @@ function reviewRecoveryState(session: Session | null, sandboxName: string | null
);
}

function hasIncompleteCustomRoute(session: Session | null): boolean {
if (!session) return false;
const route = {
provider: session.provider,
model: session.model,
endpointUrl: session.endpointUrl,
credentialEnv: session.credentialEnv,
preferredInferenceApi: session.preferredInferenceApi,
};
return gatewayRouteIdentityConflictReasons(route, route).includes("incomplete-custom-route");
}

function canResumeProviderSelection(
forceProviderSelection: boolean,
effectiveResume: boolean,
Expand All @@ -1097,6 +1116,7 @@ function canResumeProviderSelection(
interruptedReview: boolean,
provider: string | null,
model: string | null,
interactive: boolean,
): boolean {
// An interrupted Station review has a provider/model but no validated model
// identity yet. Retry selection so its checkpoint can bind that identity.
Expand All @@ -1107,6 +1127,12 @@ function canResumeProviderSelection(
) {
return false;
}
// Review checkpoints from earlier releases kept only provider and model, so
// a custom route cannot pass the gateway check. Ask again interactively;
// non-interactive resume keeps failing closed at that check.
if (interactive && interruptedReview && hasIncompleteCustomRoute(session)) {
return false;
}
return (
!forceProviderSelection &&
effectiveResume &&
Expand Down Expand Up @@ -1242,7 +1268,9 @@ interface ConfigurationReviewInput<Agent> {
agent: Agent;
provider: string;
model: string;
endpointUrl: string | null;
credentialEnv: string | null;
preferredInferenceApi: string | null;
hermesAuthMethod: HermesAuthMethod | null;
webSearchConfig: WebSearchConfig | null;
hermesToolGateways: string[];
Expand Down Expand Up @@ -1281,9 +1309,14 @@ async function reviewProviderConfiguration<Agent>(
// claiming that provider registration or inference setup completed.
await deps.checkpointSandboxIdentity(sandboxName, input.agent);
if (needsSelectionRecovery && !selectionRecoveryStarted) {
// Resume checks this route against the shared gateway route before it
// shows the review again, so keep the same secret-free route identity.
await deps.startRecordedStep("provider_selection", {
provider: input.provider,
model: input.model,
endpointUrl: input.endpointUrl,
credentialEnv: input.credentialEnv,
preferredInferenceApi: input.preferredInferenceApi,
});
selectionRecoveryStarted = true;
}
Expand Down Expand Up @@ -1548,6 +1581,7 @@ export async function handleProviderInferenceState<Gpu, Agent, Host>({
reviewRecoveryState(session, sandboxName),
provider,
model,
!deps.isNonInteractive(),
);
const initialHostLocalPolicyRoute = resolveInitialHostLocalPolicyRoute({
resumeProviderSelection: initialResumeProviderSelection,
Expand Down Expand Up @@ -1598,6 +1632,7 @@ export async function handleProviderInferenceState<Gpu, Agent, Host>({
completeRecoveredReviewSelectionAfterInference,
provider,
model,
!deps.isNonInteractive(),
);
const earlyManagedHostLocalLifecycleSelection = resolveEarlyManagedHostLocalLifecycleSelection({
resumeProviderSelection,
Expand Down Expand Up @@ -2284,7 +2319,9 @@ export async function handleProviderInferenceState<Gpu, Agent, Host>({
agent,
provider,
model,
endpointUrl,
credentialEnv,
preferredInferenceApi,
hermesAuthMethod,
webSearchConfig,
hermesToolGateways,
Expand Down
Loading
Loading