fix(onboard): surface network-policy hint when OpenClaw plugin install fails during sandbox build#5835
Conversation
…the openclaw plugins install step When `openshell sandbox create` fails because the Dockerfile's `openclaw plugins install` RUN step exits non-zero, the build output contains the distinctive strings "openclaw plugins install" or "npm:@openclaw/", but `classifySandboxCreateFailure` had no branch for this pattern and fell through to `kind="unknown"`. The resulting hint was the generic "nemoclaw onboard --resume" line with no indication of the likely cause. Add a `"plugin_install_network_denied"` kind to `SandboxCreateFailure` and a classifier that matches those strings in the openshell create output. `printSandboxCreateRecoveryHints` now emits a targeted message noting that network policy may be blocking outbound access to ClawHub or the npm registry, and suggests disabling the feature (e.g. `NEMOCLAW_WEB_SEARCH_ENABLED=0`) as an alternative if a preset isn't available. Fixes #4127 Signed-off-by: Dongni Yang <dongniy@nvidia.com>
The previous regex matched `openclaw plugins install|npm:@openclaw/` anywhere in the captured output, which would mis-classify a build where that step succeeded and a later step failed — the Docker step header (`Step N: RUN openclaw plugins install ...`) would match even though the failure came from an unrelated subsequent RUN step. Tighten to the Docker error block format: The command '...<plugin text>...' returned a non-zero code `[^']*` is used (not `[^\n]*`) because the embedded shell command often spans multiple lines (chained commands joined with semicolons), and JS character classes match newlines. Add a regression test that verifies the step-header false-positive is rejected. Refs #4127 Signed-off-by: Dongni Yang <dongniy@nvidia.com>
…n-install failure as network-denied The previous classifier fired on any failed `openclaw plugins install` Docker command, including package-not-found (HTTP 404 from the registry), version conflicts, and auth errors — all of which would receive a misleading "network policy blocking egress" hint. Narrow the match to require both: 1. The Docker error block anchored to the failed plugin-install step 2. A network/egress reachability error (ENOTFOUND, EAI_AGAIN, ECONNREFUSED, ETIMEDOUT, fetch failed, etc.) in the captured output This ensures the hint "your sandbox network policy may be blocking outbound plugin-install access" is only shown when the underlying failure is actually a network reachability problem. Test changes: - Updated positive tests to include ENOTFOUND / ECONNREFUSED output matching real npm network error messages (registry.npmjs.org and ClawHub paths respectively) - Added negative test: same Docker failed-command block but E404 package-not-found → classifies as "unknown" - Added direct build-context.test.ts coverage for the new hint branch, asserting the key user-visible strings (plugin-install step, ClawHub, npm registry, network policy, NEMOCLAW_WEB_SEARCH_ENABLED=0, onboard --resume) Refs #4127 Signed-off-by: Dongni Yang <dongniy@nvidia.com>
📝 WalkthroughWalkthroughAdds a new sandbox-create failure kind for plugin-install network denial, classifies matching OpenClaw install errors, and prints recovery hints that mention the plugin-install step, network policy, and ChangesOpenClaw plugin install network denial
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Code Coverage OverviewLanguages: TypeScript TypeScript / code-coverage/pluginThe overall coverage in the branch is 96%. Coverage data for the branch is not yet available. Show a code coverage summary of the most covered files.
TypeScript / code-coverage/cliThe overall coverage in the branch is 67%. Coverage data for the branch is not yet available. Show a code coverage summary of the most covered files.
Updated |
PR Review Advisor — No blocking findingsMerge posture: No blocking advisor findings 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. |
E2E Advisor RecommendationRequired E2E: Dispatch hint: Full advisor summaryE2E Recommendation AdvisorBase: Required E2E
Optional E2E
New E2E recommendations
Dispatch hint
|
Vitest E2E Scenario RecommendationRequired Vitest E2E scenarios: None Full Vitest E2E advisor summaryVitest E2E Scenario AdvisorBase: Required Vitest E2E scenarios
Optional Vitest E2E scenarios
Relevant changed files
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/lib/validation.ts`:
- Around line 144-149: The classifier in validation.ts is too broad because it
matches any Docker RUN block containing openclaw plugins install, even when a
later command in the same block fails. Tighten the logic in the network-failure
branch so it only classifies plugin_install_network_denied when the failing
subcommand itself shows plugin-fetch/install evidence, using the existing
validation.ts matching and the relevant openclaw plugins install / npm:`@openclaw`
patterns as anchors. Update validation.test.ts with a regression case where
plugin install succeeds but a later command in the same shell block fails, and
verify it no longer returns the plugin install recovery hint.
🪄 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: b142153c-913c-41f6-bb87-87ba3729f360
📒 Files selected for processing (4)
src/lib/build-context.test.tssrc/lib/build-context.tssrc/lib/validation.test.tssrc/lib/validation.ts
…false positives from later RUN block commands The previous network-error predicate matched any ENOTFOUND/ECONNREFUSED/etc. in the captured output, which could fire the plugin-install hint when the plugin install itself succeeded but a later command in the same RUN block (e.g. `openclaw doctor --fix`) failed with a network error. npm's error output consistently prefixes every line with "npm error", whereas commands run after a successful install produce different error formats. Requiring "npm error" + network pattern anchors the evidence to the npm installer specifically, ruling out later-command false positives. Add a regression test: the same RUN block runs plugin install (succeeds) then openclaw doctor (fails with ENOTFOUND but no "npm error" prefix) → correctly returns "unknown". Refs #4127 Signed-off-by: Dongni Yang <dongniy@nvidia.com>
…get divergence Refs #4127 Signed-off-by: Dongni Yang <dongniy@nvidia.com>
Bound the network-evidence regex to the text up to and including the failed-plugin-install Docker error block rather than scanning the entire output. This prevents an npm script that runs after a successful plugin install in the same RUN block from producing a false plugin_install_network_denied classification when that later script emits an npm-prefixed network error. Adds a regression test for this case (npm script post-install in the same RUN block emits npm error ENOTFOUND after the Docker boundary). Refs #4127 Signed-off-by: Dongni Yang <dongniy@nvidia.com>
|
Addressing PRA-2 / CodeRabbit (windowed npm-error search): Both PRA-2 and the CodeRabbit comment correctly identified that scanning the entire output for Fixed in the latest commit ( A regression test was added for this case: Addressing PRA-1 (source-of-truth review): The classification is intentionally localized to NemoClaw's classifier layer. The source-of-truth facts:
|
Selective E2E Results — ✅ All requested jobs passedRun: 28261980087
|
prekshivyas
left a comment
There was a problem hiding this comment.
CodeRabbit's concern about same-RUN-block false positives is pre-addressed: the window slice text.slice(0, match.index + match[0].length) excludes post-boundary npm output, and the npm error.* prefix anchor drops non-npm error formats. Tests at lines 344 and 359 of validation.test.ts cover both sub-cases (non-npm network error and npm network error from a later command in the same block). Implementation is correct as-is.
E2E Target RecommendationRequired E2E targets: Dispatch required E2E targets:
Full E2E target advisor summaryE2E Target AdvisorBase: Required E2E targets
Optional E2E targets
Relevant changed files
|
PR Review Advisor (Nemotron Ultra) — No blocking findingsMerge posture: No blocking advisor findings Action checklist
Findings index
Review findings by urgency: 0 required fixes, 0 items to resolve/justify, 2 in-scope improvements
|
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
…ll-network-policy-hint
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
|
Maintainer disposition for exact head
No code change or additional E2E is required for these advisor items. Rerunning the PR Review Advisor once on this exact SHA to refresh its sticky outputs. |
|
Refreshed Nemotron suggestions disposition: keep |
<!-- markdownlint-disable MD041 --> ## Summary Refreshes the public documentation for NemoClaw v0.0.71 after scanning commits since v0.0.70. Adds release notes and fills the remaining doc gaps for Windows bootstrap diagnostics, OpenClaw agent auto-relock warnings, auto-pair cadence tuning, and plugin-install recovery hints. ## Changes - `docs/about/release-notes.mdx`: adds the v0.0.71 release-note section, grouped by gateway recovery, OpenShell auth, policy provenance, day-two maintenance, messaging/inference, and Windows setup. - `docs/get-started/windows-preparation.mdx`: documents sanitized WSL install output and reboot gating in the Windows bootstrap. - `docs/reference/commands.mdx`: documents the host `agent` wrapper's shields auto-relock warning and OpenClaw auto-pair watcher tuning variables. - `docs/reference/troubleshooting.mdx`: adds plugin-install network failure recovery guidance and updates Windows WSL troubleshooting for sanitized install logs and reboot-required handling. Source summary: - #6065 -> `docs/about/release-notes.mdx`: Notes explicit model override preservation and gateway-log guard-chain recovery diagnostics. - #5874 -> `docs/about/release-notes.mdx`: Summarizes host-mediated `recover` and `gateway restart`, linking to lifecycle, command, troubleshooting, and trusted-boundary docs already added by the source PR. - #5596 -> `docs/about/release-notes.mdx`: Summarizes OpenShell 0.0.71 gateway auth, loopback binding, and compatibility-container docs already added by the source PR. - #5797 and #5798 -> `docs/about/release-notes.mdx`: Summarizes `policy-list` provenance, Restricted tier suppression, and Balanced tier weather behavior already reflected in policy docs. - #5784 -> `docs/about/release-notes.mdx`: Summarizes `--destroy-user-data` and the safe `--yes` uninstall behavior already documented in lifecycle and command docs. - #6034 -> `docs/about/release-notes.mdx`: Summarizes custom Dockerfile warm-build cache behavior already documented in the command reference. - #5951 -> `docs/reference/commands.mdx`: Documents the stderr-only host `agent` wrapper warning after recent shields auto-relock. - #5387 -> `docs/reference/commands.mdx`: Documents OpenClaw auto-pair watcher cadence and fast-reentry tuning variables. - #5835 -> `docs/reference/troubleshooting.mdx`: Adds recovery guidance for OpenClaw plugin-install network failures. - #5995 and #5956 -> `docs/about/release-notes.mdx`: Summarizes Microsoft Teams final-message delivery and runtime mention hints already covered by messaging docs. - #5716 -> `docs/about/release-notes.mdx`: Summarizes non-interactive Ollama loopback safety already covered by local inference docs. - #5505, #5527, and #5528 -> `docs/about/release-notes.mdx`: Summarizes compatible local endpoint, model task-fit, and model capability audit docs. - #6009 -> `docs/get-started/windows-preparation.mdx`, `docs/reference/troubleshooting.mdx`: Documents sanitized Windows bootstrap WSL output and reboot-required gating. - #6055 -> no additional source doc page change needed beyond the already-merged quickstart update; release notes did not duplicate routine quickstart cleanup. No matching v0.0.71 GitHub announcement discussion was found in the latest 20 discussions, so this refresh is based on the commit scan and existing source PR docs. ## Type of Change - [ ] Code change (feature, bug fix, or refactor) - [ ] Code change with doc updates - [ ] Doc only (prose changes, no code sample modifications) - [x] Doc only (includes code sample changes) ## Quality Gates <!-- Check all that apply. For any "covered by existing tests", "not applicable", or waiver entry, add a brief justification on the same line or in the Changes section. --> - [ ] Tests added or updated for changed behavior - [ ] Existing tests cover changed behavior — justification: - [x] Tests not applicable — justification: docs-only refresh with no runtime behavior changes. - [x] Docs updated for user-facing behavior changes - [ ] Docs not applicable — justification: - [ ] Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging) - [ ] Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: - [ ] Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue: ## Verification <!-- Check each item you ran and confirmed. Leave unchecked items you skipped. Doc-only changes do not require npm test unless you ran it. --> - [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, or `npx prek run --from-ref main --to-ref HEAD` passes - [ ] Targeted tests pass for changed behavior - [ ] Full `npm test` passes (broad runtime changes only) - [x] Quality Gates section completed with required justifications or waivers - [x] No secrets, API keys, or credentials committed - [ ] `npm run docs` builds without warnings (doc changes only) — ran `npm run docs`; Fern reported 0 errors and 2 existing warnings. - [x] Doc pages follow the [style guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md) (doc changes only) - [ ] New doc pages include SPDX header and frontmatter (new pages only) --- <!-- DCO sign-off is required in this PR description, and every commit must appear as Verified in GitHub. Run: git config user.name && git config user.email --> Signed-off-by: Julie Yaunches <jyaunches@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Added a new release-notes entry covering gateway recovery, authentication, network policy/provenance output, uninstall safety, Windows bootstrap diagnostics, messaging defaults, and inference setup guidance. * Clarified Windows preparation steps around reboot behavior and redacting troubleshooting transcripts. * Expanded command reference details for OpenClaw wrapper behavior and new auto-pair tuning options. * Improved troubleshooting guidance for plugin installation issues, WSL repair/reboot cases, and install timing problems. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: Julie Yaunches <jyaunches@nvidia.com> Co-authored-by: Prekshi Vyas <34834085+prekshivyas@users.noreply.github.com>
…l fails during sandbox build (NVIDIA#5835) <!-- markdownlint-disable MD041 --> ## Summary When `openshell sandbox create` fails at `openclaw plugins install` because npm or ClawHub is unreachable, NemoClaw currently emits only generic resume guidance. This change classifies that narrow failure and prints an actionable network-policy hint while preserving `nemoclaw onboard --resume` as the recovery path. Fixes NVIDIA#4127 ## Changes - Add `plugin_install_network_denied` to the sandbox-create failure classification. - Require the failed Docker command summary to contain `openclaw plugins install`. - Require npm-prefixed network evidence to name the same scoped plugin package as the failed command. - Keep non-network failures, later-step failures, different-package errors, package-agnostic errors, and non-plugin npm commands on the generic recovery path. - Add targeted recovery guidance for npm/ClawHub reachability and feature opt-out. - Isolate the nine classifier regressions in `src/lib/validation-plugin-install.test.ts`. ## Source Boundary and Removal Condition - Invalid state: a plugin-install egress failure is surfaced as an undifferentiated sandbox-build failure. - Source boundary: the current OpenShell create interface exposes combined Docker text, including subprocess stderr followed by the failed-command summary, rather than a structured failed-subcommand type. - Source-fix constraint: NemoClaw cannot recover package identity from a structured OpenShell event until that interface exists, and this PR does not patch upstream runtime behavior. - Regression boundary: the classifier requires the exact installer command, same-package npm evidence, and a known network failure; focused positive and false-positive fixtures lock the ordering and quoting assumptions. - Removal condition: replace and remove this text classifier when OpenShell exposes a structured plugin-install failure carrying package identity. ## Type of Change - [x] Code change (bug fix) - [ ] Code change with doc updates - [ ] Doc only ## Quality Gates - [x] Focused tests cover the changed behavior and false-positive boundaries. - [x] No user documentation change is needed; the emitted recovery hint is self-contained. - [x] The code is diagnostic only and does not widen policy or change sandbox state. - [x] Live runtime validation is not required for this parser-only correction: deterministically forcing external registry denial would change the environment, while the pure classifier and printer are covered with Docker/OpenShell-shaped fixtures. ## Verification - [x] PR body includes the DCO declaration and every commit appears Verified in GitHub. - [x] Commit and push hooks passed. - [x] `npx vitest run --project cli src/lib/validation.test.ts src/lib/validation-plugin-install.test.ts src/lib/build-context.test.ts` passed: 87 tests. - [x] `npm run typecheck:cli` passed. - [x] `npm run test:imports:check` passed. - [x] Full root CLI/integration hook suite passed. - [x] No secrets, API keys, or credentials committed. --- Signed-off-by: Dongni Yang <dongniy@nvidia.com> --------- Signed-off-by: Dongni Yang <dongniy@nvidia.com> Signed-off-by: Carlos Villela <cvillela@nvidia.com> Co-authored-by: Carlos Villela <cvillela@nvidia.com>
<!-- markdownlint-disable MD041 --> ## Summary Refreshes the public documentation for NemoClaw v0.0.71 after scanning commits since v0.0.70. Adds release notes and fills the remaining doc gaps for Windows bootstrap diagnostics, OpenClaw agent auto-relock warnings, auto-pair cadence tuning, and plugin-install recovery hints. ## Changes - `docs/about/release-notes.mdx`: adds the v0.0.71 release-note section, grouped by gateway recovery, OpenShell auth, policy provenance, day-two maintenance, messaging/inference, and Windows setup. - `docs/get-started/windows-preparation.mdx`: documents sanitized WSL install output and reboot gating in the Windows bootstrap. - `docs/reference/commands.mdx`: documents the host `agent` wrapper's shields auto-relock warning and OpenClaw auto-pair watcher tuning variables. - `docs/reference/troubleshooting.mdx`: adds plugin-install network failure recovery guidance and updates Windows WSL troubleshooting for sanitized install logs and reboot-required handling. Source summary: - NVIDIA#6065 -> `docs/about/release-notes.mdx`: Notes explicit model override preservation and gateway-log guard-chain recovery diagnostics. - NVIDIA#5874 -> `docs/about/release-notes.mdx`: Summarizes host-mediated `recover` and `gateway restart`, linking to lifecycle, command, troubleshooting, and trusted-boundary docs already added by the source PR. - NVIDIA#5596 -> `docs/about/release-notes.mdx`: Summarizes OpenShell 0.0.71 gateway auth, loopback binding, and compatibility-container docs already added by the source PR. - NVIDIA#5797 and NVIDIA#5798 -> `docs/about/release-notes.mdx`: Summarizes `policy-list` provenance, Restricted tier suppression, and Balanced tier weather behavior already reflected in policy docs. - NVIDIA#5784 -> `docs/about/release-notes.mdx`: Summarizes `--destroy-user-data` and the safe `--yes` uninstall behavior already documented in lifecycle and command docs. - NVIDIA#6034 -> `docs/about/release-notes.mdx`: Summarizes custom Dockerfile warm-build cache behavior already documented in the command reference. - NVIDIA#5951 -> `docs/reference/commands.mdx`: Documents the stderr-only host `agent` wrapper warning after recent shields auto-relock. - NVIDIA#5387 -> `docs/reference/commands.mdx`: Documents OpenClaw auto-pair watcher cadence and fast-reentry tuning variables. - NVIDIA#5835 -> `docs/reference/troubleshooting.mdx`: Adds recovery guidance for OpenClaw plugin-install network failures. - NVIDIA#5995 and NVIDIA#5956 -> `docs/about/release-notes.mdx`: Summarizes Microsoft Teams final-message delivery and runtime mention hints already covered by messaging docs. - NVIDIA#5716 -> `docs/about/release-notes.mdx`: Summarizes non-interactive Ollama loopback safety already covered by local inference docs. - NVIDIA#5505, NVIDIA#5527, and NVIDIA#5528 -> `docs/about/release-notes.mdx`: Summarizes compatible local endpoint, model task-fit, and model capability audit docs. - NVIDIA#6009 -> `docs/get-started/windows-preparation.mdx`, `docs/reference/troubleshooting.mdx`: Documents sanitized Windows bootstrap WSL output and reboot-required gating. - NVIDIA#6055 -> no additional source doc page change needed beyond the already-merged quickstart update; release notes did not duplicate routine quickstart cleanup. No matching v0.0.71 GitHub announcement discussion was found in the latest 20 discussions, so this refresh is based on the commit scan and existing source PR docs. ## Type of Change - [ ] Code change (feature, bug fix, or refactor) - [ ] Code change with doc updates - [ ] Doc only (prose changes, no code sample modifications) - [x] Doc only (includes code sample changes) ## Quality Gates <!-- Check all that apply. For any "covered by existing tests", "not applicable", or waiver entry, add a brief justification on the same line or in the Changes section. --> - [ ] Tests added or updated for changed behavior - [ ] Existing tests cover changed behavior — justification: - [x] Tests not applicable — justification: docs-only refresh with no runtime behavior changes. - [x] Docs updated for user-facing behavior changes - [ ] Docs not applicable — justification: - [ ] Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging) - [ ] Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: - [ ] Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue: ## Verification <!-- Check each item you ran and confirmed. Leave unchecked items you skipped. Doc-only changes do not require npm test unless you ran it. --> - [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, or `npx prek run --from-ref main --to-ref HEAD` passes - [ ] Targeted tests pass for changed behavior - [ ] Full `npm test` passes (broad runtime changes only) - [x] Quality Gates section completed with required justifications or waivers - [x] No secrets, API keys, or credentials committed - [ ] `npm run docs` builds without warnings (doc changes only) — ran `npm run docs`; Fern reported 0 errors and 2 existing warnings. - [x] Doc pages follow the [style guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md) (doc changes only) - [ ] New doc pages include SPDX header and frontmatter (new pages only) --- <!-- DCO sign-off is required in this PR description, and every commit must appear as Verified in GitHub. Run: git config user.name && git config user.email --> Signed-off-by: Julie Yaunches <jyaunches@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Added a new release-notes entry covering gateway recovery, authentication, network policy/provenance output, uninstall safety, Windows bootstrap diagnostics, messaging defaults, and inference setup guidance. * Clarified Windows preparation steps around reboot behavior and redacting troubleshooting transcripts. * Expanded command reference details for OpenClaw wrapper behavior and new auto-pair tuning options. * Improved troubleshooting guidance for plugin installation issues, WSL repair/reboot cases, and install timing problems. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: Julie Yaunches <jyaunches@nvidia.com> Co-authored-by: Prekshi Vyas <34834085+prekshivyas@users.noreply.github.com>
Summary
When
openshell sandbox createfails atopenclaw plugins installbecause npm or ClawHub is unreachable, NemoClaw currently emits only generic resume guidance. This change classifies that narrow failure and prints an actionable network-policy hint while preservingnemoclaw onboard --resumeas the recovery path.Fixes #4127
Changes
plugin_install_network_deniedto the sandbox-create failure classification.openclaw plugins install.src/lib/validation-plugin-install.test.ts.Source Boundary and Removal Condition
Type of Change
Quality Gates
Verification
npx vitest run --project cli src/lib/validation.test.ts src/lib/validation-plugin-install.test.ts src/lib/build-context.test.tspassed: 87 tests.npm run typecheck:clipassed.npm run test:imports:checkpassed.Signed-off-by: Dongni Yang dongniy@nvidia.com