Skip to content

fix(onboard): skip Linux systemd override for Windows-host Ollama - #8634

Merged
prekshivyas merged 4 commits into
NVIDIA:mainfrom
harjothkhara:oss-find/nemoclaw-2026-08-08
Aug 11, 2026
Merged

fix(onboard): skip Linux systemd override for Windows-host Ollama#8634
prekshivyas merged 4 commits into
NVIDIA:mainfrom
harjothkhara:oss-find/nemoclaw-2026-08-08

Conversation

@harjothkhara

@harjothkhara harjothkhara commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Summary

On WSL2 with Docker Desktop, a running Windows-host Ollama daemon is reached at host.docker.internal. Non-interactive onboard with NEMOCLAW_PROVIDER=install-windows-ollama collapses that request to the running-daemon handler, which then applied a Linux systemd loopback override and exited with code 1 before creating the sandbox. That override targets a local ollama.service; it cannot configure a daemon that runs on the Windows host.

After this change, onboard reuses the reachable Windows-host daemon and never touches a Linux systemd Ollama service. This restores the behavior first fixed in #4208.

PR #8634 also carries three repairs for failures inherited from base SHA b9a0d98d. The base SHA and PR merge commit failed the same checks. A maintainer directed these repairs through this PR.

Related Issue

Refs: #8596

Changes

  • src/lib/onboard/setup-nim-ollama.ts: handleRunningOllamaSelection now takes the resolved isWindowsHostOllama flag and skips ensureOllamaLoopbackSystemdOverride when the daemon is on the Windows host. The flag defaults to false, so the local-Linux path is unchanged.
  • src/lib/onboard/setup-nim-flow.ts: the ollama dispatch passes the already-computed isWindowsHostOllama (ollamaHost === host.docker.internal) to the handler.
  • scripts/install.sh: installer preflight reuses validated, deduplicated readiness IDs for headers and detail lines. Malformed IDs cannot enter diagnostic output.
  • test/package-contract/installer-host-preflight.test.ts: the compiled-package fixture supplies the gateway declaration module that installer preflight requires.
  • .github/workflows/base-image.yaml: the base-image publisher watches both managed-image activation files and their reviewed path glob.
  • Tests: a handler test proves the override is skipped for a Windows-host daemon ([WSL2][Onboard] Windows-host Ollama reuse exits during provider configuration #8596); the [WSL2][Install] express install fails with "Install did not produce ollama.exe on PATH" when Ollama already installed #7472 coordinator test now asserts the flow wires the flag through. Existing installer, package, and workflow contracts cover the inherited repairs.

The flag is the smallest signal that separates the two cases. It is already computed in the dispatcher, so nothing new is derived. This is not a compatibility or configuration layer.

Known limit

The flag marks the host.docker.internal route only. Two related boundaries are out of scope here and are safe to fix separately:

  • Sandbox resume repair (repairLocalInferenceSystemdOverrideOrExit, src/lib/onboard/local-inference-topology.ts) still applies the override for a recorded ollama-local provider, with no way yet to tell a recorded Windows-host daemon from a local one.
  • Under WSL mirrored networking the Windows daemon answers on 127.0.0.1, so isWindowsHostOllama reads false; the override then does nothing unless a local ollama.service also exists.

Type of Change

  • Code change (feature, bug fix, or refactor)

Quality Gates

  • Tests added or updated for changed behavior
  • Docs not applicable — justification: the Ollama change restores behavior the docs already describe. The added CI repairs restore repository checks and existing diagnostic constraints without adding a command, option, default, configuration, schema, or user-visible message.
  • 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 (onboarding, inference, and installer preflight paths).

Documentation Writer Review

  • Documentation writer subagent reviewed the completed changes
  • Result: no-docs-needed
  • Evidence: The Ollama change restores documented Windows-host reuse. The workflow paths, validated diagnostic IDs, and package fixture change no public documentation contract or user-visible message.
  • Agent: Codex Desktop

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 validate:pr passed after refreshing origin/main
  • Targeted behavior tests pass for the current change set — command/result:
    • npm exec -- vitest run --project cli src/lib/onboard/setup-nim-ollama.test.ts src/lib/onboard/setup-nim-flow.test.ts → 49 passed
    • npm exec -- vitest run --project installer-integration test/install-preflight.test.ts -t 'applies installer storage admission' → 5 passed, 94 skipped
    • npm exec -- vitest run --project package-contract test/package-contract/installer-host-preflight.test.ts → 3 passed
    • npm exec -- vitest run --project e2e-support test/e2e/support/base-image-publication.test.ts → 39 passed
    • npm run typecheck:cli → passed
    • npm run checks:repository → passed
    • npm run validate:pr → passed all applicable pre-commit, commit-message, and pre-push checks
    • Existing integration evidence: vitest run --project integration test/onboard-selection.test.ts → 64 passed
    • RED/GREEN: with the source restored to upstream and the new test kept, skips the Linux systemd loopback override for a Windows-host Ollama daemon (#8596) fails because the override runs. The [WSL2][Install] express install fails with "Install did not produce ollama.exe on PATH" when Ollama already installed #7472 coordinator assertion fails when the flow does not pass the flag. Both tests pass with the PR changes.
  • No secrets, API keys, or credentials committed

Signed-off-by: harjoth harjoth.khara@gmail.com
Signed-off-by: Prekshi Vyas prekshiv@nvidia.com

Summary by CodeRabbit

  • Bug Fixes

    • Improved Ollama setup on Windows hosts by using the reachable host endpoint.
    • Prevented unnecessary Linux systemd loopback overrides when Ollama runs on a Windows host.
    • Preserved recovery behavior for standard Linux Ollama installations.
    • Improved installer readiness reporting by filtering unsupported admission findings and capabilities.
  • Tests

    • Added coverage for Windows-host detection, startup handling, endpoint usage, and skipped loopback overrides.
    • Improved installer host-preflight test coverage.

@copy-pr-bot

copy-pr-bot Bot commented Aug 8, 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 Aug 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The onboarding flow passes Windows-host Ollama detection into running-daemon handling. Windows-host Ollama skips Linux systemd loopback override logic and uses the reachable host endpoint. The installer sanitizes readiness identifiers, and the base-image workflow expands its path filters.

Changes

Windows-host Ollama onboarding

Layer / File(s) Summary
Propagate Windows-host state
src/lib/onboard/setup-nim-flow.ts, src/lib/onboard/setup-nim-flow.test.ts
The dependency contract accepts the Windows-host indicator. The flow passes it to the running Ollama handler, and the test verifies the value.
Handle Windows-host Ollama
src/lib/onboard/setup-nim-ollama.ts, src/lib/onboard/setup-nim-ollama.test.ts
The handler skips Linux systemd loopback override handling for Windows-host Ollama. Tests verify startup handling and the host-reachable endpoint.

Installer host preflight

Layer / File(s) Summary
Sanitize readiness identifiers
scripts/install.sh, test/package-contract/installer-host-preflight.test.ts
Denied admissions use stable finding and capability IDs for readiness diagnostics. The fixture provides a successful declaration loader.

Managed-image workflow triggers

Layer / File(s) Summary
Expand managed-image path filters
.github/workflows/base-image.yaml
The workflow includes managed-image activation tests and helper files in its push filters.

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

Possibly related PRs

Suggested labels: provider: ollama

Suggested reviewers: cv

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: skipping the Linux systemd override for Windows-host Ollama during onboarding.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

On WSL2 a running Windows-host Ollama daemon is reached at
host.docker.internal. Non-interactive onboard with
NEMOCLAW_PROVIDER=install-windows-ollama collapses to the running-daemon
handler, which ran a Linux systemd loopback override and exited 1. That
override targets a local ollama.service and cannot configure the Windows
daemon.

Thread the resolved isWindowsHostOllama flag into
handleRunningOllamaSelection and skip the override when the daemon is on
the Windows host. Restores the behavior first fixed in NVIDIA#4208.

Refs: NVIDIA#8596

Signed-off-by: harjoth <harjoth.khara@gmail.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@harjothkhara
harjothkhara force-pushed the oss-find/nemoclaw-2026-08-08 branch from c7f1f2e to 0753216 Compare August 8, 2026 23:03
@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — No blocking findings reported

Advisor assessment: No blocking advisor findings reported
Next action: No advisor follow-up needed.
Findings: 0 blockers · 0 warnings · 0 suggestions

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 · 0 warnings · 0 suggestions
  • Model comparison: normalized findings match; normalized terminology decisions differ; normalized E2E selections differ; severity counts match.

Second-opinion terminology and E2E selections are advisory. Live E2E does not run automatically for pull requests.

2 semantic terminology decisions

Terminology decisions are advisory. They affect the assessment only when a separate finding identifies concrete semantic impact.

  • established — Windows-host Ollama at src/lib/onboard/setup-nim-ollama.ts:272: Retain the established term.
  • justified — Linux systemd loopback override at src/lib/onboard/setup-nim-ollama.test.ts:278: Retain the modifier because it distinguishes the Linux-only override from Windows-host Ollama handling.

E2E guidance

Advisory only. A maintainer can dispatch the default E2E suite for the commit under review.

Recommended E2E: None

Manual-only E2E: cloud-onboard, managed-image-multiarch-startup, onboard-repair, onboard-resume
The manual PR workflow does not run these selectors for the commit under review. Run them from reviewed code on main.

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.

@harjothkhara
harjothkhara marked this pull request as ready for review August 9, 2026 20:46
@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@cv cv 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.

The Windows-host Ollama path now skips only the inapplicable Linux systemd override while preserving existing Linux behavior. Focused handler and flow tests cover both paths, and I found no correctness, compatibility, security, test, or documentation blocker.

@wscurran wscurran added area: onboarding Onboarding FSM, provider setup, sandbox launch, or first-run flow bug-fix PR fixes a bug or regression platform: wsl Affects Windows Subsystem for Linux labels Aug 10, 2026
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@prekshivyas
prekshivyas enabled auto-merge (squash) August 11, 2026 05:28
@prekshivyas
prekshivyas disabled auto-merge August 11, 2026 05:39
Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
@prekshivyas
prekshivyas merged commit d357554 into NVIDIA:main Aug 11, 2026
77 of 82 checks passed
prekshivyas added a commit that referenced this pull request Aug 11, 2026
<!-- markdownlint-disable MD041 -->
## Summary

PR #8634 merged the production readiness-ID sanitization, the required
gateway-management fixture, and the current base-image publisher paths.
This PR is therefore narrowed to the remaining independent value:
package-contract evidence that installer diagnostics reject unstable IDs
and deduplicate valid IDs across both output routes.

## Changes

- Exercise duplicate valid finding and capability IDs.
- Exercise newline-injected, oversized, and pattern-invalid IDs.
- Assert each valid ID appears once in the admission summary and once in
its fallback diagnostic, while every rejected ID remains absent from
installer output.

## Type of Change

- [x] Code change (test hardening)
- [ ] 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
- [x] Docs not applicable — justification: the final diff changes one
package-contract test and does not alter commands, output labels, valid
IDs, configuration, defaults, lifecycle behavior, schemas, or support
claims.
- [ ] Sensitive paths changed (final diff contains no production
security, policy, credential, preflight, onboarding, inference, runner,
sandbox, or messaging code)
- [x] Sensitive-path review completed — the final test-only diff was
reviewed at commit `47df4d057`; no production security surface changes,
and all nine security categories have no findings. The new negative
evidence specifically covers input sanitization, output-injection
resistance, deduplication, and fallback-path composition.
- [ ] Non-success, skipped, or missing CI check accepted by maintainer

## Documentation Writer Review

- [x] Documentation writer subagent reviewed the completed changes
- Result: `no-docs-needed`
- Evidence: the final diff adds regression assertions for the existing
stable-ID and bounded-diagnostic contract. No production or
documentation file differs from `main`.
- Agent: Codex Desktop
<!-- docs-review-head-sha: 47df4d0 -->
<!-- docs-review-agents-blob-sha: c4923a3 -->

## Verification

- [x] PR description includes a `Signed-off-by:` line and every commit
appears as `Verified` in GitHub
- [x] `npm exec -- vitest run --project package-contract
test/package-contract/installer-host-preflight.test.ts` — 3/3 passed,
including malformed and duplicate-ID paths.
- [x] `npm exec -- vitest run --project e2e-support
test/e2e/support/base-image-publication.test.ts` — 39/39 passed after
merging current `main`.
- [x] `npm exec -- vitest run --project cli
src/lib/onboard/setup-nim-ollama.test.ts
src/lib/onboard/setup-nim-flow.test.ts` — 49/49 passed for the merged
base behavior.
- [x] Installer integration evidence — 97/99 passed in the parallel full
run; the two unrelated 5-second timing cases then passed 2/2 when rerun
alone with one worker.
- [x] `npm run validate:pr` — passed all pre-commit, commit-message, and
pre-push checks for the byte-identical final tree; the latest signed
merge also passed commit and pre-push hooks.
- [x] No secrets, API keys, or credentials committed

---

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

---------

Signed-off-by: Julie Yaunches <jyaunches@nvidia.com>
Co-authored-by: Carlos Villela <cvillela@nvidia.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Prekshi Vyas <prekshiv@nvidia.com>
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 bug-fix PR fixes a bug or regression platform: wsl Affects Windows Subsystem for Linux

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants