Skip to content

fix(onboard): ignore stale provider recovery on fresh - #5829

Merged
cv merged 6 commits into
mainfrom
codex/fix-fresh-onboard-provider-recovery
Jun 26, 2026
Merged

fix(onboard): ignore stale provider recovery on fresh#5829
cv merged 6 commits into
mainfrom
codex/fix-fresh-onboard-provider-recovery

Conversation

@cv

@cv cv commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes fresh non-interactive onboarding so stale recorded provider/model recovery is ignored before provider selection. This keeps --fresh from auto-selecting an old ollama-local provider for a dcode-station sandbox when the current environment should choose NVIDIA Endpoints or an explicitly requested provider.

Related Issue

Fixes #5719

Changes

  • Thread fresh from the core onboarding flow into provider inference setup.
  • Add a setupNim recovery policy option and use inert recovery readers when fresh onboarding disables recorded provider recovery.
  • Add regression coverage for the handler, core flow boundary, and the stale-session setupNim behavior.
  • Docs pass completed: no docs changes needed because existing docs already describe --fresh as discarding saved provider/model selection.

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: existing docs already state --fresh starts over and discards saved provider/model selection; this PR fixes implementation drift.
  • 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: self-review focused on preserving non-fresh recovery behavior while disabling stale recovery only for fresh provider selection; targeted tests cover both the flow boundary and setupNim behavior.
  • Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue:

Verification

  • PR description includes the DCO sign-off declaration and every commit appears as Verified in GitHub
  • Git hooks passed during commit and push, or npx prek run --from-ref main --to-ref HEAD passes
  • Targeted tests pass for changed behavior
  • Full npm test passes (broad runtime changes only)
  • 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)

Verification run locally:

  • npm run build:cli
  • npm test -- --run src/lib/onboard/machine/handlers/provider-inference.test.ts src/lib/onboard/machine/core-flow-phases.test.ts test/onboard-resume-provider-recovery.test.ts
  • npm run typecheck:cli
  • git diff --check
  • npm run source-shape:check
  • SKIP=test-cli npx prek run --files 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/handlers/provider-inference.test.ts src/lib/onboard/machine/handlers/provider-inference.ts test/onboard-resume-provider-recovery.test.ts
  • Commit/push hooks passed with SKIP=test-cli; the targeted CLI tests above were run directly.

Signed-off-by: Carlos Villela cvillela@nvidia.com

Summary by CodeRabbit

  • New Features

    • Added a “fresh” onboarding option and a configurable provider recovery flag that improves deterministic provider/model selection.
  • Bug Fixes

    • Updated provider inference/resume behavior so recorded provider recovery is skipped for fresh runs, and recovery-based provider selection is disabled when recovery is turned off.
  • Tests

    • Added and updated unit/integration coverage to confirm correct setupNim recovery-policy arguments, resume-vs-fresh routing, and expected non-interactive vs interactive prompts/logging.

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@coderabbitai

coderabbitai Bot commented Jun 25, 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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 918e9e4e-8cd4-4393-ac66-32b2845fa240

📥 Commits

Reviewing files that changed from the base of the PR and between 95d6532 and bc88798.

📒 Files selected for processing (1)
  • test/onboard-resume-provider-recovery.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • test/onboard-resume-provider-recovery.test.ts

📝 Walkthrough

Walkthrough

This PR threads fresh into provider inference, disables recorded provider recovery for fresh runs, updates setupNim non-interactive provider selection, and adds unit and integration coverage for fresh and resumed onboarding flows.

Changes

Fresh provider recovery

Layer / File(s) Summary
Recovery option contracts
src/lib/onboard/machine/handlers/provider-inference.ts, src/lib/onboard.ts
Adds recovery-related option fields and extends setupNim so non-interactive provider/model selection can bypass recorded recovery.
Fresh flow wiring
src/lib/onboard/machine/core-flow-phases.ts, src/lib/onboard/machine/handlers/provider-inference.ts, src/lib/onboard/machine/core-flow-phases.test.ts, src/lib/onboard/machine/handlers/provider-inference.test.ts
Passes fresh through provider inference, gates resume/recovery behavior on effectiveResume, and updates tests for fresh and non-fresh runs.
Integration policy
test/onboard-resume-provider-recovery.test.ts
Adds a child-process integration test that disables provider recovery and checks the resulting provider selection and log output.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Suggested labels

bug-fix, area: onboarding, area: inference

Suggested reviewers

  • jyaunches

Poem

A bunny hopped in with a fresh new plan,
No dusty sandbox could steer the span.
🥕 The provider chose its path anew,
and moonlit logs said the fresh-slate flew.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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 accurately summarizes the fresh-provider-recovery fix.
Linked Issues check ✅ Passed The changes address the fresh onboarding bug by disabling stale provider/model recovery and threading the fresh flag through the flow.
Out of Scope Changes check ✅ Passed The added handler, flow, and test changes are directly tied to the fresh recovery behavior and do not introduce unrelated scope.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-fresh-onboard-provider-recovery

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

@github-code-quality

github-code-quality Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in the codex/fix-fresh-onbo... branch is 96%. Coverage data for the main branch is not yet available.

Show a code coverage summary of the most covered files.
File main codex/fix-fresh-onbo... bc88798 +/-
nemoclaw/src/se...cret-scanner.ts 100%
nemoclaw/src/commands/slash.ts 100%
nemoclaw/src/li...bprocess-env.ts 100%
nemoclaw/src/bl...eprint/state.ts 98%
nemoclaw/src/onboard/config.ts 98%
nemoclaw/src/bl...int/snapshot.ts 97%
nemoclaw/src/bl...print/runner.ts 95%
nemoclaw/src/co...ration-state.ts 94%
nemoclaw/src/bl...ate-networks.ts 94%
nemoclaw/src/index.ts 94%

TypeScript / code-coverage/cli

The overall coverage in the codex/fix-fresh-onbo... branch is 47%. Coverage data for the main branch is not yet available.

Show a code coverage summary of the most covered files.
File main codex/fix-fresh-onbo... bc88798 +/-
src/lib/state/o...oard-session.ts 91%
src/lib/sandbox/config.ts 76%
src/lib/inference/local.ts 76%
src/lib/actions...dbox/rebuild.ts 72%
src/lib/onboard/preflight.ts 62%
src/lib/actions...licy-channel.ts 60%
src/lib/state/sandbox.ts 56%
src/lib/policy/index.ts 49%
src/lib/onboard...er-gpu-patch.ts 45%
src/lib/onboard.ts 19%

Updated June 26, 2026 00:29 UTC
Code Coverage is in Public Preview. Learn more and provide us with your feedback.

@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

E2E Advisor Recommendation

Required E2E: onboard-resume-e2e, onboard-repair-e2e, cloud-onboard-e2e
Optional E2E: None

Dispatch hint: onboard-resume-e2e,onboard-repair-e2e,cloud-onboard-e2e

Auto-dispatched E2E: onboard-resume-e2e via nightly-e2e.yaml at bc88798b4df2e6c9530c537bc55349e237418e32nightly run

Workflow run

Full advisor summary

E2E Recommendation Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required E2E

  • onboard-resume-e2e (medium): Required by the onboarding resume compatibility rule: source changes affect src/lib/onboard/machine provider-selection resume paths, effective resume state, and recorded provider recovery behavior.
  • onboard-repair-e2e (medium): Required by the onboarding resume compatibility rule because the PR changes resume shortcut and provider recovery/repair policy in provider inference state handling.
  • cloud-onboard-e2e (high): The setupNim provider recovery flag and fresh-flow handling can affect full non-interactive hosted onboarding and provider selection, so the hosted onboarding path should be validated end-to-end.

Optional E2E

  • None.

New E2E recommendations

  • fresh-onboarding-stale-recorded-provider-recovery (medium): The PR adds unit coverage for fresh setup ignoring stale recorded provider state, but there does not appear to be a dedicated existing E2E that seeds stale session/registry/live-gateway provider data and then verifies a fresh onboarding run does not recover it.
    • Suggested test: Add a focused E2E scenario for fresh onboarding with stale recorded provider/model state to prove --fresh or equivalent fresh flow selects the requested/default provider rather than recovering old sandbox state.

Dispatch hint

  • Workflow: nightly-e2e.yaml
  • jobs input: onboard-resume-e2e,onboard-repair-e2e,cloud-onboard-e2e

@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Vitest E2E Scenario Recommendation

