feat(cli): add nemoclaw use to set default sandbox#5930
Conversation
Promote a registered sandbox to the default through the same atomic, lock-guarded registry path used by onboard finalisation. Replaces hand-editing ~/.nemoclaw/sandboxes.json as the only mechanism to change the post-onboard default. Fixes #5923 Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
|
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 Changesuse command: logic, CLI, tests, and docs
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Code Coverage OverviewLanguages: TypeScript TypeScript / code-coverage/pluginThe overall coverage in the branch is 96%. Coverage data for the branch is not yet available. Show a code coverage summary of the most covered files.
TypeScript / code-coverage/cliThe overall coverage in the branch is 68%. Coverage data for the branch is not yet available. Show a code coverage summary of the most covered files.
Updated |
|
🌿 Preview your docs: https://nvidia-preview-pr-5930.docs.buildwithfern.com/nemoclaw |
PR Review Advisor — No blocking findingsMerge posture: No blocking advisor findings 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. |
There was a problem hiding this comment.
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/use-command-deps.ts`:
- Around line 46-48: The `setDefault()` failure path in `use-command-deps` is
using a stale `known` snapshot when returning `not-found`, which can produce
contradictory sandbox lists. In the `setDefault(sandboxName)` branch, refresh
the registry state before constructing the `{ outcome: "not-found", sandboxName,
knownSandboxes: ... }` result so `knownSandboxes` reflects the latest sandbox
set after a concurrent removal. Use the `deps.setDefault` and `knownSandboxes`
return path in `use-command-deps.ts` to locate the fix.
🪄 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: c0979ef6-90f3-466c-9983-577dc1b877da
📒 Files selected for processing (6)
docs/reference/commands-nemohermes.mdxdocs/reference/commands.mdxsrc/commands/use.tssrc/lib/cli/public-display-defaults.tssrc/lib/use-command-deps.test.tssrc/lib/use-command-deps.ts
E2E Advisor RecommendationRequired E2E: Dispatch hint: 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
|
Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
Selective E2E Results — ✅ All requested jobs passedRun: 28322935846
|
PR Review Advisor (Nemotron Ultra) — No blocking findingsMerge posture: No blocking advisor findings Action checklist
Findings index
Review findings by urgency: 0 required fixes, 0 items to resolve/justify, 3 in-scope improvements
|
Re-read the registry when setDefault returns false so the not-found diagnostic does not echo the stale pre-write snapshot when the target sandbox was concurrently removed. Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Summary
Adds a first-class
nemoclaw use <name>command that promotes a registered sandbox to the default. Closes the discoverability gap where the only post-onboard mechanism to change the default was hand-editing~/.nemoclaw/sandboxes.json.Related Issue
Fixes #5923
Changes
src/commands/use.tswires through to the existing atomic, lock-guardedregistry.setDefaultalready used by onboard finalisation, recovery, and default-preservation paths.src/lib/use-command-deps.tsexposes a purerunUseCommandthat classifies the outcome (set,already-default,not-found) with the previous default and the known-sandbox list, plus a deps builder for the oclif shim.2.5sonemoclaw uselands betweenlistand<name> connectinnemoclaw --help.docs/reference/commands.mdxgains a### nemoclaw use <name>section; the Hermes variantcommands-nemohermes.mdxsynced throughnpm run docs:sync-agent-variants.setDefaultreturnsfalse.Type of Change
Quality Gates
Verification
Verifiedin GitHubnpx prek run --from-ref main --to-ref HEADpassesnpx vitest run --project=cli src/commands src/lib/use-command-deps.test.ts(93 + 5 passed)npm testpasses (broad runtime changes only)npm run docsbuilds without warnings (doc changes only) —npm run docs:sync-agent-variantscleanCLI parity check passes locally:
bash test/e2e/e2e-cloud-experimental/check-docs.sh --only-clilistsnemoclaw use <name>from bothnemoclaw --helpanddocs/reference/commands.mdx. Static checks pass:npx tsx scripts/checks/run.ts.Signed-off-by: Tinson Lai tinsonl@nvidia.com
Summary by CodeRabbit
use <name>command to promote a registered sandbox as the default (including$$nemoclaw use <name>), with plain and--jsonoutput showing updated/already-default/unknown states.useunder Sandbox Management.