Repository navigation
fix(cli): report an unfinished install instead of a bare command failure - #10444
Conversation
An interrupted install or upgrade leaves the compiled CLI unresolvable, so the launcher's require throws MODULE_NOT_FOUND and the redacting fallback prints "Error: Command failed." Every state-inspection command a user reaches for then reports the same contextless line, naming neither the half-finished install nor the rerun that repairs it. Detect that one load failure and report it, without echoing the unresolved module path (#10372). Signed-off-by: Jason Ma <[email protected]>
`ReturnType<typeof spawnSync<string>>` does not type-check: the overloaded signature accepts no type argument in that position, so `tsc -p tsconfig.cli.json` failed on the new helper. Annotate it with the `SpawnSyncReturns<string>` type Node already exports (#10372). Signed-off-by: Jason Ma <[email protected]>
Code Coverage OverviewLanguages: TypeScript TypeScript / code-coverage/pluginThe overall line coverage in commit 6905fe9 in the TypeScript / code-coverage/cliThe overall line coverage in commit 6905fe9 in the Show a line coverage summary of the most impacted files.
Updated |
|
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:
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 (1)
💤 Files with no reviewable changes (1)
Included review availability: Your plan provides up to 12 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe CLI reports recovery guidance when the compiled CLI is missing, sets a failing exit code, and hides internal module-loading details. Both NemoClaw and Hermes launcher paths are covered by tests. ChangesIncomplete-install error handling
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The PR adds a localized diagnostic for incomplete installs while preserving existing handling for other startup failures; no actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Linked Issues checkExplanation The changes satisfy issue Full details: Out of Scope Changes checkExplanation All changes support the linked issue. The NemoHermes launcher update routes execution through the updated NemoClaw error handling, and the added tests validate the recovery behavior. No unrelated changes are evident. ✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
|
Merged current
Re-ran the guardrail locally against the real PR diff at the new head: 2 files, and empty violation lists for size, conditionals, and loops. |
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
Signed-off-by: Prekshi Vyas <[email protected]>
Signed-off-by: Prekshi Vyas <[email protected]>
Signed-off-by: Prekshi Vyas <[email protected]>
Signed-off-by: Prekshi Vyas <[email protected]>
|
PR Review Advisor finished for commit |
prekshivyas
left a comment
There was a problem hiding this comment.
Reviewed final head 6905fe9. All 64 current checks pass; the trusted merge-gate checker reports allPass=true. PR Review Advisor completed all nine specialists with no findings. Verified direct-entrypoint versus nested-dependency handling, Hermes launcher coverage, fixed diagnostics without path disclosure, DCO, signatures, and mergeability.
Summary
An interrupted install or upgrade leaves NemoClaw's compiled CLI unresolvable, so the launcher's
requirethrowsMODULE_NOT_FOUNDand the redacting fallback printsError: Command failed.Every state-inspection command a user reaches for then reports that same contextless line, naming neither the half-finished install nor the rerun that repairs it. The launcher now recognizes that one load failure and reports the state and the recovery step instead.Related Issue
Fixes #10372
Changes
bin/nemoclaw.js: when loading../dist/nemoclawfails withMODULE_NOT_FOUND, report that the compiled CLI is missing or incomplete, that an install or upgrade did not finish, and that rerunning the installer resumes and recovers existing sandboxes. Any other startup failure keeps the existinghandleTopLevelErrorpath unchanged, so the redaction behavior pinned by the#8202tests is untouched. The unresolved module path is deliberately not echoed — an untrusted path in a diagnostic is exactly what that fallback exists to redact.test/package-contract/cli/top-level-error.test.ts: two tests in the existing launcher-contract suite. One pins the reported message, the other pins that the report contains neitherdistnorCannot find module. Both reproduce the failure by making the compiled entrypoint unresolvable throughModule._load, rather than deletingdist/, which the rest of this lane needs.Type of Change
Quality Gates
DGX Station Hardware Evidence
Verification
Signed-off-by:line and every commit appears asVerifiedin GitHubpre-commit,commit-msg, andpre-pushhooks passed, ornpm run validate:prpassed after refreshingorigin/mainwhen hooks were skipped or unavailable — hooks are not installed in the authoring checkout, so the stages were run explicitly against a refreshedorigin/main.oxlintcannot load its config there (the package is absent from that checkout'snode_modules), so the lint and type stages were run on a clean Ubuntu 24.04 x86_64 host from a fresh clone of this branch plusnpm ci:npx oxlint --config oxlint.config.ts bin/nemoclaw.js test/package-contract/cli/top-level-error.test.tsreports 0 warnings and 0 errors, andnpm run typecheck:clipasses.npx commitlint --from origin/main --to HEADreports 0 problems.npx vitest run --project package-contract test/package-contract/cli/top-level-error.test.ts— 10/10 passed on the same clean host at commita172d3465. Verified by mutation: with the new branch removed frombin/nemoclaw.js, both new tests fail.npm testfor broad runtime/test-harness changes;npm run checkfor repo-wide validation/coverage changes — command/result:npm run docsbuilds without warnings (doc changes only)Host verification of the reported symptom
On the same host, with the compiled entrypoint made unresolvable:
nemoclaw credentials listreports the same guidance, matching the issue's second failing command. Withdist/restored,nemoclaw --versionreturns to normal output and exit 0. The host clone was removed afterward.Signed-off-by: Jason Ma [email protected]
Summary by CodeRabbit
Bug Fixes
Tests