fix(uninstall): treat an already-removed sandbox as removable state - #8247
Conversation
Scoped uninstall counted every non-zero `openshell sandbox delete` exit as a cleanup failure, so a sandbox that was already gone preserved the selected gateway state and exited 1 after the gateway registration had been removed. The delete now captures its output and classifies the outcome, so an already-removed sandbox finishes cleanup while an unreachable or rejected one still fails. Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
…ent-sandbox-delete Signed-off-by: Tinson Lai <tinsonl@nvidia.com> # Conflicts: # docs/manage-sandboxes/uninstall-nemoclaw.mdx
|
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 (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughUninstall now treats an already-absent OpenShell sandbox as successful cleanup. Other deletion failures preserve gateway state and return failure. Messages, tests, documentation, and the architecture budget reflect this behavior. ChangesSelected gateway sandbox cleanup
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Operator
participant UninstallPlan
participant OpenShellCLI
participant GatewayState
Operator->>UninstallPlan: run destructive uninstall
UninstallPlan->>OpenShellCLI: delete selected sandbox
OpenShellCLI-->>UninstallPlan: success, absent, or failure
alt success or absent
UninstallPlan->>GatewayState: remove selected gateway state
UninstallPlan-->>Operator: successful cleanup
else deletion failure
UninstallPlan->>GatewayState: preserve selected gateway state
UninstallPlan-->>Operator: failure with warning
end
Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
🌿 Preview your docs: https://nvidia-preview-pr-8247.docs.buildwithfern.com/nemoclaw |
Code Coverage OverviewLanguages: TypeScript TypeScript / code-coverage/pluginThe overall coverage in commit 3a875ee in the TypeScript / code-coverage/cliThe overall coverage in commit 3a875ee in the Show a code coverage summary of the most impacted files.
Updated |
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/actions/uninstall/run-plan.ts`:
- Line 1166: The uninstall flow must stop before removeGatewayRegistration when
deleteSelectedGatewaySandbox reports failure, preserving the selected gateway
registration for retry; update run-plan.ts at line 1166 to return incomplete
cleanup before registration removal. Update run-plan-absent-sandbox.test.ts
lines 147-161 to assert failed deletions make no gateway remove call and retain
the selected-box registry entry.
🪄 Autofix
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: 5db8680c-b536-4b6e-bcc4-ed320b4921a3
📒 Files selected for processing (6)
ci/source-architecture-budget.jsondocs/manage-sandboxes/uninstall-nemoclaw.mdxsrc/lib/actions/uninstall/run-plan-absent-sandbox.test.tssrc/lib/actions/uninstall/run-plan.tssrc/lib/domain/uninstall/messaging.tstest/uninstall.test.ts
PR Review Advisor — No blocking findings reportedAdvisor assessment: No blocking advisor findings reported Model lanes
3 terminology differences from the second opinionAdvisory only. These are normalized differences from the primary terminology receipt.
6 additional E2E selections from the second opinionAdvisory only. The primary lane did not select these E2E jobs or targets.
Second-opinion terminology and E2E selections are advisory. They do not change the primary assessment or E2E / PR Gate. 2 semantic terminology decisionsTerminology decisions are advisory. They affect the assessment only when a separate finding identifies concrete semantic impact.
E2E guidanceAdvisory only. E2E / PR Gate selects and runs jobs independently. Recommended E2E: None 1 optional E2E recommendation
This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge. |
cv
left a comment
There was a problem hiding this comment.
Changes required at exact head 91c8b36. When deleteSelectedGatewaySandbox reports a real failure, the run plan records cleanup failure but continues to removeGatewayRegistration. That removes the selected gateway state needed for the promised retry and contradicts the PR summary, documentation, and failure message. Return incomplete cleanup before registration removal on this path. Update the regression test to prove a failed delete makes no gateway-remove call and retains the selected sandbox registration. This is a blocking recovery-state integrity finding in the sensitive uninstall path. After the fix, refresh the exact-head security and documentation-writer receipts and rerun the owning tests. The already-absent success classification itself is not blocked.
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
|
@cv The blocking recovery-state finding is addressed in commit Validation completed: the focused regression passed 3/3, the owning uninstall suites passed 158 and 11 tests, and CLI type checking plus push hooks passed. The branch was subsequently refreshed from current |
Signed-off-by: Senthil Ravichandran <senthilr@nvidia.com>
<!-- markdownlint-disable MD041 --> ## Summary Add the canonical dated changelog entry for the planned NemoClaw v0.0.103 release. The new `docs/changelog/2026-08-05.mdx` entry uses the exact `## v0.0.103` heading and summarizes supported user-visible changes merged since v0.0.102. ## Changes - Add the parser-safe MDX SPDX header, three-paragraph release summary, and detailed grouped bullets to `docs/changelog/2026-08-05.mdx`. - Link each release-note group to the most specific published OpenClaw, Hermes, or Deep Agents documentation routes. - Exclude dormant MXC and Podman foundations, internal managed-inference adapters, test-only changes, and maintainer tooling from the supported product narrative. ### Source summary - [#8082](#8082) -> `docs/changelog/2026-08-05.mdx`: Document the new one-command agent launch flow. - [#8314](#8314) -> `docs/changelog/2026-08-05.mdx`: Document managed vLLM host capability validation and restart handling. - [#8248](#8248) -> `docs/changelog/2026-08-05.mdx`: Record the DGX Spark Qwen profile MTP default change. - [#8223](#8223) -> `docs/changelog/2026-08-05.mdx`: Record explicit model preservation across provider switches. - [#8209](#8209) -> `docs/changelog/2026-08-05.mdx`: Document corrected Windows WSL provider selection. - [#8316](#8316) -> `docs/changelog/2026-08-05.mdx`: Record clean managed-checkout reuse after installation. - [#8239](#8239) -> `docs/changelog/2026-08-05.mdx`: Record the packaged-service teardown fallback. - [#8247](#8247) -> `docs/changelog/2026-08-05.mdx`: Document uninstall behavior for an already-removed sandbox. - [#7998](#7998) -> `docs/changelog/2026-08-05.mdx`: Record preserved container-start diagnostics. - [#8027](#8027) -> `docs/changelog/2026-08-05.mdx`: Record journal-backed not-ready repair authority. - [#7812](#7812) -> `docs/changelog/2026-08-05.mdx`: Document actionable rebuild preflight diagnostics. - [#8222](#8222) -> `docs/changelog/2026-08-05.mdx`: Record redacted top-level CLI failures. - [#8313](#8313) -> `docs/changelog/2026-08-05.mdx`: Record structured MCP bridge destruction failures. - [#8211](#8211) -> `docs/changelog/2026-08-05.mdx`: Document cleanup of incomplete snapshot captures. - [#8212](#8212) -> `docs/changelog/2026-08-05.mdx`: Document best-effort post-restore policy reconciliation. - [#8245](#8245) -> `docs/changelog/2026-08-05.mdx`: Clarify manifest-defined OpenClaw workspace persistence. - [#8254](#8254) -> `docs/changelog/2026-08-05.mdx`: Include corrected snapshot restore selection guidance. - [#8238](#8238) -> `docs/changelog/2026-08-05.mdx`: Document preservation of managed MCP policy entries. - [#7568](#7568) -> `docs/changelog/2026-08-05.mdx`: Record mutable-default Shields rollback preservation. - [#8200](#8200) -> `docs/changelog/2026-08-05.mdx`: Record truthful Shields state after a rejected transition. - [#7895](#7895) -> `docs/changelog/2026-08-05.mdx`: Record descriptor-bound Shields lock inspection. - [#7892](#7892) -> `docs/changelog/2026-08-05.mdx`: Document the canonical Hermes dashboard profile and migration. - [#7871](#7871) -> `docs/changelog/2026-08-05.mdx`: Document fail-closed Hermes cron restore. - [#7894](#7894) -> `docs/changelog/2026-08-05.mdx`: Record the reset Hermes health budget after recovery. - [#8228](#8228) -> `docs/changelog/2026-08-05.mdx`: Document Hermes build-time corporate CA trust. - [#8206](#8206) -> `docs/changelog/2026-08-05.mdx`: Document bounded Deep Agents Code failure classification. - [#8297](#8297) -> `docs/changelog/2026-08-05.mdx`: Record reuse of the published Deep Agents Code base image. - [#8321](#8321) -> `docs/changelog/2026-08-05.mdx`: Document aligned endpoint SSRF protections and userinfo rejection. - [#8299](#8299) -> `docs/changelog/2026-08-05.mdx`: Document the fail-closed `setpriv` transition in managed images. - [#7603](#7603) -> `docs/changelog/2026-08-05.mdx`: Record corrected confidentiality-root traversal. - [#8334](#8334) -> `docs/changelog/2026-08-05.mdx`: Record removal of the unsupported logs audit example. - [#8256](#8256) -> `docs/changelog/2026-08-05.mdx`: Record reordered network-policy walkthrough prerequisites. - [#7767](#7767) -> `docs/changelog/2026-08-05.mdx`: Record platform runtime shape validation. ## Type of Change - [ ] Code change (feature, bug fix, or refactor) - [ ] Code change with doc updates - [x] Doc only (prose changes, no code sample modifications) - [ ] Doc only (includes code sample changes) ## Quality Gates - [ ] Tests added or updated for changed behavior - [x] Existing tests cover changed behavior — justification: `npx vitest run test/changelog-docs.test.ts` passed all 6 tests. - [ ] Tests not applicable — justification: - [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: ## Documentation Writer Review - [ ] Documentation writer subagent reviewed the completed changes - Result: `docs-updated` - Evidence: `docs/changelog/2026-08-05.mdx` follows the release-prep and documentation writing rules. The changelog contract tests passed 6/6, and `npm run docs` completed with 0 errors and the repository's 2 existing Fern warnings. - Agent: Codex Desktop <!-- docs-review-head-sha: 66fcd80 --> <!-- docs-review-agents-blob-sha: 3dd7c24 --> ## DGX Station Hardware Evidence - [ ] Tested on DGX Station - Tested commit: Not applicable. - Station profile/scenario: Not applicable. - Result: Not applicable. - Supporting evidence: Not applicable. ## Verification - [x] PR description includes a `Signed-off-by:` line and every commit appears as `Verified` in GitHub - [x] Normal `pre-commit`, `commit-msg`, and `pre-push` hooks passed, or `npm run validate:pr` passed after refreshing `origin/main` when hooks were skipped or unavailable - [x] Targeted behavior tests pass for the current change set, or tests are marked not applicable above — `npx vitest run test/changelog-docs.test.ts`: 1 file and 6 tests passed. - [ ] Applicable broad gate passed — `npm test` for broad runtime/test-harness changes; `npm run check` for repo-wide validation/coverage changes — command/result: Not run for this doc-only change. - [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) — completed with 0 errors and 2 existing Fern 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) — the native changelog uses the required parser-safe MDX SPDX comment and does not use page frontmatter. --- Signed-off-by: Charan Jagwani <cjagwani@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Added release notes for v0.0.103. * Documented the new `nemoclaw launch` command. * Included updates covering onboarding, inference, installation, recovery, snapshots, security, integrations, endpoint validation, sandbox hardening, and related guidance. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Summary
Scoped uninstall counted every non-zero
openshell sandbox deleteexit as a cleanup failure, so a host whose recorded sandbox had already been removed preserved the selected gateway state and exited 1 after the gateway registration had already been deleted. The delete now captures its output and classifies the outcome, so an already-removed sandbox finishes the remaining gateway cleanup and exits 0, while an unreachable or rejected delete still preserves the state for a retry and exits nonzero.Related Issue
Fixes #7906
Changes
deleteSelectedGatewaySandboxinsrc/lib/actions/uninstall/run-plan.ts, which runsopenshell sandbox delete <name>with its output captured and treats an already-removed sandbox as success. The scoped delete loop calls it instead ofrunOptional, whosestdio: "ignore"spawn leaves no output to classify.getSandboxDeleteOutcomeclassifier fromsrc/lib/domain/sandbox/destroy.tsrather than adding a second absence pattern.nemoclaw destroyalready depends on it, so both paths agree on what "already gone" means.src/lib/domain/uninstall/messaging.ts:sandboxDeleteAbsentMessagefor a sandbox that leaves nothing to clean up,sandboxDeleteFailureMessagefor one that still leaves state behind. The previous single message named both states at once, so no caller could act on either.run-plan.tsfan-out ceiling inci/source-architecture-budget.jsonfrom 25 to 26 for thedomain/sandbox/destroyimport. The alternative was a duplicate absence pattern in a second file.getSandboxDeleteOutcomealso reportsgatewayUnreachable, which this change deliberately keeps on the failure side: an unreachable gateway leaves real sandbox state on the host, so preserving the selected gateway for a retry stays correct.src/lib/actions/uninstall/run-plan-absent-sandbox.test.tsprotects all three outcomes, andtest/uninstall.test.tsprotects the reported flow end to end.Type of Change
Quality Gates
3a875ee253856a7c2ba007eebe01c0920c9baa07against basefdd68285e2c3e9f7c09ac63029236e108d02d9d1; no security findings. The classifier and cleanup behavior are unchanged by the final documentation commit. The early return preserves retry authority after a failed sandbox deletion and introduces no new secret, input-validation, authorization, dependency, logging, cryptography, configuration, network, resource-control, or privilege risk.Documentation Writer Review
docs-updated3a875ee253856a7c2ba007eebe01c0920c9baa07against basefdd68285e2c3e9f7c09ac63029236e108d02d9d1. The revised test title now describes outcome classification instead of claiming that failed cleanup completes.docs/manage-sandboxes/uninstall-nemoclaw.mdxnow states that unreachable or refused deletion preserves the selected gateway registration, port-scoped state, and selected sandbox registry entry, including with--destroy-user-data, and scopes the non-preservation statement to successful or already-absent deletion. Focused tests passed 3/3,npm run docspassed with 0 errors and 2 unchanged existing warnings, andgit diff --checkpassed.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 unavailable3a875ee253856a7c2ba007eebe01c0920c9baa07, the 3/3 absent-sandbox regression cases passed. Earlier validation of the unchanged behavior patch passed 158 action/domain tests and 11 integration tests. CLI and plugin builds passed, and normal signed commit and push hooks passed.npm testfor broad runtime/test-harness changes;npm run checkfor repo-wide validation/coverage changes — command/result:npm run docspassed with no PR-introduced warnings (doc changes only) — 0 errors and 2 unchanged existing warningsSigned-off-by: Tinson Lai tinsonl@nvidia.com
Signed-off-by: Senthil Ravichandran senthilr@nvidia.com
Summary by CodeRabbit
Bug Fixes
Documentation
Tests