fix(cli): point OpenShell commands to openshell#3447
Conversation
Clarify misrouted OpenShell command errors and suppress raw oclif validation stacks so users get actionable CLI guidance.
|
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 (3)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughThe PR adds OpenShell command hinting to the NemoClaw CLI dispatcher. When users invoke OpenShell-only commands ( ChangesOpenShell Command Detection and Error Routing
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
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)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Comment |
|
✨ |
Resolutions: - src/lib/cli/oclif-runner.ts: union both sides — keep FailedFlagValidationError (this PR) alongside RequiredArgsError + 'Parsing --' message check added on main. - src/nemoclaw.ts: take main's slimmed-down 16-line shim; port the OpenShell command-hint logic to src/lib/cli/public-dispatch.ts where dispatch now lives. Hint runs before recovery so bare 'nemoclaw term' isn't swallowed by the 'Sandbox does not exist' error path. Tested: full test/cli.test.ts (159/159 passing) including the NVIDIA#3447 OpenShell-hint and validation-failure tests. Signed-off-by: Shawn Xie <shaxie@nvidia.com>
… term' isn't swallowed The hint was placed AFTER recoverRequestedSandboxIfNeeded(), so for 'nemoclaw term' (which normalizes to sandboxName='term', action='connect' — a known sandbox action), recovery walks the full not-found path and prints "Sandbox 'term' does not exist" before the hint can fire. Moving the check above recovery — with the &&!registry().getSandbox(cmd) guard so real sandboxes named e.g. 'term' still work — lets the OpenShell hint print as the test expected. cli.test.ts now passes locally. Signed-off-by: Shawn Xie <shaxie@nvidia.com>
Summary
nemoclaw term,nemoclaw policy set, andnemoclaw gateway stopto the correspondingopenshellcommands instead of suggesting sandbox connect.nemoclaw inference setno longer prints a raw stack trace.Fixes #3388.
Test plan
npm install --ignore-scriptsnpm run build:clinemoclaw term; echo "EXIT=$?"nemoclaw inference set; echo "EXIT=$?"nemoclaw policy set; echo "EXIT=$?"nemoclaw gateway stop; echo "EXIT=$?"npx vitest run test/cli.test.ts -t "OpenShell-only|validation failures|unknown command with non-sandbox action|suggests list"Summary by CodeRabbit
New Features
Bug Fixes
Tests
Signed-off-by: Shawn Xie shaxie@nvidia.com