Skip to content

fix: avoid partial install when usage notice isn't accepted - #2694

Closed
BenediktSchackenberg wants to merge 3 commits into
NVIDIA:mainfrom
BenediktSchackenberg:fix/install-partial-state-2671
Closed

fix: avoid partial install when usage notice isn't accepted#2694
BenediktSchackenberg wants to merge 3 commits into
NVIDIA:mainfrom
BenediktSchackenberg:fix/install-partial-state-2671

Conversation

@BenediktSchackenberg

@BenediktSchackenberg BenediktSchackenberg commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • run show_usage_notice before install phase 1 (Node.js)
  • keep a short comment in install.sh describing why this must happen early
  • remove the duplicate usage notice call from run_onboard()

Why

If the notice is rejected (or can't be accepted in non-interactive mode), the installer used to fail in phase 3 after Node.js + NemoClaw CLI were already installed. This change makes that path fail before any install steps run, so we don't leave a partial install behind.

Summary by CodeRabbit

  • New Features

    • Installer adapts CLI branding and messaging per agent, and no longer hardcodes the CLI binary name.
    • vLLM local inference support: installs/starts a local OpenAI-compatible server when selected and verifies model readiness; installation fails if vLLM cannot become ready.
  • Chores

    • Sandbox selection now prefers session-derived settings, then env, then agent fallback.
    • Onboarding messaging now appears earlier (after Node.js/runtime setup) to avoid duplicate third-party usage prompts before CLI installation.

Copilot AI review requested due to automatic review settings April 29, 2026 19:12
@copy-pr-bot

copy-pr-bot Bot commented Apr 29, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

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: affb81f0-c7a6-4caf-8565-2dce24933f64

📥 Commits

Reviewing files that changed from the base of the PR and between 5e89a25 and 6d9da79.

📒 Files selected for processing (1)
  • scripts/install.sh
✅ Files skipped from review due to trivial changes (1)
  • scripts/install.sh

📝 Walkthrough

Walkthrough

Removed the in-run onboarding prompt by calling show_usage_notice from main() after Node.js is installed and runtime support is confirmed; run_onboard() no longer calls show_usage_notice, preventing duplicate prompts and ensuring the notice runs with Node available. (33 words)

Changes

Cohort / File(s) Summary
Install script
scripts/install.sh
Moved show_usage_notice call out of run_onboard() into main() so the usage notice is shown immediately after Node.js installation/runtime verification and before CLI installation/Phase 2 begins; removed duplicate prompt in onboarding flow.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Installer as "scripts/install.sh"
    participant Node as "Node.js runtime"
    participant CLI as "CLI install / Phase 2"

    User->>Installer: start installer
    Installer->>Node: install/verify Node.js
    Node-->>Installer: Node available
    Installer->>Installer: show_usage_notice()
    Installer->>CLI: proceed with CLI installation / Phase 2
    CLI-->>Installer: CLI installed
    Installer->>User: finish onboarding
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇
I hopped in after Node was found,
Popped the notice safe and sound,
No duplicate peeks, just one small cheer,
The CLI woke up, the path made clear—
A tidy hop, the install’s round. 🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title directly and clearly summarizes the main change: moving the usage notice check to prevent partial installs when the notice is rejected.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


Review rate limit: 9/10 reviews remaining, refill in 6 minutes.

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@scripts/install.sh`:
- Around line 1368-1370: The call to show_usage_notice is executed before
Node.js is guaranteed to exist, causing failures because show_usage_notice
invokes node; move the invocation of show_usage_notice so it runs after
install_nodejs has completed (i.e., call show_usage_notice after the
install_nodejs function/step), or alternatively rewrite the show_usage_notice
implementation to avoid using node and make it shell-native so it can run before
install_nodejs.
🪄 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: 52ee291b-5719-4308-b6c4-af89a3849849

📥 Commits

Reviewing files that changed from the base of the PR and between d753c18 and 07264d2.

📒 Files selected for processing (1)
  • scripts/install.sh

Comment thread scripts/install.sh Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR moves the third-party software usage notice earlier in the installer flow to ensure rejection/non-interactive failure happens before later phases, and removes a redundant usage notice invocation during onboarding.

Changes:

  • Remove show_usage_notice from run_onboard().
  • Add a single show_usage_notice call early in main() (before phase 1 “Node.js”), with an explanatory comment.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/install.sh Outdated
Comment on lines +1368 to +1371
# Show usage notice before any install steps so non-interactive/license
# rejection paths don't leave a partially-installed NemoClaw on PATH.
show_usage_notice

Comment thread scripts/install.sh Outdated
Comment on lines +1366 to +1371
bash "${SCRIPT_DIR}/setup-jetson.sh"

# Show usage notice before any install steps so non-interactive/license
# rejection paths don't leave a partially-installed NemoClaw on PATH.
show_usage_notice

BenediktSchackenberg added a commit to BenediktSchackenberg/NemoClaw that referenced this pull request Apr 29, 2026
… path

Copilot review on NVIDIA#2694 correctly flagged that show_usage_notice() calls
node under the hood. Moving it before step 1 (install_nodejs) breaks fresh
installs where Node isn't present yet.

Fix: keep the non-interactive/acceptance path as a cheap bash-only guard
before step 1 (no node required since no prompt is shown). For the
interactive/TTY path, defer show_usage_notice to after install_nodejs so
Node is always available when the notice UI runs. Either way, the notice
fires before step 2 (NemoClaw CLI install), so a rejection still leaves
no partial install state.

Per Copilot review on PR NVIDIA#2694.

Signed-off-by: Benedikt Schackenberg <6381261+BenediktSchackenberg@users.noreply.github.com>
@BenediktSchackenberg

Copy link
Copy Markdown
Contributor Author

Fixed based on Copilot review:

  • Non-interactive path (flag already set): checked before Phase 1 with no node required — just validates the flag in bash and bails early if missing
  • Interactive/TTY path: deferred to after Phase 1 so Node.js is always available when the notice UI runs

Either way the check fires before Phase 2 (NemoClaw CLI install), so rejection still leaves no partial install state.

@wscurran wscurran added bug dependencies Pull requests that update a dependency file labels Apr 30, 2026
@wscurran

Copy link
Copy Markdown
Contributor

✨ Thanks for submitting this PR that proposes a fix to avoid partial installs when the usage notice isn't accepted, which improves the installation flow by checking the acceptance requirement early.

BenediktSchackenberg added a commit to BenediktSchackenberg/NemoClaw that referenced this pull request May 1, 2026
…efore phase 2

Previous approach (bash-only early check + deferred TTY check) was
overly complex and still invoked show_usage_notice on a code path where
Node might not be present.

Simpler fix: move show_usage_notice to immediately after install_nodejs
and ensure_supported_runtime, but before Phase 2 (NemoClaw CLI install).
Node.js is guaranteed available, and rejection still leaves no NemoClaw
binary on PATH.

Per Copilot/CodeRabbit review on PR NVIDIA#2694.

Signed-off-by: Benedikt Schackenberg <6381261+BenediktSchackenberg@users.noreply.github.com>
@BenediktSchackenberg

Copy link
Copy Markdown
Contributor Author

Simplified per review — removed the bash-only early-check approach entirely. show_usage_notice now runs immediately after install_nodejs + ensure_supported_runtime (end of Phase 1), before Phase 2. Node is guaranteed available, rejection still blocks NemoClaw install.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@scripts/install.sh`:
- Around line 1372-1377: The script currently calls show_usage_notice
unconditionally after install_nodejs, which still invokes node in
non-interactive mode (see show_usage_notice using node), causing headless
installs without --yes-i-accept-third-party-software to run install_nodejs
before failing; before calling install_nodejs (i.e., in Phase 0/1), add a
shell-native non-interactive acceptance gate that checks the presence of the
--yes-i-accept-third-party-software flag or a TTY and exits early with a clear
message if not accepted, and remove or guard the unconditional show_usage_notice
call so show_usage_notice is only run after the gate or in interactive installs
(references: show_usage_notice, install_nodejs, run_onboard).
🪄 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: 6d46c355-7143-424d-b41f-a50add57c30e

📥 Commits

Reviewing files that changed from the base of the PR and between 26f179c and 1ce60ef.

📒 Files selected for processing (1)
  • scripts/install.sh

Comment thread scripts/install.sh

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
scripts/install.sh (2)

1078-1087: 💤 Low value

vLLM installation assumes Debian/Ubuntu and may fail silently on other platforms.

The apt-get fallback for pip3 only works on Debian-based systems. On macOS, RHEL, or other distros, users hitting NEMOCLAW_PROVIDER=vllm without pip3 will get a confusing failure. Consider adding a clearer error message when pip3 is unavailable on non-apt systems.

💡 Suggested improvement
   if ! python3 -c "import vllm" 2>/dev/null; then
     info "Installing vLLM…"
     if ! command_exists pip3; then
-      sudo apt-get install -y -qq python3-pip >/dev/null 2>&1 || true
+      if command_exists apt-get; then
+        sudo apt-get install -y -qq python3-pip >/dev/null 2>&1 || true
+      fi
+      if ! command_exists pip3; then
+        warn "pip3 not found. Install Python 3 pip manually, then re-run."
+        return 1
+      fi
     fi
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/install.sh` around lines 1078 - 1087, The install script's vLLM
branch relies on apt-get to install pip3 which only works on Debian/Ubuntu;
update the logic in the block around command_exists, pip3, and the vLLM
installation so it detects unsupported platforms and emits a clear error instead
of failing silently: after checking command_exists pip3, if pip3 is missing try
platform-specific installers (e.g., brew on macOS) or, if unknown, call warn
with a descriptive message like "pip3 not found and automatic install not
supported on this OS; please install pip3 manually" and return 1; ensure the
same explanatory message is logged before attempting pip3 install and preserve
the subsequent python3 -c "import vllm" check to fail fast if installation still
doesn't succeed.

292-311: 💤 Low value

Nested function definition is valid but may surprise readers.

stop_agent_forward_if_owned() is defined inside restore_onboard_forward_after_post_checks(). This works in bash but is uncommon. Consider extracting it to file scope or adding a brief comment noting the intentional scoping.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/install.sh` around lines 292 - 311, The nested function
stop_agent_forward_if_owned defined inside
restore_onboard_forward_after_post_checks can surprise readers; extract
stop_agent_forward_if_owned to file scope (move its full definition out of
restore_onboard_forward_after_post_checks) or, if you intentionally want it
scoped, add a clear comment immediately above the nested definition stating it
is intentionally local to restore_onboard_forward_after_post_checks; ensure any
references to openshell_bin, forward_list, owner, status and the call to
"$openshell_bin" forward stop "$port" "$sandbox_name" still work after moving
(or keep parameter/variable usage consistent) and run a quick shellcheck to
verify no scope/variable issues.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@scripts/install.sh`:
- Line 1745: The post-install call to restore_onboard_forward_after_post_checks
is non-fatal but currently invokes error "Hermes host forward restore failed."
which aborts after successful onboarding; change this to a non-fatal warning/log
so the script continues after onboarding. Locate the invocation of
restore_onboard_forward_after_post_checks and replace the error call with a
warning function or echo (e.g., warn or printf to stderr) that logs "Hermes host
forward restore failed. Post-install succeeded; follow remediation steps printed
earlier." so the script does not exit on this failure.

---

Nitpick comments:
In `@scripts/install.sh`:
- Around line 1078-1087: The install script's vLLM branch relies on apt-get to
install pip3 which only works on Debian/Ubuntu; update the logic in the block
around command_exists, pip3, and the vLLM installation so it detects unsupported
platforms and emits a clear error instead of failing silently: after checking
command_exists pip3, if pip3 is missing try platform-specific installers (e.g.,
brew on macOS) or, if unknown, call warn with a descriptive message like "pip3
not found and automatic install not supported on this OS; please install pip3
manually" and return 1; ensure the same explanatory message is logged before
attempting pip3 install and preserve the subsequent python3 -c "import vllm"
check to fail fast if installation still doesn't succeed.
- Around line 292-311: The nested function stop_agent_forward_if_owned defined
inside restore_onboard_forward_after_post_checks can surprise readers; extract
stop_agent_forward_if_owned to file scope (move its full definition out of
restore_onboard_forward_after_post_checks) or, if you intentionally want it
scoped, add a clear comment immediately above the nested definition stating it
is intentionally local to restore_onboard_forward_after_post_checks; ensure any
references to openshell_bin, forward_list, owner, status and the call to
"$openshell_bin" forward stop "$port" "$sandbox_name" still work after moving
(or keep parameter/variable usage consistent) and run a quick shellcheck to
verify no scope/variable issues.
🪄 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: bdf2bf83-2b6f-4057-88a3-7d1d646184f5

📥 Commits

Reviewing files that changed from the base of the PR and between 1ce60ef and 5e89a25.

📒 Files selected for processing (1)
  • scripts/install.sh

Comment thread scripts/install.sh
nemoclaw upgrade-sandboxes --auto 2>&1 || warn "Sandbox upgrade check failed (non-fatal)."
"$_CLI_BIN" upgrade-sandboxes --auto 2>&1 || warn "Sandbox upgrade check failed (non-fatal)."
fi
restore_onboard_forward_after_post_checks || error "Hermes host forward restore failed."

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Fatal error after successful onboarding defeats the PR's partial-install fix.

restore_onboard_forward_after_post_checks is a non-critical post-install helper that restarts Hermes port forwarding. Aborting with error after onboarding has already completed introduces a new failure mode: the user loses their progress indicator and sees a scary error message even though installation succeeded.

This should be a warning, not a fatal error. The function already prints actionable remediation steps on failure (lines 369-370).

🔧 Proposed fix
-      restore_onboard_forward_after_post_checks || error "Hermes host forward restore failed."
+      restore_onboard_forward_after_post_checks || warn "Hermes host forward could not be restored; see instructions above."
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
restore_onboard_forward_after_post_checks || error "Hermes host forward restore failed."
restore_onboard_forward_after_post_checks || warn "Hermes host forward could not be restored; see instructions above."
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/install.sh` at line 1745, The post-install call to
restore_onboard_forward_after_post_checks is non-fatal but currently invokes
error "Hermes host forward restore failed." which aborts after successful
onboarding; change this to a non-fatal warning/log so the script continues after
onboarding. Locate the invocation of restore_onboard_forward_after_post_checks
and replace the error call with a warning function or echo (e.g., warn or printf
to stderr) that logs "Hermes host forward restore failed. Post-install
succeeded; follow remediation steps printed earlier." so the script does not
exit on this failure.

@BenediktSchackenberg

Copy link
Copy Markdown
Contributor Author

The restore_onboard_forward_after_post_checks issue at line 1745 is in upstream install.sh code that was pulled in during rebase, not part of this PR's changes. Filed separately if it's a real regression — happy to split it out if that's preferred.

The vLLM/apt-get nitpick is also upstream code, same situation.

Move usage notice gating ahead of phase 1 so non-interactive or rejected notice flows fail before Node/CLI installation. Also remove duplicate call from run_onboard().

Signed-off-by: Benedikt Schackenberg <6381261+BenediktSchackenberg@users.noreply.github.com>
…efore phase 2

Previous approach (bash-only early check + deferred TTY check) was
overly complex and still invoked show_usage_notice on a code path where
Node might not be present.

Simpler fix: move show_usage_notice to immediately after install_nodejs
and ensure_supported_runtime, but before Phase 2 (NemoClaw CLI install).
Node.js is guaranteed available, and rejection still leaves no NemoClaw
binary on PATH.

Per Copilot/CodeRabbit review on PR NVIDIA#2694.

Signed-off-by: Benedikt Schackenberg <6381261+BenediktSchackenberg@users.noreply.github.com>
…ase 2

Rebased on upstream/main (f9d21af). The upstream changes to install.sh
(agent display name, clone_nemoclaw_ref refactor) are unrelated to this fix.

Signed-off-by: Benedikt Schackenberg <6381261+BenediktSchackenberg@users.noreply.github.com>
@ericksoa

ericksoa commented May 4, 2026

Copy link
Copy Markdown
Contributor

Closing as superseded by #2706, which merged as 3cdaf53 and closed #2671. I chose #2706 for the fix because it adds a shell-native fail-fast preflight before Phase 1/2 plus focused install-preflight regression coverage; this PR still moved the notice to after Node install, so it did not satisfy the fail-before-Phase-1/2 requirement as directly.

@ericksoa ericksoa closed this May 4, 2026
@wscurran wscurran added area: cli Command line interface, flags, terminal UX, or output bug-fix PR fixes a bug or regression chore Build, CI, dependency, or tooling maintenance and removed NemoClaw CLI chore Build, CI, dependency, or tooling maintenance labels Jun 3, 2026
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 bug-fix PR fixes a bug or regression dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants