Skip to content

fix(onboard): honor provider model env for Ollama - #6873

Merged
cv merged 4 commits into
NVIDIA:mainfrom
HwangJohn:codex/6869-ollama-model-env
Jul 15, 2026
Merged

fix(onboard): honor provider model env for Ollama#6873
cv merged 4 commits into
NVIDIA:mainfrom
HwangJohn:codex/6869-ollama-model-env

Conversation

@HwangJohn

@HwangJohn HwangJohn commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Honor NEMOCLAW_PROVIDER_MODEL as a compatibility fallback for Ollama onboarding while keeping NEMOCLAW_MODEL as the preferred model env. Interactive Ollama selection now defaults to the requested model when that model appears in the rendered menu, instead of falling back to the memory-based or alphabetically-first default.

Related Issue

Fixes #6869

Changes

  • Add a shared requested-model env reader that prefers NEMOCLAW_MODEL and falls back to NEMOCLAW_PROVIDER_MODEL for non-interactive provider selection.
  • Pass the requested model env into interactive Ollama model prompting only when no route-compatibility lock already controls the model.
  • Match the requested default against rendered Ollama menu entries with existing Ollama model-reference normalization, and keep the memory-based default when the requested model is not shown.
  • Document the NEMOCLAW_PROVIDER_MODEL compatibility fallback for Ollama and add regression coverage for env precedence, interactive defaults, and hidden requested models.

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
  • 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: Contributor self-review focused on onboarding/inference env precedence and validation; the change does not read credentials, alter policy, or expose new secret material. Maintainer review is still required before merge.
  • 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
  • Normal pre-commit, commit-msg, and pre-push hooks passed, or npm run check:diff passed when hooks were skipped or unavailable — npm run check:diff passed on DGX Spark Linux/aarch64 against the committed diff
  • Targeted behavior tests pass for the current change set, or tests are marked not applicable above — npx vitest run --project cli src/lib/inference/ollama/proxy.test.ts src/lib/onboard/setup-nim-ollama.test.ts src/lib/onboard/providers.test.ts passed locally on Windows and on DGX Spark Linux/aarch64 (71 passed)
  • Applicable broad gate passed — npm test for broad runtime/test-harness changes; npm run check for repo-wide validation/coverage changes — not applicable; this is a focused onboarding/inference env handling change covered by targeted tests, docs build, CLI build, and diff gate
  • 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) — npm run docs passed on DGX Spark Linux/aarch64 with 0 errors; Fern reported existing hidden warnings/upgrade notice, so this box is left unchecked
  • Doc pages follow the style guide (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only)

Signed-off-by: HwangJohn angelic805@gmail.com

Summary by CodeRabbit

  • New Features
    • Added compatibility support for configuring a provider model via NEMOCLAW_PROVIDER_MODEL.
    • Enhanced interactive Ollama onboarding: when a requested “safe” model tag exists in the current Ollama menu, it’s used as the default selection.
  • Bug Fixes
    • Improved Ollama model selection to match models by reference and compute the default selection index correctly.
    • If the requested model isn’t available, the app now consistently falls back to the memory-based default.
  • Documentation
    • Updated Ollama onboarding docs to describe NEMOCLAW_PROVIDER_MODEL and the interactive/non-interactive default-model fallback behavior.
  • Tests
    • Added/expanded unit tests for provider-model selection and interactive default-model forwarding.

Signed-off-by: HwangJohn <angelic805@gmail.com>
@copy-pr-bot

copy-pr-bot Bot commented Jul 14, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

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: 3ce6a81e-0687-495d-ad94-1cff2217a8a2

📥 Commits

Reviewing files that changed from the base of the PR and between f3965ee and a5d4b28.

📒 Files selected for processing (3)
  • docs/inference/set-up-ollama.mdx
  • src/lib/onboard/providers.test.ts
  • src/lib/onboard/providers.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • docs/inference/set-up-ollama.mdx
  • src/lib/onboard/providers.test.ts
  • src/lib/onboard/providers.ts

📝 Walkthrough

Walkthrough

Ollama onboarding now resolves model requests from NEMOCLAW_MODEL or NEMOCLAW_PROVIDER_MODEL, propagates validated interactive defaults, and matches requested model references against installed Ollama options. Tests and documentation cover precedence, fallback, and prompt selection behavior.

Changes

Ollama model selection

Layer / File(s) Summary
Environment model resolution
src/lib/onboard/providers.ts, src/lib/onboard/providers.test.ts
Adds primary and compatibility model environment resolution, applies it to hosted staging and non-interactive validation, and tests precedence and fallback behavior.
Interactive default propagation
src/lib/onboard/setup-nim-ollama.ts, src/lib/onboard/setup-nim-ollama.test.ts
Derives prompt defaults from environment variables for interactive Ollama setup and passes them through model selection, including null behavior when unavailable.
Prompt model matching and documentation
src/lib/inference/ollama/proxy.ts, src/lib/inference/ollama/proxy.test.ts, src/lib/onboard.ts, docs/inference/set-up-ollama.mdx
Validates prompt defaults, matches installed models by reference, recalculates the default index, and documents compatibility fallback and interactive selection rules.

