fix(cli): render missing channel arg usage#3863
Conversation
|
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 (9)
✅ Files skipped from review due to trivial changes (3)
📝 WalkthroughWalkthroughMove ChangesChannel Command Signatures and Oclif argv Branding
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
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 |
Keep the native oclif dispatch argv in sync with process.argv while oclif handles parser errors, so missing channel args render command usage instead of leaking parser internals. Move the required <channel> positional into public channel command signatures and cover add/remove/start/stop through CLI dispatch tests. Signed-off-by: Yimo Jiang <yimoj@nvidia.com>
5299449 to
45b6d22
Compare
Summary
Missing messaging channel arguments now render oclif's normal required-argument usage instead of leaking parser internals. The public channel command signatures also show
<channel>in the positional usage slot for add/remove/start/stop.Related Issue
Fixes #3704
Changes
runOclifArgv's temporaryprocess.argvaligned with the native oclif argv while oclif renders parse-error help, then restore it in afinallyblock.<channel>into the public channel command usage metadata and leave--dry-runin the flags column.<channel>are preserved while docs-only suffixes are still tolerated.Type of Change
Verification
npx prek run --all-filespassesnpm testpassesmake docsbuilds without warnings (doc changes only)Additional verification run locally:
alpha channels add|remove|start|stopmissing<channel>: each exited 2 with usage and noRequiredArgsError/validateArgsstack markernpx -y -p node@22.16.0 node node_modules/vitest/vitest.mjs run src/lib/cli/oclif-runner.test.ts test/cli.test.ts test/root-help.test.ts test/cli-oclif-compatibility.test.ts -t "(runOclifArgv|restores process argv|policy and channel mutations reject missing parser-owned values before dispatch|shows channel as a required positional argument|renders native sandbox help without registry recovery|hands public sandbox execution to oclif as native argv|uses the alias binary name in native oclif help)"npx -y -p node@22.16.0 -p npm@10 npm run typecheck:clinpx -y -p node@22.16.0 -p npm@10 npm run build:clinpx -y -p node@22.16.0 -p npm@10 npm run checksbash -n test/e2e/e2e-cloud-experimental/check-docs.shbash test/e2e/e2e-cloud-experimental/check-docs.sh --only-clicd nemoclaw && npx -y -p node@22.16.0 -p npm@10 npm testLocal broad CLI project note:
NEMOCLAW_TEST_TIMEOUT=60000 NEMOCLAW_EXEC_TIMEOUT=60000 npx -y -p node@22.16.0 node node_modules/vitest/vitest.mjs run --project cliwas otherwise green but failed an unrelated host-permission fixture intest/fetch-guard-patch-regression.test.ts; the fixture exits onrm -rf /usr/local/lib/node_modules/openclawbecause this machine's/usr/local/lib/node_modulesis root-owned750.Signed-off-by: Yimo Jiang yimoj@nvidia.com
Summary by CodeRabbit
Bug Fixes
Tests
Documentation