Skip to content

feat(cli): show a concrete example in the unknown sandbox action error - #6176

Merged
cv merged 1 commit into
mainfrom
fix-cli-unknown-action-example
Jul 3, 2026
Merged

feat(cli): show a concrete example in the unknown sandbox action error#6176
cv merged 1 commit into
mainfrom
fix-cli-unknown-action-example

Conversation

@latenighthackathon

@latenighthackathon latenighthackathon commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

The unknown-action error for sandbox commands listed the valid actions but no concrete example. This appends an example command that uses the sandbox name the user typed, e.g. nemoclaw <name> connect, satisfying the last unmet acceptance criterion in #755 (unknown sandbox actions should list valid actions and a concrete example).

Related Issue

Refs #755

Changes

  • src/lib/cli/public-dispatch.ts: the unknownPublicAction branch now prints Example: <cli> <name> connect after the valid-actions list, matching the existing Did you mean: / command-order hint patterns already in that file.
  • test/cli/unknown-sandbox-action.test.ts: new test asserting an unknown sandbox action reports the valid actions and the concrete example.

Type of Change

  • Code change (feature, bug fix, or refactor)

Quality Gates

  • Tests added or updated for changed behavior
  • Docs not applicable — justification: CLI error-output only; no user-facing docs affected.

Verification

  • PR description includes the DCO sign-off declaration and every commit appears as Verified in GitHub
  • Git hooks passed during commit and push
  • Targeted tests pass for changed behavior
  • No secrets, API keys, or credentials committed

Ran: npx @biomejs/biome check (pass), npm run typecheck (pass), npm run build:cli, and vitest run test/cli/unknown-sandbox-action.test.ts (pass).


Signed-off-by: latenighthackathon latenighthackathon@users.noreply.github.com

Summary by CodeRabbit

  • Bug Fixes
    • Improved CLI guidance when an unknown sandbox action is entered.
    • The error message now includes a clearer example command, using the sandbox name when available.
    • Added test coverage to confirm the CLI shows the expected error, valid actions, and example usage.

Refs #755

Signed-off-by: latenighthackathon <latenighthackathon@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 340ca9bf-67eb-4bf3-aa74-fdd31f3736df

📥 Commits

Reviewing files that changed from the base of the PR and between 257f254 and 5ac049b.

📒 Files selected for processing (2)
  • src/lib/cli/public-dispatch.ts
  • test/cli/unknown-sandbox-action.test.ts

📝 Walkthrough

Walkthrough

Adds an "Example" line to the CLI's unknown-action error output, showing the connect command format with the sandbox name, and adds a test verifying the exit code and guidance messages for an unknown sandbox action.

Changes

Unknown action guidance

Layer / File(s) Summary
Example message and test coverage
src/lib/cli/public-dispatch.ts, test/cli/unknown-sandbox-action.test.ts
Adds a console.error "Example" line showing <cli> <sandbox-name> connect (using opts.sandboxName or "<name>"), and a new test verifying non-zero exit code plus "Unknown action", "Valid actions", and example output.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Suggested labels: feature, area: sandbox

Suggested reviewers: cv

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding a concrete example to the unknown sandbox action error.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-cli-unknown-action-example

Comment @coderabbitai help to get the list of available commands.

@github-code-quality

github-code-quality Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in the fix-cli-unknown-acti... branch is 96%. Coverage data for the main branch is not yet available.

Show a code coverage summary of the most covered files.
File main fix-cli-unknown-acti... 5ac049b +/-
nemoclaw/src/se...cret-scanner.ts 100%
nemoclaw/src/commands/slash.ts 100%
nemoclaw/src/li...bprocess-env.ts 100%
nemoclaw/src/bl...eprint/state.ts 98%
nemoclaw/src/onboard/config.ts 98%
nemoclaw/src/bl...int/snapshot.ts 97%
nemoclaw/src/bl...print/runner.ts 95%
nemoclaw/src/co...ration-state.ts 94%
nemoclaw/src/bl...ate-networks.ts 94%
nemoclaw/src/index.ts 94%

TypeScript / code-coverage/cli

The overall coverage in the fix-cli-unknown-acti... branch is 69%. Coverage data for the main branch is not yet available.

Show a code coverage summary of the most covered files.
File main fix-cli-unknown-acti... 5ac049b +/-
src/lib/actions...dbox/rebuild.ts 82%
src/lib/actions...all/run-plan.ts 80%
src/lib/state/o...oard-session.ts 80%
src/lib/shields/index.ts 75%
src/lib/state/sandbox.ts 73%
src/lib/onboard/preflight.ts 69%
src/lib/onboard...er-gpu-patch.ts 59%
src/lib/actions...licy-channel.ts 58%
src/lib/policy/index.ts 56%
src/lib/onboard.ts 20%