Estimated code review effort: 3 (Moderate) | ~25 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% 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 Ollama onboard model-env fix.
Linked Issues check ✅ Passed The changes address #6869 by honoring NEMOCLAW_PROVIDER_MODEL in non-interactive and interactive Ollama onboarding with fallback behavior.
Out of Scope Changes check ✅ Passed The docs and tests are directly tied to the Ollama model-selection fix and do not introduce unrelated scope.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@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/setup-nim-ollama.test.ts`:
- Around line 112-115: Update the injected process.env in the fallback test to
explicitly set NEMOCLAW_MODEL to undefined, ensuring the fallback uses
NEMOCLAW_PROVIDER_MODEL regardless of the host environment. Preserve the
existing environment spread and provider-model setup.
🪄 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: 41f9d7eb-e396-4b07-892b-ad24a6d3ebb4

📥 Commits

Reviewing files that changed from the base of the PR and between 20130dd and eae13ba.

📒 Files selected for processing (8)
  • docs/inference/set-up-ollama.mdx
  • src/lib/inference/ollama/proxy.test.ts
  • src/lib/inference/ollama/proxy.ts
  • src/lib/onboard.ts
  • src/lib/onboard/providers.test.ts
  • src/lib/onboard/providers.ts
  • src/lib/onboard/setup-nim-ollama.test.ts
  • src/lib/onboard/setup-nim-ollama.ts

Comment thread src/lib/onboard/setup-nim-ollama.test.ts
Signed-off-by: HwangJohn <angelic805@gmail.com>
@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — Informational

Advisor assessment: Informational / medium 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 · medium confidence · 0 blockers · 0 warnings · 0 suggestions
  • Nemotron 3 Ultra (second opinion): Completed · high confidence · 0 blockers · 1 warning · 0 suggestions
  • Model comparison: normalized findings differ; normalized E2E selections differ; Nemotron reported the same number of blockers, 1 more warning, the same number of suggestions.

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

E2E guidance

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

Recommended E2E: inference-routing, network-policy, onboard-repair, onboard-resume, cloud-onboard

1 optional E2E recommendation
  • ollama-auth-proxy

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: HwangJohn <angelic805@gmail.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 provider: ollama Ollama local model provider behavior labels Jul 14, 2026
@wscurran

Copy link
Copy Markdown
Contributor

✨ Thanks for the fix, @HwangJohn. Honoring NEMOCLAW_PROVIDER_MODEL as a compatibility fallback for Ollama onboarding resolves the reported regression. Ready for maintainer review.


Related open issues:

@prekshivyas prekshivyas self-assigned this Jul 14, 2026
Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
@prekshivyas

Copy link
Copy Markdown
Collaborator

@cv Exact head a5d4b28b2ddb4cc96ccc32bba8de3257bca1285d has been maintainer-reviewed and all non-credentialed CI is green. The E2E gate selected inference-routing, network-policy, onboard-repair, and onboard-resume and is waiting on the protected approve-credentialed-e2e-skip-for-fork-pr deployment. Please approve Review deployments on run 29373860855. No fork code received repository secrets.

@cv

cv commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

@prekshivyas approved, please review

@prekshivyas prekshivyas left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed exact head a5d4b28. Ollama model precedence and compatibility fallback are correct and covered; CI, PR Advisor, CodeRabbit, and the policy-approved fork E2E gate are clear.

@cv
cv merged commit 7026efa into NVIDIA:main Jul 15, 2026
50 checks passed
cv pushed a commit that referenced this pull request Jul 16, 2026
<!-- markdownlint-disable MD041 -->
## Summary

Adds the canonical `docs/changelog/2026-07-15.mdx` entry with the exact
`## v0.0.84` heading for the release candidate range from `v0.0.83`
through `710d2b36b9eebcb6bca3c2b2f796a1bdb69c3a31`.
Fills two owner-page gaps for model-aware local inference health and
pre-write OpenClaw candidate validation.

## Changes

- Add the complete shared Fern changelog entry for `v0.0.84`, with
literal CLI names and root-absolute OpenClaw and Hermes routes.
- Document that sandbox status and doctor compare the configured Ollama
or vLLM model with provider inventory without issuing a completion.
- Document that host-side OpenClaw `config set` validates the complete
candidate before replacing live config or reaching gateway restart.
- Reconcile the `v0.0.84` release label with the commit range. PR #6773
is already contained in `v0.0.83` and remains documented there; CI,
test-harness, docs-infrastructure, and `.js` to `.mts` migration-only
changes require no additional user guidance.

### Source summary