Required Vitest E2E scenarios: onboard-resume-vitest, onboard-repair-vitest
Optional Vitest E2E scenarios: None

Dispatch required Vitest E2E scenarios:

  • gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref> --field jobs=onboard-resume-vitest
  • gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref> --field jobs=onboard-repair-vitest

Workflow run

Full Vitest E2E advisor summary

Vitest E2E Scenario Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required Vitest E2E scenarios

  • onboard-resume-vitest: Changes affect onboard machine provider-selection/resume behavior and setupNim recorded-provider recovery policy; the onboarding resume compatibility rule requires the onboard resume live Vitest job.
    • Dispatch: gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref> --field jobs=onboard-resume-vitest
  • onboard-repair-vitest: The provider-inference state-machine changes alter effective resume handling and can affect repair/backstop execution from persisted sessions, so onboard repair coverage is required with resume-path changes.
    • Dispatch: gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref> --field jobs=onboard-repair-vitest

Optional Vitest E2E scenarios

  • None.

Relevant changed files

  • src/lib/onboard.ts
  • src/lib/onboard/machine/core-flow-phases.ts
  • src/lib/onboard/machine/handlers/provider-inference.ts
  • src/lib/onboard/machine/core-flow-phases.test.ts
  • src/lib/onboard/machine/handlers/provider-inference.test.ts
  • test/onboard-resume-provider-recovery.test.ts

@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — No blocking findings

Merge posture: No blocking advisor findings
Primary next action: No advisor follow-up required beyond maintainer review.
Open items: 0 required · 0 warnings · 0 suggestions · 0 test follow-ups
Since last review: 1 prior item resolved · 0 still apply · 0 new items found

Workflow run details

This is an automated, non-binding review; it still expects maintainers and agents to respond to each required or warning item. Treat suggestions as current-PR improvements when they touch changed code; defer only with maintainer rationale or a linked follow-up. A human maintainer must make the final merge decision.

@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/handlers/provider-inference.ts`:
- Line 180: The handler in provider-inference is not enforcing the `fresh`
contract on resume paths, so completed sessions can still reuse stale
provider/model or inference state. Update `resumeProviderSelection`,
`resumeInference`, and the related `setupNim` flow to use a single effective
resume flag derived from `fresh` (and any recorded-reader/session state) so that
when `fresh` is true, all resume shortcuts are gated off and setup runs instead.
🪄 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: 2a25eb86-f332-41cf-bb38-bc5b9328a9e6

📥 Commits

Reviewing files that changed from the base of the PR and between 801f121 and ef43876.

📒 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/handlers/provider-inference.test.ts
  • src/lib/onboard/machine/handlers/provider-inference.ts
  • test/onboard-resume-provider-recovery.test.ts

Comment thread src/lib/onboard/machine/handlers/provider-inference.ts
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@github-actions

Copy link
Copy Markdown
Contributor

Selective E2E Results — ✅ All requested jobs passed

Run: 28207998174
Target ref: ef438764838b766048d0ebd3a928d160855f92b1
Workflow ref: main
Requested jobs: onboard-resume-e2e
Summary: 1 passed, 0 failed, 0 cancelled, 0 skipped

Job Result
onboard-resume-e2e ✅ success

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@github-actions

Copy link
Copy Markdown
Contributor

Selective E2E Results — ⚠️ Run cancelled — no signal

Run: 28208266996
Target ref: 0899eb2e0981be8c8088118907df6be7eb7b30d8
Workflow ref: main
Requested jobs: onboard-resume-e2e
Summary: 0 passed, 0 failed, 1 cancelled, 0 skipped

Job Result
onboard-resume-e2e ⚠️ cancelled

Signed-off-by: Carlos Villela <cvillela@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: 1

♻️ Duplicate comments (1)
src/lib/onboard/machine/handlers/provider-inference.ts (1)

210-215: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

fresh still does not gate the resume shortcuts.

fresh only flips allowRecordedProviderRecovery inside the setupNim branch. When this handler is invoked with fresh: true alongside a resume-eligible completed session, resumeProviderSelection (Line 210) and resumeInference (Line 298) still short-circuit setup and reuse the stale recorded provider/model, which contradicts the --fresh contract. Derive a single effective resume flag (resume && !fresh) and use it in both gates.

Proposed fix
+  const canResumeRecordedState = resume && !fresh;
   while (true) {
     let forceInferenceSetup = false;
     const resumeProviderSelection =
       !forceProviderSelection &&
-      resume &&
+      canResumeRecordedState &&
       session?.steps?.provider_selection?.status === "complete" &&
       typeof provider === "string" &&
       typeof model === "string";
     const resumeInference =
       !needsBedrockRuntimeAdapter &&
       !forceProviderSelection &&
       !forceInferenceSetup &&
-      resume &&
+      canResumeRecordedState &&
       deps.isInferenceRouteReady(provider, model);
🤖 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` around lines 210 -
215, The resume shortcuts in provider-inference still ignore the fresh flag, so
a fresh run can reuse recorded provider/model state from a completed session.
Introduce a single effective resume condition such as resume && !fresh in
provider-inference and apply it consistently to both resumeProviderSelection and
resumeInference, alongside the existing forceProviderSelection/session
status/type checks, so fresh blocks all resume-based short-circuiting.
🤖 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.ts`:
- Around line 3976-3979: The requested-provider selection in onboard.ts is
forcing `--fresh` interactive runs into the `build` provider path, which
bypasses `promptForInferenceProviderSelection`. Update the logic around
`requestedProvider` and `requestedModel` so the `"build"` fallback only applies
for non-interactive or explicit recovery flows, and let interactive fresh
onboarding fall through to the provider prompt instead. Use the existing
`getNonInteractiveProvider`, `isNonInteractive`, `recoverProvider`, and
`promptForInferenceProviderSelection` flow to keep the decision localized.

---

Duplicate comments:
In `@src/lib/onboard/machine/handlers/provider-inference.ts`:
- Around line 210-215: The resume shortcuts in provider-inference still ignore
the fresh flag, so a fresh run can reuse recorded provider/model state from a
completed session. Introduce a single effective resume condition such as resume
&& !fresh in provider-inference and apply it consistently to both
resumeProviderSelection and resumeInference, alongside the existing
forceProviderSelection/session status/type checks, so fresh blocks all
resume-based short-circuiting.
🪄 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: 41b916d3-5b97-45ea-a470-d28a9b2c95b9

📥 Commits

Reviewing files that changed from the base of the PR and between ef43876 and 0899eb2.

📒 Files selected for processing (5)
  • src/lib/onboard.ts
  • src/lib/onboard/machine/core-flow-phases.test.ts
  • src/lib/onboard/machine/handlers/provider-inference.test.ts
  • src/lib/onboard/machine/handlers/provider-inference.ts
  • test/onboard-resume-provider-recovery.test.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/lib/onboard/machine/core-flow-phases.test.ts
  • test/onboard-resume-provider-recovery.test.ts
  • src/lib/onboard/machine/handlers/provider-inference.test.ts

Comment thread src/lib/onboard.ts Outdated
@github-actions

Copy link
Copy Markdown
Contributor

Selective E2E Results — ⚠️ Run cancelled — no signal

Run: 28208332315
Target ref: 26a6f6a1d112d171977eb050bed04b2ba530c3f2
Workflow ref: main
Requested jobs: onboard-resume-e2e
Summary: 0 passed, 0 failed, 1 cancelled, 0 skipped

Job Result
onboard-resume-e2e ⚠️ cancelled

@github-actions

Copy link
Copy Markdown
Contributor

Selective E2E Results — ✅ All requested jobs passed

Run: 28208503726
Target ref: aa22fbca32b15b26521786cc5ec30c69d2bea7f4
Workflow ref: main
Requested jobs: onboard-resume-e2e
Summary: 1 passed, 0 failed, 0 cancelled, 0 skipped

Job Result
onboard-resume-e2e ✅ success

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@cv cv added the v0.0.69 label Jun 26, 2026
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@github-actions

Copy link
Copy Markdown
Contributor

Selective E2E Results — ⚠️ Run cancelled — no signal

Run: 28208945016
Target ref: 95d6532773d82e0d19068f469599a6ba55a8c0c3
Workflow ref: main
Requested jobs: onboard-resume-e2e
Summary: 0 passed, 0 failed, 1 cancelled, 0 skipped

Job Result
onboard-resume-e2e ⚠️ cancelled

@github-actions

Copy link
Copy Markdown
Contributor

Selective E2E Results — ✅ All requested jobs passed

Run: 28209162489
Target ref: bc88798b4df2e6c9530c537bc55349e237418e32
Workflow ref: main
Requested jobs: onboard-resume-e2e
Summary: 1 passed, 0 failed, 0 cancelled, 0 skipped

Job Result
onboard-resume-e2e ✅ success

@cv
cv merged commit b057858 into main Jun 26, 2026
45 checks passed
@cv
cv deleted the codex/fix-fresh-onboard-provider-recovery branch June 26, 2026 00:32
Hadar301 pushed a commit to Hadar301/NemoClaw-OpenShift that referenced this pull request Jul 12, 2026
## Summary
Fixes fresh non-interactive onboarding so stale recorded provider/model
recovery is ignored before provider selection. This keeps `--fresh` from
auto-selecting an old `ollama-local` provider for a `dcode-station`
sandbox when the current environment should choose NVIDIA Endpoints or
an explicitly requested provider.

## Related Issue
Fixes NVIDIA#5719

## Changes
- Thread `fresh` from the core onboarding flow into provider inference
setup.
- Add a `setupNim` recovery policy option and use inert recovery readers
when fresh onboarding disables recorded provider recovery.
- Add regression coverage for the handler, core flow boundary, and the
stale-session `setupNim` behavior.
- Docs pass completed: no docs changes needed because existing docs
already describe `--fresh` as discarding saved provider/model selection.

## Type of Change

- [x] 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
- [x] Tests added or updated for changed behavior
- [ ] Existing tests cover changed behavior — justification:
- [ ] Tests not applicable — justification:
- [ ] Docs updated for user-facing behavior changes
- [x] Docs not applicable — justification: existing docs already state
`--fresh` starts over and discards saved provider/model selection; this
PR fixes implementation drift.
- [x] Sensitive paths changed (security, policy, credentials, preflight,
onboarding, inference, runner, sandbox, or messaging)
- [x] Sensitive-path review completed or maintainer-approved waiver
recorded — reviewer/approval link/justification: self-review focused on
preserving non-fresh recovery behavior while disabling stale recovery
only for fresh provider selection; targeted tests cover both the flow
boundary and setupNim behavior.
- [ ] Non-success, skipped, or missing CI check accepted by maintainer —
check name, approval link, and follow-up issue:

## Verification
- [x] PR description includes the DCO sign-off declaration and every
commit appears as `Verified` in GitHub
- [x] Git hooks passed during commit and push, or `npx prek run
--from-ref main --to-ref HEAD` passes
- [x] Targeted tests pass for changed behavior
- [ ] Full `npm test` passes (broad runtime changes only)
- [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)
- [ ] 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)

Verification run locally:
- `npm run build:cli`
- `npm test -- --run
src/lib/onboard/machine/handlers/provider-inference.test.ts
src/lib/onboard/machine/core-flow-phases.test.ts
test/onboard-resume-provider-recovery.test.ts`
- `npm run typecheck:cli`
- `git diff --check`
- `npm run source-shape:check`
- `SKIP=test-cli npx prek run --files 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/handlers/provider-inference.test.ts
src/lib/onboard/machine/handlers/provider-inference.ts
test/onboard-resume-provider-recovery.test.ts`
- Commit/push hooks passed with `SKIP=test-cli`; the targeted CLI tests
above were run directly.

---
Signed-off-by: Carlos Villela <cvillela@nvidia.com>


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

* **New Features**
* Added a “fresh” onboarding option and a configurable provider recovery
flag that improves deterministic provider/model selection.

* **Bug Fixes**
* Updated provider inference/resume behavior so recorded provider
recovery is skipped for fresh runs, and recovery-based provider
selection is disabled when recovery is turned off.

* **Tests**
* Added and updated unit/integration coverage to confirm correct
`setupNim` recovery-policy arguments, resume-vs-fresh routing, and
expected non-interactive vs interactive prompts/logging.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@wscurran wscurran added area: onboarding Onboarding FSM, provider setup, sandbox launch, or first-run flow area: providers Inference provider integrations and provider behavior bug-fix PR fixes a bug or regression labels Aug 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: onboarding Onboarding FSM, provider setup, sandbox launch, or first-run flow area: providers Inference provider integrations and provider behavior bug-fix PR fixes a bug or regression

Projects

None yet

2 participants