feat(inference): add NemoClaw inference get command#3424
Conversation
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds a new Changesnemoclaw inference get command implementation
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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/actions/root-help.ts`:
- Around line 76-78: The help text currently hardcodes "nemoclaw" in the
reconfiguration hints; update those template strings to use the CLI_NAME
constant (e.g., `${CLI_NAME}`) so alias entrypoints are reflected correctly.
Locate the help string entries in root-help.ts (the lines constructing the
inference hints) and replace the literal "nemoclaw" tokens with CLI_NAME
interpolations, ensuring CLI_NAME is in scope/imported where these strings are
built.
In `@src/lib/onboard.ts`:
- Around line 10695-10698: The two adjacent console.log calls that print the CLI
usage (the lines that reference cliName() and sandboxName and show "inference
get" and the wrapped "inference set ..." usage) add a net +1 line; collapse them
into a single console.log (or remove a nearby redundant blank/comment line) so
the output remains identical but the file line count is reduced by one—locate
the console.log calls referencing cliName() and sandboxName and combine the
messages into one call (or delete an adjacent nonfunctional blank/comment) to
meet the budget.
🪄 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: b0a09d34-f6b5-4e0c-8829-348b796733c8
📒 Files selected for processing (20)
README.mddocs/get-started/quickstart.mddocs/inference/switch-inference-providers.mddocs/reference/cli-selection-guide.mddocs/reference/commands.mdsrc/commands/inference/get.tssrc/lib/actions/inference-get.test.tssrc/lib/actions/inference-get.tssrc/lib/actions/root-help.tssrc/lib/cli/oclif-dispatch.test.tssrc/lib/cli/oclif-dispatch.tssrc/lib/commands/global-oclif-command-adapters.test.tssrc/lib/commands/inference/get.tssrc/lib/inference/live.test.tssrc/lib/inference/live.tssrc/lib/list-command-deps.tssrc/lib/onboard.tssrc/lib/status-command-deps.tstest/cli.test.tstest/onboard.test.ts
E2E Advisor RecommendationRequired E2E: None Full advisor summaryPi Semantic E2E AdvisorFailed: pi exited with status 1; see /home/runner/work/NemoClaw/NemoClaw/artifacts/e2e-advisor/e2e-advisor-pi-raw-output.txt |
<!-- markdownlint-disable MD041 --> ## Summary Expand the existing "Verify the Active Model" section in `docs/inference/switch-inference-providers.md` to fully document `nemoclaw inference get`. The command landed in #3424 with a one-line entry in `docs/reference/commands.md`, and the inference how-to page picked it up at a minimum level (command + `--json` flag only). This change adds the output shape, the JSON shape, and the unconfigured-route error so users have a documented inverse to `nemoclaw inference set` on the same page. ## Problem After running `nemoclaw inference set --provider X --model Y`, the inference how-to page tells users to run `nemoclaw inference get` and `nemoclaw inference get --json` but does not show what either prints. Users either have to run the command themselves to find out what to expect, or rely on `nemoclaw status` diffs to confirm the route changed. The unconfigured-route case (gateway has no registered inference route) was not mentioned at all, so users hitting that error had no docs hint at what state caused it or how to recover. ## Changes - `docs/inference/switch-inference-providers.md`: rework the existing "Verify the Active Model" H2 to add (1) human-readable output (`Provider: <name>` / `Model: <id>`), (2) JSON output body, and (3) the non-zero exit + `OpenShell inference route is not configured.` error string with a pointer to `nemoclaw onboard`. Section title, position, and the trailing `nemoclaw <name> status` cross-reference are preserved. The new content uses the verified output format from [`src/lib/actions/inference-get.ts`](src/lib/actions/inference-get.ts) and the verified error message. ## Test plan - [x] `npx prek run --files docs/inference/switch-inference-providers.md` passes (gitleaks, markdownlint, docs-to-skills dry-run, skills YAML) - [x] `commitlint` passes - [ ] `make docs` (no Sphinx in container; rendered preview will appear via NemoClaw's docs build job) ## 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) Signed-off-by: latenighthackathon <latenighthackathon@users.noreply.github.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Updated instructions for viewing the active inference provider and model using the `nemoclaw inference get` command, including a `--json` machine-readable example. * Clarified behavior when no route is configured (command exits non-zero with "OpenShell inference route is not configured.") and added guidance to run `nemoclaw onboard` and verify state before/after switching routes. <!-- review_stack_entry_start --> [](https://app.coderabbit.ai/change-stack/NVIDIA/NemoClaw/pull/3431) <!-- review_stack_entry_end --> <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: latenighthackathon <latenighthackathon@users.noreply.github.com> Co-authored-by: latenighthackathon <latenighthackathon@users.noreply.github.com> Co-authored-by: Carlos Villela <cvillela@nvidia.com>
Summary
nemoclaw inference get [--json]to report the live NemoClaw-managed provider and model.listandstatus, preferringopenshell inference get -g nemoclawand falling back to legacyopenshell inference getfor older OpenShell installs.Fixes #2633
Validation
npm run build:clinpm run typecheck:clinpm run checksnpm run docs:strictpython3 scripts/docs-to-skills.py docs/ .agents/skills/ --prefix nemoclaw-user --dry-runnpm run format:checkgit diff --checknpx vitest run src/lib/inference/live.test.ts src/lib/actions/inference-get.test.ts src/lib/commands/global-oclif-command-adapters.test.ts src/lib/cli/oclif-dispatch.test.ts test/cli.test.ts test/onboard.test.ts test/root-help.test.ts --testTimeout 60000Summary by CodeRabbit
New Features
nemoclaw inference get(optional--json) to show the active inference provider and model.Documentation
inference getandinference setusage; clarified verification guidance for checking the active route.Tests
inference getbehavior and updated onboarding/output expectations.