- [#6882](#6882) ->
`docs/manage-sandboxes/backup-restore.mdx`,
`docs/changelog/2026-07-15.mdx`: Explain that OpenClaw runtime identity
and pairing state are excluded from snapshots and ignored during
restore.
- [#6873](#6873) ->
`docs/inference/set-up-ollama.mdx`, `docs/changelog/2026-07-15.mdx`:
Record the Ollama requested-model environment fallback and interactive
default.
- [#6835](#6835) ->
`docs/changelog/2026-07-15.mdx`: Include the sandbox name in the
documented rebuild resume-recovery behavior.
- [#6886](#6886) ->
`docs/inference/custom-endpoint-security.mdx`,
`docs/inference/set-up-openai-compatible-endpoint.mdx`,
`docs/changelog/2026-07-15.mdx`: Explain the exact-host trusted-private
endpoint opt-in and retained SSRF boundaries.
- [#6887](#6887) ->
`docs/reference/commands.mdx`, `docs/changelog/2026-07-15.mdx`: Document
Telegram channel health verdicts, summary behavior, and exit status.
- [#6863](#6863) ->
`docs/manage-sandboxes/lifecycle.mdx`, `docs/changelog/2026-07-15.mdx`:
Add the missing model-inventory behavior for local status and doctor
checks.
- [#6902](#6902) ->
`docs/manage-sandboxes/runtime-controls.mdx`,
`docs/changelog/2026-07-15.mdx`: Add the missing pre-write OpenClaw
candidate-validation contract.
- [#6916](#6916) ->
`docs/changelog/2026-07-15.mdx`: Preserve the failed-session
fresh-install recovery correction in the release entry.
- [#6934](#6934) ->
`docs/reference/commands.mdx`, `docs/reference/troubleshooting.mdx`,
`docs/security/credential-storage.mdx`, `docs/changelog/2026-07-15.mdx`:
Summarize completed-prompt checkpointing and validated credential reuse
during OpenClaw resume.
- [#6898](#6898) ->
`docs/inference/switch-models.mdx`,
`docs/inference/switch-providers.mdx`,
`docs/reference/troubleshooting.mdx`, `docs/changelog/2026-07-15.mdx`:
Explain Hermes dashboard convergence after in-place inference changes.
- [#6711](#6711) ->
`docs/manage-sandboxes/run-sandboxes.mdx`,
`docs/manage-sandboxes/uninstall-nemoclaw.mdx`,
`docs/reference/architecture.mdx`, `docs/reference/commands.mdx`,
`docs/changelog/2026-07-15.mdx`: Summarize port-scoped host state and
uninstall preservation.
- [#6767](#6767) ->
`docs/inference/configure-model-limits.mdx`,
`docs/inference/set-up-ollama.mdx`,
`docs/reference/troubleshooting.mdx`, `docs/changelog/2026-07-15.mdx`:
Record the Hermes `64000`-token Ollama floor and unchanged OpenClaw
floor.
- [#6862](#6862) ->
`docs/get-started/quickstart.mdx`,
`docs/inference/verify-inference-route.mdx`,
`docs/changelog/2026-07-15.mdx`: Explain retryable not-ready
finalization for unhealthy inference routes.
- [#6766](#6766) ->
`docs/security/tcb-boundary.mdx`, `docs/changelog/2026-07-15.mdx`:
Document definitive stale transition-lock recovery and fail-closed
ambiguous cases.
- [#6948](#6948) ->
`docs/manage-sandboxes/manage-mcp-servers.mdx`,
`docs/changelog/2026-07-15.mdx`: Include Hermes MCP apply-state race
recovery in the release entry without changing the established user
workflow.
- [#6964](#6964) ->
`docs/reference/troubleshooting.mdx`, `docs/changelog/2026-07-15.mdx`:
Record complete agent-specific fresh-install and resume recovery
commands.
- [#6883](#6883) ->
`docs/get-started/quickstart.mdx`, `docs/inference/set-up-vllm.mdx`,
`docs/reference/platform-support.mdx`, `docs/changelog/2026-07-15.mdx`:
Summarize the DGX Station Nemotron Ultra express path and pinned
managed-vLLM recipe.
- [#6985](#6985) ->
`docs/inference/set-up-vllm.mdx`, `docs/reference/commands.mdx`,
`docs/changelog/2026-07-15.mdx`: Capture the final automated and
interactive storage-warning behavior.

## 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 —
`test/changelog-docs.test.ts` validates the dated-entry structure, exact
version heading, and preserved history.
- [ ] 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:

## 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 — not run for this doc-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) —
completed with 0 errors; Fern reported the unchanged unauthenticated
redirect-check and light-theme contrast 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 intentionally has no frontmatter.

---
Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>


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

## Summary by CodeRabbit

* **Documentation**
* Added the v0.0.84 changelog entry covering setup, endpoint onboarding,
model handling, sandbox readiness, recovery, channel status, and
configuration safeguards.
* Clarified that sandbox health checks validate configured models
against local Ollama and vLLM provider inventories without generating
completions or consuming tokens.
* Documented that invalid runtime configuration changes are rejected
while preserving the existing working configuration.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
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 provider: ollama Ollama local model provider behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[All Platforms][Onboard] NEMOCLAW_PROVIDER_MODEL ignored — Ollama onboard auto-selects the alphabetically-first model

4 participants