Updated July 02, 2026 05:54 UTC
Code Coverage is in Public Preview. Learn more and provide us with your feedback.

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

E2E Advisor Recommendation

Required E2E: None
Optional E2E: None

Workflow run

Full advisor summary

E2E Recommendation Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required E2E

  • None. No E2E is required. This PR changes only invalid-command guidance for a registered sandbox's unknown action path and adds a focused CLI test. The path exits before any sandbox lifecycle, onboarding, credential, network-policy, inference, or real assistant flow is exercised, so live E2E would not provide meaningful additional coverage.

Optional E2E

  • None.

New E2E recommendations

  • None.

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

E2E Target Recommendation

Required E2E targets: None
Optional E2E targets: None

Workflow run

Full E2E target advisor summary

E2E Target Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required E2E targets

  • None. Changed files update CLI unknown-action guidance and add a non-E2E CLI test, with no changes under test/e2e, .github/workflows/e2e.yaml, target registry/runtime support, shared E2E fixtures, or onboarding resume/repair state-machine paths that require a target dispatch.

Optional E2E targets

  • None.

Relevant changed files

  • None.

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor (Nemotron Ultra) — No blocking findings

Merge posture: No blocking advisor findings
Primary next action: No advisor follow-up required beyond maintainer review.
Open items: 0 required · 0 warnings · 0 suggestions · 0 test follow-ups
Since last review: 0 prior items resolved · 0 still apply · 0 new items found

Workflow run details

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.

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — No blocking findings

Merge posture: No blocking advisor findings
Primary next action: Add or justify PRA-T1 and any related test follow-ups.
Open items: 0 required · 0 warnings · 0 suggestions · 1 test follow-up

Action checklist

  • PRA-T1 Add or justify test follow-up: Acceptance clause
Test follow-ups to resolve or justify

If these cover changed behavior, prefer adding them in this PR; otherwise state why existing coverage is enough or link the follow-up.

Workflow run details

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.

@wscurran wscurran added area: cli Command line interface, flags, terminal UX, or output feature PR adds or expands user-visible functionality labels Jul 2, 2026
@wscurran

wscurran commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

@wscurran wscurran added v0.0.73 and removed v0.0.73 labels Jul 2, 2026
@prekshivyas prekshivyas self-assigned this Jul 2, 2026

@prekshivyas prekshivyas left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Clean refactor — the NATIVE_OCLIF_NAMESPACES set and helper split are strictly better. Test covers the golden path. PRA-T1 is non-blocking (test already satisfies the acceptance clause).

@cv
cv merged commit d2dbd25 into main Jul 3, 2026
48 checks passed
@cv
cv deleted the fix-cli-unknown-action-example branch July 3, 2026 03:27
Hadar301 pushed a commit to Hadar301/NemoClaw-OpenShift that referenced this pull request Jul 12, 2026
NVIDIA#6176)

## Summary

The unknown-action error for sandbox commands listed the valid actions
but no concrete example. This appends an example command that uses the
sandbox name the user typed, e.g. `nemoclaw <name> connect`, satisfying
the last unmet acceptance criterion in NVIDIA#755 (unknown sandbox actions
should list valid actions *and* a concrete example).

## Related Issue

Refs NVIDIA#755

## Changes

- `src/lib/cli/public-dispatch.ts`: the `unknownPublicAction` branch now
prints ` Example: <cli> <name> connect` after the valid-actions list,
matching the existing `Did you mean:` / command-order hint patterns
already in that file.
- `test/cli/unknown-sandbox-action.test.ts`: new test asserting an
unknown sandbox action reports the valid actions and the concrete
example.

## Type of Change

- [x] Code change (feature, bug fix, or refactor)

## Quality Gates

- [x] Tests added or updated for changed behavior
- [x] Docs not applicable — justification: CLI error-output only; no
user-facing docs affected.

## Verification

- [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
- [x] Targeted tests pass for changed behavior
- [x] No secrets, API keys, or credentials committed

Ran: `npx @biomejs/biome check` (pass), `npm run typecheck` (pass), `npm
run build:cli`, and `vitest run test/cli/unknown-sandbox-action.test.ts`
(pass).

---
Signed-off-by: latenighthackathon
<latenighthackathon@users.noreply.github.com>


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
  * Improved CLI guidance when an unknown sandbox action is entered.
* The error message now includes a clearer example command, using the
sandbox name when available.
* Added test coverage to confirm the CLI shows the expected error, valid
actions, and example usage.

<!-- 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cli Command line interface, flags, terminal UX, or output feature PR adds or expands user-visible functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants