fix(onboard): inject Ollama interaction state - #5898
Conversation
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThe Ollama tool-capability gate now uses an injected interaction policy threaded from onboarding into model preparation. The gate behavior, onboarding wiring, and tests were updated to handle non-interactive, auto-yes, and confirmation flows through that policy. ChangesOllama tool-capability gate
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Code Coverage OverviewLanguages: TypeScript TypeScript / code-coverage/pluginThe overall coverage in the Show a code coverage summary of the most covered files.
TypeScript / code-coverage/cliThe overall coverage in the Show a code coverage summary of the most covered files.
Updated |
PR Review Advisor (Nemotron Ultra) — No blocking findingsMerge posture: No blocking advisor findings Action checklist
Findings index
Review findings by urgency: 0 required fixes, 1 item to resolve/justify, 2 in-scope improvements
|
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
PR Review Advisor — No blocking findingsMerge posture: No blocking advisor findings Action checklist
Test follow-ups to resolve or justifyIf these cover changed behavior, prefer adding them in this PR; otherwise state why existing coverage is enough or link the follow-up.
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. |
E2E Advisor RecommendationRequired E2E: Dispatch hint: Auto-dispatched E2E: Full advisor summaryE2E Recommendation AdvisorBase: Required E2E
Optional E2E
New E2E recommendations
Dispatch hint
|
Vitest E2E Scenario RecommendationRequired Vitest E2E scenarios: Dispatch required Vitest E2E scenarios:
Full Vitest E2E advisor summaryVitest E2E Scenario AdvisorBase: Required Vitest E2E scenarios
Optional Vitest E2E scenarios
Relevant changed files
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
test/ollama-tools-capability.test.ts (1)
421-483: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd one regression through
prepareOllamaModel()as well.These cases prove the injected policy works when
checkOllamaModelToolSupport()is called directly, but the bug described in this PR is the forwarding path fromprepareOllamaModel(). Without one assertion through that entrypoint, a future break in the wiring can pass this file while reintroducing the original regression. As per path instructions, “Prefer observable outcomes through the public boundary over source-text, private-shape, or mock-call assertions.”🤖 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 `@test/ollama-tools-capability.test.ts` around lines 421 - 483, Add a regression test that exercises the public prepareOllamaModel() path, not just checkOllamaModelToolSupport() directly, to verify the caller’s non-interactive/auto-yes policy is forwarded correctly. Reuse the existing stub setup in this test file, invoke prepareOllamaModel() with the same injected state/confirm behavior, and assert the observable outcome matches the tools-incompatible handling without relying on internal mock-call details.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.
Nitpick comments:
In `@test/ollama-tools-capability.test.ts`:
- Around line 421-483: Add a regression test that exercises the public
prepareOllamaModel() path, not just checkOllamaModelToolSupport() directly, to
verify the caller’s non-interactive/auto-yes policy is forwarded correctly.
Reuse the existing stub setup in this test file, invoke prepareOllamaModel()
with the same injected state/confirm behavior, and assert the observable outcome
matches the tools-incompatible handling without relying on internal mock-call
details.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 2aa5eb7d-963d-4bef-a037-c35982e040b4
📒 Files selected for processing (3)
src/lib/inference/ollama/proxy.tssrc/lib/onboard.tstest/ollama-tools-capability.test.ts
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
|
Review follow-up:
|
Selective E2E Results —
|
| Job | Result |
|---|---|
| gpu-e2e | ⏭️ skipped |
|
GPT advisor follow-up ( |
<!-- markdownlint-disable MD041 --> ## Summary This PR removes the Ollama tools-capability gate's hidden dependency on the onboarding entrypoint. Onboarding now supplies its interaction state explicitly, fixing `--non-interactive` and `--yes` behavior without a circular lazy import. ## Related Issue Fixes NVIDIA#4139. Replacement for NVIDIA#4140, which identified the moved-path regression and established the initial test direction but cannot be updated without rewriting its unsigned, conflicting history. ## Changes - Add a typed `OllamaToolCapabilityInteraction` boundary for non-interactive, auto-yes, and confirmation decisions. - Pass onboarding's in-memory interaction state into `prepareOllamaModel` explicitly. - Keep environment and credential-prompt defaults for standalone capability checks. - Remove all three lazy onboarding lookups and their swallowed exceptions from the Ollama proxy. - Add focused regressions for caller-supplied non-interactive, auto-yes, and interactive confirmation behavior. ## 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 <!-- Check all that apply. For any "covered by existing tests", "not applicable", or waiver entry, add a brief justification on the same line or in the Changes section. --> - [x] Tests added or updated for changed behavior - [x] Existing tests cover changed behavior — justification: the proxy and onboarding-selection suites cover the surrounding pull, validation, and selection flows. - [ ] Tests not applicable — justification: - [ ] Docs updated for user-facing behavior changes - [x] Docs not applicable — justification: this restores the already-documented `--non-interactive`, `--yes`, and Ollama tools-gate semantics without changing commands or output contracts. - [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: focused diff review verified that only interaction-state ownership changes; capability validation, override requirements, and credential handling are unchanged. - [ ] Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue: ## Verification <!-- Check each item you ran and confirmed. Leave unchecked items you skipped. Doc-only changes do not require npm test unless you ran it. --> - [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) --- <!-- DCO sign-off is required in this PR description, and every commit must appear as Verified in GitHub. Run: git config user.name && git config user.email --> Signed-off-by: Carlos Villela <cvillela@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved Ollama model tool-capability checks to consistently respect interaction modes (non-interactive, auto-yes, and explicit yes/no confirmation), skipping prompts when appropriate. * Updated onboarding flow so confirmation behavior is delegated cleanly when interactive input is required. * **Tests** * Expanded unit coverage to ensure non-interactive/auto-yes short-circuit correctly and that interactive confirmation receives the expected question and default choice. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Summary
This PR removes the Ollama tools-capability gate's hidden dependency on the onboarding entrypoint. Onboarding now supplies its interaction state explicitly, fixing
--non-interactiveand--yesbehavior without a circular lazy import.Related Issue
Fixes #4139.
Replacement for #4140, which identified the moved-path regression and established the initial test direction but cannot be updated without rewriting its unsigned, conflicting history.
Changes
OllamaToolCapabilityInteractionboundary for non-interactive, auto-yes, and confirmation decisions.prepareOllamaModelexplicitly.Type of Change
Quality Gates
--non-interactive,--yes, and Ollama tools-gate semantics without changing commands or output contracts.Verification
Verifiedin GitHubnpx prek run --from-ref main --to-ref HEADpassesnpm testpasses (broad runtime changes only)npm run docsbuilds without warnings (doc changes only)Signed-off-by: Carlos Villela cvillela@nvidia.com
Summary by CodeRabbit