Skip to content

fix(inference): preserve onboard endpoint provenance - #7242

Merged
ericksoa merged 8 commits into
mainfrom
fix/inference-endpoint-provenance-6321
Jul 20, 2026
Merged

fix(inference): preserve onboard endpoint provenance#7242
ericksoa merged 8 commits into
mainfrom
fix/inference-endpoint-provenance-6321

Conversation

@ericksoa

@ericksoa ericksoa commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Preserves the trust origin of custom inference endpoints so an exact endpoint accepted during onboarding can be re-applied after its DNS changes to an internal address. Endpoints created by inference set, legacy records without provenance, and mismatched URLs remain on the full SSRF/DNS-pinning path.

Related Issue

Fixes #6321.

Changes

  • Persist onboard versus inference-set endpoint provenance in sandbox registry routes and fail closed when the source is absent or invalid.
  • Carry validated onboarding provenance through sandbox recreation and the one-shot rebuild route handoff without treating ordinary endpoint equality as authority.
  • Allow only a canonical exact match to the onboarding-provenanced endpoint to bypass DNS re-resolution; all other supplied URLs retain existing SSRF protections.
  • Add regression coverage for OpenAI-compatible and Anthropic-compatible routes, legacy/mismatched/inference-set records, rebuild recovery, and registry normalization; update endpoint security and command docs.

Type of Change

  • Code change (feature, bug fix, or refactor)
  • Code change with doc updates
  • Doc only (prose changes, no code sample modifications)
  • Doc only (includes code sample changes)

Quality Gates

  • Tests added or updated for changed behavior
  • Existing tests cover changed behavior — justification:
  • Tests not applicable — justification:
  • Docs updated for user-facing behavior changes
  • Docs not applicable — justification:
  • Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging)
  • Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: pending maintainer review
  • Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue:

Verification

  • PR description includes a Signed-off-by: line and every commit appears as Verified in GitHub
  • Normal pre-commit, commit-msg, and pre-push hooks passed, or npm run check:diff passed when hooks were skipped or unavailable
  • Targeted behavior tests pass for the current change set, or tests are marked not applicable above — npx vitest run on 15 affected files: 213 passed
  • Applicable broad gate passed — npm test for broad runtime/test-harness changes; npm run check for repo-wide validation/coverage changes — npm test was attempted on the exact base; the long macOS integration run reproduced unrelated timing/environment failures before being stopped, while all affected tests pass independently
  • Quality Gates section completed with required justifications or waivers
  • No secrets, API keys, or credentials committed
  • npm run docs builds without warnings (doc changes only)
  • Doc pages follow the style guide (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only)

AI Disclosure

  • AI-assisted — tool: Codex

Signed-off-by: Aaron Erickson aerickson@nvidia.com

Summary by CodeRabbit

  • New Features
    • Added end-to-end tracking of inference endpoint provenance (“onboard” vs “inference-set”) across onboarding, rebuilds, recovery, and resume flows, including persisted and recovered route metadata.
  • Bug Fixes
    • Improved URL validation for runtime model changes: when onboarding provenance is recorded and the canonical endpoint URL matches exactly, the system reuses the onboard URL; otherwise strict DNS/SSRF checks remain enforced.
  • Documentation
    • Clarified canonical URL handling and provenance-aware behavior in inference and command docs.
  • Tests
    • Expanded and updated provenance-specific acceptance/rejection and payload assertions.

Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The change records inference endpoint provenance as onboard or inference-set, propagates it through onboarding, registry, rebuild, and recovery flows, and allows exact canonical onboard endpoint reuse during inference set while retaining SSRF validation for other endpoints.

Changes

Inference endpoint provenance

Layer / File(s) Summary
Provenance contracts and persistence
src/lib/inference/selection.ts, src/lib/state/registry.ts, src/lib/onboard/provider-recovery.ts, src/lib/onboard/rebuild-route-handoff.ts, src/lib/actions/sandbox/*, src/lib/onboard/types.ts
Adds normalized endpointSource metadata and persists it across inference selections, registry routes, rebuild options, recovery records, and route handoffs.
Onboarding provenance propagation
src/lib/onboard.ts, src/lib/onboard/machine/..., src/lib/onboard/sandbox-registration.ts, src/lib/onboard/setup-*.ts, test/onboard-*
Passes endpoint provenance through provider selection, sandbox creation, inference setup, authoritative rebuilds, and route reservations.
Inference-set endpoint validation
src/lib/actions/inference-set*.ts, docs/inference/*, docs/reference/commands.mdx
Reuses an exact canonical onboard endpoint without DNS revalidation; missing, differing, and inference-set endpoints continue through SSRF validation.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant OnboardFlow
  participant ProviderInference
  participant SetupInference
  participant Registry
  OnboardFlow->>ProviderInference: pass endpointSource
  ProviderInference->>SetupInference: pass endpointSource and onboardEndpointUrl
  SetupInference->>Registry: reserve route with endpointSource
Loading
sequenceDiagram
  participant InferenceSet
  participant FinalizeInferenceSetRoute
  participant SSRFValidator
  participant Registry
  InferenceSet->>FinalizeInferenceSetRoute: provide recorded onboard endpoint
  alt exact canonical onboard match
    FinalizeInferenceSetRoute->>Registry: record endpointSource onboard
  else other or missing provenance
    FinalizeInferenceSetRoute->>SSRFValidator: normalize and validate endpoint
    SSRFValidator->>Registry: record endpointSource inference-set
  end
Loading

Possibly related PRs

  • NVIDIA/NemoClaw#6338: Both changes modify the inference-set route-containment pipeline and endpoint validation behavior.

Suggested labels: area: docs, area: inference, area: sandbox, needs: review, bug

Suggested reviewers: cv, laitingsheng

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 15.38% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and matches the PR’s main change: preserving onboard endpoint provenance.
Linked Issues check ✅ Passed The changes preserve onboarding provenance, keep SSRF/DNS checks for non-onboard routes, and add regression coverage for runtime route switching.
Out of Scope Changes check ✅ Passed All modified files relate to endpoint provenance, route handoff, docs, or tests; no unrelated changes stand out.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/inference-endpoint-provenance-6321

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

@github-code-quality

github-code-quality Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in commit 55d82a5 in the fix/inference-endpoi... branch remains at 96%, unchanged from commit 5b547cd in the main branch.

TypeScript / code-coverage/cli

The overall coverage in commit 55d82a5 in the fix/inference-endpoi... branch remains at 80%, unchanged from commit 5b547cd in the main branch.

Show a code coverage summary of the most impacted files.
File main 5b547cd fix/inference-endpoi... 55d82a5 +/-
src/lib/onboard...-flow-phases.ts 100% 83% -17%
src/lib/onboard...der-recovery.ts 94% 91% -3%
src/lib/onboard.ts 31% 31% 0%
src/lib/state/registry.ts 86% 86% 0%
src/lib/onboard...up-inference.ts 97% 98% +1%
src/lib/onboard...er-inference.ts 94% 95% +1%
src/lib/platform.ts 84% 89% +5%
src/lib/inferen...er-lifecycle.ts 65% 71% +6%
src/lib/onboard...registration.ts 70% 80% +10%
src/lib/inferen...lama/process.ts 50% 100% +50%

Updated July 20, 2026 16:48 UTC

Signed-off-by: Aaron Erickson <aerickson@nvidia.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/lib/onboard/setup-inference.ts (1)

324-328: 🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift

Preserve the original endpoint provenance during recreation.

createSetupInference is also used by test/onboard-remote-recreate-credential-reuse.test.ts, where the recorded source distinguishes onboarding routes from inference-set routes. Hard-coding "onboard" here can upgrade an inference-set or legacy route during recreation; later endpoint changes may then incorrectly receive the onboarding-only SSRF/DNS-pinning bypass.

Thread the recorded source through the setup options and persist it here, using "onboard" only for fresh onboarding. Add a recreation regression test for an inference-set route.

As per path instructions, src/** migrations must trace fresh, resumed, retry, rebuild, persisted-state, and test paths while retaining one authoritative path.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/lib/onboard/setup-inference.ts` around lines 324 - 328, Update
createSetupInference to carry the recorded endpoint source through setup options
and persist it in the updateSandbox payload, defaulting to onboarding only for
fresh onboarding. Preserve the source across fresh, resumed, retry, rebuild,
persisted-state, and test paths through one authoritative flow. Add a regression
test covering recreation of an inference-set route and preventing it from being
converted to onboard.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/reference/commands.mdx`:
- Around line 2948-2949: Update the same-provider model change guidance to
explicitly instruct users to pass the accepted URL via --endpoint-url, and state
that it must exactly match the canonical endpoint URL identified by the target
sandbox registry rather than merely being an equivalent URL.

In `@src/lib/onboard/machine/handlers/provider-inference.ts`:
- Line 358: Preserve trusted endpoint provenance during resume inference: in
src/lib/onboard/machine/handlers/provider-inference.ts lines 358-358, initialize
endpointSource from the persisted or authoritative route instead of null; in
src/lib/onboard/machine/core-flow-phases.ts lines 132-132, pass that provenance
into the provider-inference phase as well as the sandbox phase so refreshed
inference retains onboardEndpointUrl.

In `@src/lib/onboard/machine/handlers/sandbox.ts`:
- Around line 351-356: Preserve endpoint provenance across non-authoritative
resume/recreate flows: update endpointSourceForCreateIntent in sandbox.ts to
default to "onboard" only for fresh onboarding, otherwise retain the existing or
recovered source, including null/unknown values. In onboard.ts, replace the
hardcoded "onboard" argument in the ordinary resume/recreate path with the
persisted or recovered provenance; apply the corresponding change at
src/lib/onboard/machine/handlers/sandbox.ts:351-356 and
src/lib/onboard.ts:4431-4432.

---

Outside diff comments:
In `@src/lib/onboard/setup-inference.ts`:
- Around line 324-328: Update createSetupInference to carry the recorded
endpoint source through setup options and persist it in the updateSandbox
payload, defaulting to onboarding only for fresh onboarding. Preserve the source
across fresh, resumed, retry, rebuild, persisted-state, and test paths through
one authoritative flow. Add a regression test covering recreation of an
inference-set route and preventing it from being converted to onboard.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: ca0237ac-094f-44d9-9c5f-615d9d464fc4

📥 Commits

Reviewing files that changed from the base of the PR and between a5ccdca and 783d929.

📒 Files selected for processing (33)
  • docs/inference/custom-endpoint-security.mdx
  • docs/inference/switch-models.mdx
  • docs/reference/commands.mdx
  • src/lib/actions/inference-set-gateway-route-containment.test.ts
  • src/lib/actions/inference-set-provider-alias.test.ts
  • src/lib/actions/inference-set-route-containment.ts
  • src/lib/actions/inference-set.ts
  • src/lib/actions/sandbox/rebuild-gpu-opt-out.test.ts
  • src/lib/actions/sandbox/rebuild-gpu-opt-out.ts
  • src/lib/actions/sandbox/rebuild-resume-preflight.ts
  • src/lib/inference/selection.test.ts
  • src/lib/inference/selection.ts
  • src/lib/onboard.ts
  • src/lib/onboard/machine/core-flow-phases.ts
  • src/lib/onboard/machine/handlers/provider-inference.ts
  • src/lib/onboard/machine/handlers/sandbox-dcode-selection.test.ts
  • src/lib/onboard/machine/handlers/sandbox-tool-disclosure.test.ts
  • src/lib/onboard/machine/handlers/sandbox.test.ts
  • src/lib/onboard/machine/handlers/sandbox.ts
  • src/lib/onboard/provider-recovery.ts
  • src/lib/onboard/rebuild-route-handoff.test.ts
  • src/lib/onboard/rebuild-route-handoff.ts
  • src/lib/onboard/sandbox-registration.test.ts
  • src/lib/onboard/sandbox-registration.ts
  • src/lib/onboard/setup-inference-route-containment.test.ts
  • src/lib/onboard/setup-inference.ts
  • src/lib/onboard/setup-nim-flow.ts
  • src/lib/onboard/types.ts
  • src/lib/state/registry.ts
  • test/onboard-inference-failure-paths.test.ts
  • test/onboard-inference-gateway-scope.test.ts
  • test/onboard-inference-reconciliation.test.ts
  • test/onboard-remote-recreate-credential-reuse.test.ts

Comment thread docs/reference/commands.mdx Outdated
Comment thread src/lib/onboard/machine/handlers/provider-inference.ts Outdated
Comment thread src/lib/onboard/machine/handlers/sandbox.ts
@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — Informational

Advisor assessment: Informational / high confidence
Next action: No advisor follow-up needed.
Findings: 0 blockers · 0 warnings · 0 suggestions
Status: No actionable findings remain in the canonical review ledger.

Model lanes

  • GPT-5.6 Terra (primary): Completed · high confidence · 0 blockers · 0 warnings · 0 suggestions
  • Nemotron 3 Ultra (second opinion): Completed · high confidence · 0 blockers · 4 warnings · 0 suggestions
  • Model comparison: normalized findings differ; normalized E2E selections differ; Nemotron reported the same number of blockers, 4 more warnings, the same number of suggestions.

Nemotron output stays in workflow artifacts and does not change the assessment above.

Since last review: 0 prior items resolved · 0 still apply · 0 new items found

E2E guidance

Advisory only. E2E / PR Gate selects and runs jobs independently.

Recommended E2E: cloud-onboard, inference-routing, network-policy, onboard-repair, onboard-resume, state-backup-restore, upgrade-stale-sandbox

3 optional E2E recommendations
  • openclaw-inference-switch
  • hermes-inference-switch
  • messaging-compatible-endpoint

Workflow run details

This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge.

Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
@ericksoa

Copy link
Copy Markdown
Contributor Author

Addressed all CodeRabbit findings in a31ab1ea2:

  • documented the exact --endpoint-url invocation;
  • preserved normalized provenance through provider inference and sandbox recreation;
  • made only fresh onboarding default to onboard, leaving legacy/unknown provenance fail-closed;
  • removed the out-of-diff hard-coded onboard route reservation and added regression coverage preserving inference-set during recreation.

Validation: 22 focused/changed test files (339 tests), typecheck, all-files prek, and commit/push hooks passed.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/lib/onboard/machine/core-flow-phases.ts`:
- Around line 69-79: Update endpointSourceForPhase in
src/lib/onboard/machine/core-flow-phases.ts:69-79 to carry the persisted
canonical endpoint with its source and return "onboard" only when that endpoint
exactly matches the current provider endpoint. In
src/lib/onboard/machine/handlers/provider-inference.ts:638-641 and :832-833,
assign onboardEndpointUrl only after this exact-match validation in both resume
and non-resume setup flows.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 07655b29-ba75-4e37-b736-da5b001de037

📥 Commits

Reviewing files that changed from the base of the PR and between 9bed169 and a31ab1e.

📒 Files selected for processing (18)
  • docs/reference/commands.mdx
  • src/lib/actions/sandbox/rebuild-preflight-target-phase.test.ts
  • src/lib/actions/sandbox/rebuild-resume-config.test.ts
  • src/lib/actions/sandbox/rebuild-target-staging.test.ts
  • src/lib/onboard.ts
  • src/lib/onboard/machine/core-flow-phases.ts
  • src/lib/onboard/machine/handlers/provider-inference-route-containment.test.ts
  • src/lib/onboard/machine/handlers/provider-inference.ts
  • src/lib/onboard/machine/handlers/sandbox-dcode-selection.test.ts
  • src/lib/onboard/machine/handlers/sandbox-tool-disclosure.test.ts
  • src/lib/onboard/machine/handlers/sandbox.test.ts
  • src/lib/onboard/machine/handlers/sandbox.ts
  • src/lib/onboard/provider-recovery.test.ts
  • src/lib/onboard/setup-inference-route-containment.test.ts
  • src/lib/onboard/setup-inference.ts
  • src/lib/onboard/setup-nim-flow.test.ts
  • src/lib/onboard/setup-nim-flow.ts
  • test/onboard-remote-recreate-credential-reuse.test.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • src/lib/onboard/machine/handlers/sandbox.test.ts
  • src/lib/onboard/setup-inference.ts
  • test/onboard-remote-recreate-credential-reuse.test.ts
  • docs/reference/commands.mdx

Comment thread src/lib/onboard/machine/core-flow-phases.ts Outdated
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
@ericksoa

Copy link
Copy Markdown
Contributor Author

PRA-1 addressed in 77ce23084: both routed and non-routed resume reservation payloads now retain the validated endpointSource. Regression coverage asserts inference-set provenance survives each path. Validation: focused provider-inference suites 44/44, CLI and JS-config typechecks, test-size budget, commit hooks, and push hooks passed.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/lib/onboard/machine/handlers/provider-inference.ts (1)

558-558: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Persist endpointSource with provider selection.

endpointSource is updated locally here, but the subsequent recordStepComplete("provider_selection") persists endpointUrl without it. If inference then fails, resume reloads null provenance and no longer recognizes the previously validated onboarding endpoint. Persist endpointSource in that session update and add an interrupted-selection/resume regression test.

Proposed fix
           provider,
           model,
           endpointUrl,
+          endpointSource,
           credentialEnv,

As per path instructions, resume behavior must converge on the same authoritative path as a fresh run.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/lib/onboard/machine/handlers/provider-inference.ts` at line 558, Update
the provider-selection persistence flow in the inference handler so
recordStepComplete("provider_selection") stores the locally resolved
endpointSource alongside endpointUrl. Add an interrupted-selection/resume
regression test verifying provenance survives reload and resume follows the same
authoritative endpoint-validation path as a fresh run.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@src/lib/onboard/machine/handlers/provider-inference.ts`:
- Line 558: Update the provider-selection persistence flow in the inference
handler so recordStepComplete("provider_selection") stores the locally resolved
endpointSource alongside endpointUrl. Add an interrupted-selection/resume
regression test verifying provenance survives reload and resume follows the same
authoritative endpoint-validation path as a fresh run.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: ad9cf0d2-5765-4e23-b6c0-f721469a368e

📥 Commits

Reviewing files that changed from the base of the PR and between a31ab1e and 77ce230.

📒 Files selected for processing (3)
  • src/lib/onboard/machine/handlers/provider-inference-route-containment.test.ts
  • src/lib/onboard/machine/handlers/provider-inference.test.ts
  • src/lib/onboard/machine/handlers/provider-inference.ts

ericksoa added 2 commits July 20, 2026 08:55
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/lib/onboard/machine/core-flow-phases.test.ts (1)

436-492: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Solid exact-match provenance coverage; consider also asserting result.context.onboardEndpointUrl.

The test correctly verifies setupInference's received endpointSource/onboardEndpointUrl and result.context.endpointSource for both matching and mismatched registry entries, but doesn't assert result.context.onboardEndpointUrl, even though mergeProviderModelSelectedContext carries that field through too (core-flow-phases.ts L171). Adding it would fully confirm the merge, not just the inference-options side.

✅ Proposed addition
     expect(result.context.endpointSource).toBe(expectedSource);
+    expect(result.context.onboardEndpointUrl).toBe(
+      expectTrustedUrl ? "https://persisted.example.test/v1" : null,
+    );
   });
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/lib/onboard/machine/core-flow-phases.test.ts` around lines 436 - 492,
Extend the parameterized test around providerPhase.run to also assert
result.context.onboardEndpointUrl. Expect the persisted endpoint URL for the
matching case and no onboardEndpointUrl property for the mismatched case,
confirming mergeProviderModelSelectedContext preserves the same exact-match
provenance behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/lib/onboard/machine/core-flow-phases.test.ts`:
- Around line 436-492: Extend the parameterized test around providerPhase.run to
also assert result.context.onboardEndpointUrl. Expect the persisted endpoint URL
for the matching case and no onboardEndpointUrl property for the mismatched
case, confirming mergeProviderModelSelectedContext preserves the same
exact-match provenance behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 47f6683f-2927-4935-91f9-17e77b3d2de5

📥 Commits

Reviewing files that changed from the base of the PR and between 77ce230 and 76f6f62.

📒 Files selected for processing (6)
  • src/lib/onboard.ts
  • src/lib/onboard/machine/core-flow-phases.test.ts
  • src/lib/onboard/machine/core-flow-phases.ts
  • src/lib/onboard/machine/flow-context.ts
  • src/lib/onboard/machine/handlers/provider-inference-route-containment.test.ts
  • src/lib/onboard/machine/handlers/provider-inference.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/lib/onboard.ts
  • src/lib/onboard/machine/handlers/provider-inference.ts

@cjagwani

Copy link
Copy Markdown
Collaborator

Exact-head security follow-up on 26aec377: the prior endpoint A→B provenance-graft blocker is closed. The implementation now binds trusted onboarding provenance to both the registry provider and canonical endpoint; mismatches downgrade to the normal SSRF/DNS-pinning path. Current ordinary CI, CodeQL, CodeRabbit, DCO/signatures, and both Advisor lanes are clean; E2E is still finishing.

One non-blocking contract warning remains: an interrupted provider-selection step records endpointUrl without endpointSource, so resume deliberately fails closed by rerunning endpoint preflight before any durable trusted route exists. Please confirm that revalidation is intentional. Direct provider-mismatch and end-to-end resolver-invocation cases would strengthen the adversarial coverage, but I do not see a remaining SSRF bypass.

The branch is now behind current main (5b547cdf), and maintainer edits are disabled. Please merge current main into fix/inference-endpoint-provenance-6321 after this run settles so the final review can bind to a current base and fresh exact-revision gates.

ericksoa added 2 commits July 20, 2026 09:23
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
@ericksoa

Copy link
Copy Markdown
Contributor Author

Addressed Charan’s follow-up in 55d82a59d and refreshed the branch onto current main (5b547cdf).

  • Confirmed the interrupted-selection contract is intentional: provider selection is not durable route trust, so that checkpoint deliberately omits endpointSource/onboardEndpointUrl; resume fails closed and revalidates before inference setup.
  • Added a direct provider-mismatch regression so matching endpoint text cannot graft onboard trust across providers.
  • Added a live onboard() slice probe proving the production registry.getSandbox resolver is wired into core provenance resolution.
  • Added the result-context canonical URL assertion suggested by CodeRabbit.

Validation: 23 changed test files / 368 tests; focused provenance and live-slice set 72/72; CLI build; JS and CLI typechecks; conditional/source-shape and test-size budgets; commit and push hooks. Fresh exact-head CI is running now.

@ericksoa
ericksoa merged commit 51e04ff into main Jul 20, 2026
56 of 57 checks passed
@ericksoa
ericksoa deleted the fix/inference-endpoint-provenance-6321 branch July 20, 2026 16:59
@ericksoa ericksoa mentioned this pull request Jul 20, 2026
21 tasks
ericksoa added a commit that referenced this pull request Jul 20, 2026
<!-- markdownlint-disable MD041 -->
## Summary

Add the canonical dated changelog entry for NemoClaw `v0.0.89` before
the release plan captures the tag commit.
The entry summarizes the user-visible Station preparation, inference,
recovery, policy-disclosure, and CLI-containment changes merged since
`v0.0.88`.

## Changes

- Add `docs/changelog/2026-07-20.mdx` with the exact `## v0.0.89`
release heading, parser-safe SPDX comment, summary, and detailed
bullets.
- Link each shipped theme to the most specific published OpenClaw
documentation routes.
- Keep internal E2E, advisory-registry, and review-workflow refactors
out of the user-facing release summary.

Source summary:

- #7214, #7241, #7237, #7223, #7204, #7202, #7183, and #7090 ->
`docs/changelog/2026-07-20.mdx`: Summarize qualified DGX Station
identity, package-state, PackageKit, DKMS, and reboot-handoff fixes.
- #7242, #7221, #7186, #7164, and #6874 ->
`docs/changelog/2026-07-20.mdx`: Summarize inference endpoint
provenance, provider attachment, managed vLLM cleanup and progress, and
Ollama selection guidance.
- #7225, #7216, #7192, #7136, #7096, and #6910 ->
`docs/changelog/2026-07-20.mdx`: Summarize sandbox readiness, recovery
guidance, rebuilt model routing, durable Hermes state, and gateway
restart behavior.
- #7187 -> `docs/changelog/2026-07-20.mdx`: Summarize complete effective
messaging-preset egress disclosure before policy mutation.
- #7218, #7165, and #7184 -> `docs/changelog/2026-07-20.mdx`: Summarize
structured output containment, terminal-safe route display, and Hermes
forward cleanup.

## Type of Change

- [ ] Code change (feature, bug fix, or refactor)
- [ ] Code change with doc updates
- [x] Doc only (prose changes, no code sample modifications)
- [ ] Doc only (includes code sample changes)

## Quality Gates

- [ ] Tests added or updated for changed behavior
- [ ] Existing tests cover changed behavior — justification:
- [x] Tests not applicable — justification: This PR adds release-history
prose only; the focused changelog contract test validates its required
structure and routes.
- [x] Docs updated for user-facing behavior changes
- [ ] Docs not applicable — justification:
- [ ] Sensitive paths changed (security, policy, credentials, preflight,
onboarding, inference, runner, sandbox, or messaging)
- [ ] Sensitive-path review completed or maintainer-approved waiver
recorded — reviewer/approval link/justification:
- [ ] Non-success, skipped, or missing CI check accepted by maintainer —
check name, approval link, and follow-up issue:

## Verification

- [x] PR description includes a `Signed-off-by:` line and every commit
appears as `Verified` in GitHub
- [x] Normal `pre-commit`, `commit-msg`, and `pre-push` hooks passed, or
`npm run check:diff` passed when hooks were skipped or unavailable
- [x] Targeted behavior tests pass for the current change set, or tests
are marked not applicable above — `mise exec node@22.23.1 -- npx vitest
run test/changelog-docs.test.ts` (6 passed).
- [ ] Applicable broad gate passed — `npm test` for broad
runtime/test-harness changes; `npm run check` for repo-wide
validation/coverage changes — not applicable to this doc-only release
entry.
- [x] Quality Gates section completed with required justifications or
waivers
- [x] No secrets, API keys, or credentials committed
- [ ] `npm run docs` builds without warnings (doc changes only) — `mise
exec node@22.23.1 -- npm run docs` completed with 0 errors and 2
existing site-wide warnings.
- [x] Doc pages follow the [style
guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md)
(doc changes only)
- [ ] New doc pages include SPDX header and frontmatter (new pages only)
— the native changelog entry uses the required parser-safe MDX SPDX
comment and does not use frontmatter.

---
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Expanded DGX Station installation support for qualified GB300 and
OTA-upgraded environments.
* Preserved selected inference providers, endpoints, model pins, and
tuning settings during sandbox creation and rebuilds.
* Improved sandbox recovery by validating availability and stability
before restarting services.
* Added clearer policy output showing the complete effective messaging
egress configuration.

* **Bug Fixes**
* Hardened status and inference route displays by sanitizing terminal
control characters.
* Improved Hermes uninstall behavior by stopping detached dashboard
forwarding.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
@jyaunches jyaunches mentioned this pull request Jul 20, 2026
22 tasks
jyaunches added a commit that referenced this pull request Jul 20, 2026
<!-- markdownlint-disable MD041 -->
## Summary

Add the canonical `## v0.0.90` entry to `docs/changelog/2026-07-20.mdx`
before the release tag is planned.
The update also corrects the documented custom-image migration window so
the compatibility fallback that first ships in v0.0.90 remains available
until v0.0.91.

## Changes

- Add the v0.0.90 summary and detailed release bullets for managed-image
routing, provider-reset recovery, WhatsApp health reporting, and DGX
Station guidance.
- Keep the newest release first in the shared dated changelog and use
root-absolute links to the canonical OpenClaw routes.
- Correct `docs/reference/commands.mdx` to state that the legacy image
route selector remains supported through v0.0.90 and is removed in
v0.0.91.
- Release source summary:
- [#7264](#7264) ->
`docs/resources/prompt-assets/dgx-station.md`,
`docs/changelog/2026-07-20.mdx`: Record the versioned Station installer
path, Nemotron 3 Ultra 550B default, and explicit DeepSeek override.
- [#7261](#7261) ->
`docs/get-started/dgx-station-preparation.mdx`,
`docs/manage-sandboxes/recover-rebuild-sandboxes.mdx`,
`docs/changelog/2026-07-20.mdx`: Include the OpenIB, legacy recovery,
and Additional Setup documentation follow-ups.
- [#7232](#7232) ->
`docs/changelog/2026-07-20.mdx`: Document provider-reset recovery for
wrapped OpenShell attachment diagnostics.
- [#7189](#7189) ->
`docs/reference/commands.mdx`, `docs/changelog/2026-07-20.mdx`: Document
the managed-image route-selector rename and correct its one-release
migration window.
- [#7015](#7015) ->
`docs/changelog/2026-07-20.mdx`: Document corrected OpenClaw WhatsApp
health reporting.
- No additional user-facing page update is needed for
[#7193](#7193),
[#7110](#7110),
[#6783](#6783), or
[#7263](#7263) because they
change contributor governance, internal CI or release automation, or
editorial style without changing supported user behavior.
- [#7242](#7242) and
[#7225](#7225) are already
ancestors of and documented in v0.0.89, so this entry does not duplicate
them despite their stale v0.0.90 labels.

## Type of Change

- [ ] Code change (feature, bug fix, or refactor)
- [ ] Code change with doc updates
- [x] Doc only (prose changes, no code sample modifications)
- [ ] Doc only (includes code sample changes)

## Quality Gates

- [ ] Tests added or updated for changed behavior
- [x] Existing tests cover changed behavior — justification:
`test/changelog-docs.test.ts` validates the dated changelog heading,
SPDX form, version order, and published links.
- [ ] Tests not applicable — justification:
- [x] Docs updated for user-facing behavior changes
- [ ] Docs not applicable — justification:
- [ ] Sensitive paths changed (security, policy, credentials, preflight,
onboarding, inference, runner, sandbox, or messaging)
- [ ] Sensitive-path review completed or maintainer-approved waiver
recorded — reviewer/approval link/justification:
- [ ] Non-success, skipped, or missing CI check accepted by maintainer —
check name, approval link, and follow-up issue:

## DGX Station Hardware Evidence

- [ ] Tested on DGX Station
- Tested commit: Not applicable; this PR does not change
`scripts/prepare-dgx-station-host.sh` or runtime behavior.
- Station profile/scenario: Not applicable.
- Result: Not applicable.
- Supporting evidence: Not applicable.

## Verification

- [x] PR description includes a `Signed-off-by:` line and every commit
appears as `Verified` in GitHub
- [x] Normal `pre-commit`, `commit-msg`, and `pre-push` hooks passed, or
`npm run check:diff` passed when hooks were skipped or unavailable
- [x] Targeted behavior tests pass for the current change set, or tests
are marked not applicable above — `npx vitest run
test/changelog-docs.test.ts` (6 passed).
- [ ] Applicable broad gate passed — `npm test` for broad
runtime/test-harness changes; `npm run check` for repo-wide
validation/coverage changes — command/result: Not run; this is a focused
documentation-only change.
- [x] Quality Gates section completed with required justifications or
waivers
- [x] No secrets, API keys, or credentials committed
- [ ] `npm run docs` builds without warnings (doc changes only) — passed
with 0 errors and two unrelated baseline warnings for unauthenticated
redirect checks and the existing light-mode contrast ratio.
- [x] Doc pages follow the [style
guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md)
(doc changes only)
- [ ] New doc pages include SPDX header and frontmatter (new pages only)

---
Signed-off-by: Julie Yaunches <jyaunches@nvidia.com>


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Documentation**
- Added release notes for v0.0.90 covering inference routing, credential
reset behavior, WhatsApp status detection, and DGX Station coding-agent
guidance.
- Updated custom Dockerfile guidance to document continued support for
the legacy provider argument through v0.0.90.
- Clarified that legacy declarations must be renamed to
`NEMOCLAW_INFERENCE_PROVIDER_ID` before v0.0.91.
  - Added and refreshed related documentation links.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Signed-off-by: Julie Yaunches <jyaunches@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: security Security controls, permissions, secrets, or hardening

Projects

None yet

4 participants