Skip to content

feat(uninstall): sweep every gateway port and report the ones left behind - #7901

Merged
senthilr-nv merged 24 commits into
mainfrom
fix/gateway-port-scope
Aug 4, 2026
Merged

feat(uninstall): sweep every gateway port and report the ones left behind#7901
senthilr-nv merged 24 commits into
mainfrom
fix/gateway-port-scope

Conversation

@laitingsheng

@laitingsheng laitingsheng commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds an explicit whole-host uninstall mode for hosts with NemoClaw environments on more than one gateway port. Ordinary uninstall remains scoped to the selected port; the opt-in sweep processes discovered ports independently, keeps shared resources after any incomplete cleanup, and reports a nonzero outcome when work remains.

Related Issue

Related to #7791.

Changes

  • Add --all-gateway-ports and NEMOCLAW_UNINSTALL_ALL_GATEWAY_PORTS=1 as explicit sweep controls while preserving the existing one-port default.
  • Run non-selected ports in isolated child processes and the selected port last so port-scoped state, gateway names, and Docker resources resolve from the correct environment.
  • Reject a mismatched --gateway before cleanup and fail closed when gateway-process cleanup is incomplete or an unenumerated environment remains.
  • Preserve shared host resources after partial failure, continue independent port cleanup, exit nonzero, and document that completed cleanup is not rolled back.
  • Update command, uninstall, state, and troubleshooting documentation for data preservation, external supervision, recovery, and one-port versus multi-port confirmation.
  • Ratchet the source-architecture budget to the measured current-diff values and add focused behavior/security coverage.

Product Scope

  • Status: approved by the current maintainer in the PR preparation task on 2026-08-03.
  • Approved contract: the opt-in sweep may remove all discovered gateway-port environments, while ordinary uninstall remains sticky and port-scoped; incomplete or unidentified cleanup fails closed and preserves shared resources. It rejects a mismatched gateway before cleanup, respects OpenShell/external-supervisor and user-data preservation controls, and does not roll back cleanup completed before an independent port failure.
  • Decision record: issue #7791 maintainer comment.
  • This approval is recorded independently of mergeStateStatus; it is not inferred from passing tests, review, or CI. The refresh to base a5562015029fd8cdbebdce5664e8b8bfda9d6ba8 did not change the intended behavior; the stable patch ID and all six original PR commits remain unchanged.

Automated Review Disposition

  • All seven GitHub automated-review threads are resolved; six documentation findings were corrected and the CodeQL clear-text logging report was a false positive because the environment value only selects allowlisted branding and is not logged.
  • CodeRabbit timeout nit: declined. There is no accepted cleanup timeout contract, and terminating a child at an arbitrary deadline could interrupt destructive cleanup mid-step; the foreground process remains operator-interruptible.
  • CodeRabbit direct-default test nit: nonblocking. Child arguments/environment, exit mapping, state-root enumeration, coordinator behavior, and failure paths are covered without exposing internal production defaults solely for tests.
  • Current-commit security review: PASS in all nine categories with no PR-diff findings. Updated uninstall, dual-Station, gateway-process, and release coverage passed 111/111, and the localhost gateway identity/release runtime case passed 1/1; the three earlier findings (incomplete process cleanup, delayed gateway-name validation, and unenumerated surviving environments) remain fixed and covered.
  • Documentation-review blocker after fix(inference): recover dual-Station runtime ownership #8158: resolved. A whole-host sweep selected on a non-default port now removes the host-global dual-Station bearer key only after full cleanup is authorized and any managed-pair cleanup succeeds. Scoped cleanup, failed swept ports, and failed managed-pair cleanup preserve the key. The exact reproduction now reports keyRemains:false and selectedRootRemains:false with exit code 0.
  • Current-commit GPT-5.6 Terra and optional Nemotron advisor jobs succeeded. Terra recommends merge_as_is with medium confidence, Nemotron recommends merge_as_is with high confidence, and both canonical finding ledgers are empty. Their runtime-validation recommendation is covered by the required E2E gates tracked below.
  • Documentation-writer suggestion: no change required. The two temporal uses of “once” are unambiguous, preserve the approved behavior and recovery meaning, and are advisory under the writing policy.
  • Documentation-writer test-title suggestion: no change required. The plural “credentials” describes the host-global credential class even though the regression asserts the current API-key artifact; the test body and failure contract are exact.
  • Advisor terminology candidates: no change required. sweep, scoped uninstall, sibling gateway-port environment, host-global, and gateway port are used consistently with the current controlled vocabulary; neither advisor recorded a terminology finding.
  • Base-only corporate-CA test warning: nonblocking and unrelated to this PR. On macOS, the new base's GNU-base64 capability probe accepts FreeBSD base64, so three tests reach a later awk rejection instead of the expected early diagnostic; every invalid payload still fails nonzero. Linux CI is authoritative, and the probe should be tightened in a separate base follow-up rather than adding unrelated work here.
  • Base-only HTTP-probe test warning: nonblocking and unrelated to this PR. One broader focused test times out while its test server's SIGTERM handler waits for server.close(); the bounded-response implementation and all feat(uninstall): sweep every gateway port and report the ones left behind #7901 interaction assertions pass. This teardown issue belongs in a separate base follow-up.
  • Fern warnings: nonblocking and unrelated to this patch. Redirect verification was skipped because this local run had no Fern authentication, and the existing light-mode accent color has a 2.41:1 contrast ratio. Fern reported zero errors.

Type of Change

  • Code change (feature, bug fix, or refactor)
  • Code change with doc updates
  • Doc only (prose changes, no code sample modifications)
  • Doc only (includes code sample changes)

Quality Gates

  • Tests added or updated for changed behavior
  • Existing tests cover changed behavior — justification:
  • Tests not applicable — justification:
  • 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: Codex Desktop security specialist reviewed commit 489a368a5d0ada868cd01c0dacfc1a99e64a15f1 against base a5562015029fd8cdbebdce5664e8b8bfda9d6ba8; no PR-diff security finding, 112 focused tests passed, and unrelated base-test portability warnings were dispositioned above. This is an agent review, not a human sensitive-path owner review or hardware review.
  • 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/manage-sandboxes/uninstall-nemoclaw.mdx, docs/reference/commands.mdx, docs/reference/host-files-and-state.mdx, and docs/reference/troubleshooting.mdx; all 15 changed files and all 12 OpenClaw, Hermes, and Deep Agents generated pages were reviewed; npm run docs passed with 0 errors and 2 unchanged nonblocking Fern warnings; focused documentation/uninstall validation passed 28/28; the non-default-selected sweep reproduction removed the host-global dual-Station key.
  • Agent: Codex Desktop

DGX Station Hardware Evidence

  • Tested on DGX Station
  • Tested commit:
  • Station profile/scenario:
  • Result:
  • Supporting evidence:

Verification

  • PR description includes a Signed-off-by: line and every commit appears as Verified in GitHub
  • 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
  • Targeted behavior tests pass for the current change set, or tests are marked not applicable above — command/result or justification: the canonical 13-file uninstall and host-process regression passed 156/156 with a 30-second runner timeout for unrelated local-host CPU contention; uninstall integration passed 6 host-applicable tests with 4 platform-gated PTY skips; independent updated security coverage passed 112 tests; CLI build and post-build CLI typecheck 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 applicable; the change is confined to uninstall coordination and uses focused CLI/integration suites plus repository hooks. CI is authoritative.
  • Quality Gates section completed with required justifications or waivers
  • No secrets, API keys, or credentials committed
  • npm run docs builds without warnings (doc changes only)
  • Doc pages follow the style guide (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only)

Current Commit and Base Evidence


Signed-off-by: Tinson Lai tinsonl@nvidia.com

…hind

Uninstall is scoped to one gateway port, so the other ports on a host stay
bound with nothing to explain why. Name those environments and print the
command that removes each one, and add --all-gateway-ports (or
NEMOCLAW_UNINSTALL_ALL_GATEWAY_PORTS=1) to remove all of them in one run.
Each port runs as its own uninstall so every port-scoped value resolves from
that port, and the selected port runs last so its pass can still complete the
host-shared cleanup.

Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

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
📝 Walkthrough

Walkthrough

The uninstall command now supports an opt-in sweep across all gateway-port environments. It processes the selected port last, reports remaining environments, preserves failed ports during cleanup, and documents the related flags and environment variable.

Changes

Gateway uninstall flow

Layer / File(s) Summary
Multi-port sweep orchestration
src/lib/actions/uninstall/all-gateway-ports.ts, src/lib/actions/uninstall/all-gateway-ports.test.ts
Adds port enumeration, confirmation, ordered child uninstall passes, recursion prevention, failure aggregation, retained-port handling, and validation tests.
Gateway environment inspection and reporting
src/lib/actions/uninstall/run-plan.ts, src/lib/actions/uninstall/run-plan-other-gateway-report.test.ts, src/lib/tunnel/gateway-port-release.ts
Tracks resolved, retained, and unidentified sibling ports. Reports remaining environments and expands port-selection teardown guidance.
CLI entrypoints and help
src/commands/internal/uninstall/run-plan.ts, src/lib/actions/root-help.ts, uninstall.sh
Adds --all-gateway-ports parsing, dispatch, help output, and wrapper usage documentation.
Uninstall contract documentation
docs/manage-sandboxes/uninstall-nemoclaw.mdx, docs/reference/*.mdx
Documents single-port and whole-host behavior, environment-variable activation, ordering, failure handling, shared-state conditions, and troubleshooting.
Source architecture budget
ci/source-architecture-budget.json
Raises selected per-file fanIn limits.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related issues

  • NVIDIA/NemoClaw issue 7987 — The PR changes gateway enumeration, sibling detection, and cleanup behavior related to the reported uninstall regression.

Possibly related PRs

  • NVIDIA/NemoClaw#7993 — Both changes modify sibling-gateway detection and cleanup behavior in run-plan.ts.

Suggested labels: area: cli

Suggested reviewers: apurvvkumaria, cv

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant InternalUninstallRunPlanCommand
  participant runUninstallAllGatewayPorts
  participant runUninstallPlan
  participant GatewayEnvironmentInspection
  User->>InternalUninstallRunPlanCommand: invoke --all-gateway-ports
  InternalUninstallRunPlanCommand->>runUninstallAllGatewayPorts: dispatch uninstall options
  runUninstallAllGatewayPorts->>GatewayEnvironmentInspection: enumerate gateway ports
  runUninstallAllGatewayPorts->>runUninstallPlan: uninstall non-selected ports
  runUninstallAllGatewayPorts->>runUninstallPlan: uninstall selected port last
  runUninstallPlan-->>runUninstallAllGatewayPorts: return port result
  runUninstallAllGatewayPorts-->>InternalUninstallRunPlanCommand: return aggregate exit code
Loading
🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (3 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The changes address uninstall sweeps and reporting, but do not fix #7791's re-onboarding behavior or reset the port to 8080. Update onboarding logic to ignore persisted override ports when NEMOCLAW_GATEWAY_PORT is unset, or link an accepted design that changes #7791's requirements.
Out of Scope Changes check ⚠️ Warning The pull request primarily adds uninstall sweep behavior and documentation, which is outside #7791's re-onboarding and port-reset objective. Limit the changes to the re-onboarding port-reset fix, or provide a linked issue and accepted design for the uninstall sweep scope.
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: sweeping every gateway port and reporting ports that remain.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/gateway-port-scope

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

@github-actions

Copy link
Copy Markdown
Contributor

@github-code-quality

github-code-quality Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in commit 489a368 in the fix/gateway-port-sco... branch remains at 96%, unchanged from commit a556201 in the main branch.

TypeScript / code-coverage/cli

The overall coverage in commit 489a368 in the fix/gateway-port-sco... branch remains at 81%, unchanged from commit a556201 in the main branch.

Show a code coverage summary of the most impacted files.
File main a556201 fix/gateway-port-sco... 489a368 +/-
src/lib/shields/index.ts 70% 70% 0%
src/lib/actions/root-help.ts 100% 100% 0%
src/lib/onboard...wn-authority.ts 93% 93% 0%
src/lib/sandbox...rce-identity.ts 88% 88% 0%
src/lib/actions...all/run-plan.ts 83% 84% +1%
src/lib/onboard...eway-process.ts 95% 97% +2%
src/lib/state/g...way-registry.ts 94% 97% +3%
src/lib/onboard...eway-cleanup.ts 59% 66% +7%
src/lib/actions...ateway-ports.ts 0% 93% +93%

Updated August 04, 2026 05:39 UTC

Comment thread src/lib/actions/uninstall/all-gateway-ports.ts Fixed

@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: 5

🧹 Nitpick comments (2)
src/lib/actions/uninstall/all-gateway-ports.ts (2)

85-98: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Add a timeout to the child-pass spawnSync.

defaultRunPortPass blocks indefinitely if a child uninstall pass hangs (e.g., a stalled Docker/OpenShell teardown call for a sibling port). Since this sweep is explicitly meant for whole-host/CI cleanup (#7791), an unbounded hang here stalls the entire sweep with no recourse short of killing the parent process.

🕐 Proposed fix
   return spawnExitCode(
     spawnSync(process.execPath, [entry, ...uninstallChildArgs(options)], {
       env: uninstallChildEnv(env, port),
       stdio: "inherit",
+      timeout: PORT_PASS_TIMEOUT_MS,
     }),
   );
🤖 Prompt for 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.

In `@src/lib/actions/uninstall/all-gateway-ports.ts` around lines 85 - 98, Update
defaultRunPortPass so its spawnSync invocation enforces a finite timeout for the
child uninstall pass, using the existing timeout configuration or an appropriate
cleanup-specific limit. Preserve inherited stdio, environment, arguments, and
exit-code handling while ensuring a hung child cannot block the host-wide sweep
indefinitely.

1-1: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Default subprocess-spawning implementations lack direct test coverage. Every sweep test injects fakes for runPortPass/listGatewayPorts, so defaultRunPortPass and defaultListGatewayPorts — the code paths actually used in production — are never exercised.

  • src/lib/actions/uninstall/all-gateway-ports.ts#L63-98: this is the untested production code (defaultListGatewayPorts, uninstallChildArgs, uninstallChildEnv, defaultRunPortPass).
  • src/lib/actions/uninstall/all-gateway-ports.test.ts#L1-147: add a test that mocks node:child_process's spawnSync (and stubs process.argv[1]) to verify defaultRunPortPass builds the expected command/env and maps spawnSync's result correctly, plus a case for the missing-entry (process.argv[1] undefined) fallback.
🤖 Prompt for 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.

In `@src/lib/actions/uninstall/all-gateway-ports.ts` at line 1, Extend
all-gateway-ports.test.ts with direct coverage for the production defaults
defaultRunPortPass and defaultListGatewayPorts by mocking
node:child_process.spawnSync and stubbing process.argv[1]. Verify
defaultRunPortPass constructs the expected uninstall command and environment,
maps spawnSync results correctly, and uses the missing process.argv[1] fallback;
retain existing injected-fake sweep tests.
🤖 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 `@docs/manage-sandboxes/uninstall-nemoclaw.mdx`:
- Around line 37-43: Update the sibling-environment reporting text in the
uninstall documentation to clarify that removal commands are printed only when
an environment’s port is known. Preserve the existing name/reporting behavior
and explicitly account for remaining environments whose ports are unavailable or
unidentified.
- Around line 42-43: Update the two uninstall command examples in the documented
gateway-port section to use the shared CLI placeholder $$nemoclaw instead of the
literal nemoclaw, preserving the existing arguments and environment-variable
usage.

In `@docs/reference/commands.mdx`:
- Line 3427: Update the headings in docs/reference/commands.mdx lines 3427-3427
and docs/reference/troubleshooting.mdx lines 372-372 to title case: capitalize
“Every Gateway Port” and “Gateway Port Stays Bound After Uninstall or
Re-Onboard” respectively.

In `@docs/reference/host-files-and-state.mdx`:
- Around line 83-84: Update the uninstall documentation sentence describing
--all-gateway-ports and NEMOCLAW_UNINSTALL_ALL_GATEWAY_PORTS so it states that
every gateway port is removed, while shared host state is removed only when
--keep-openshell is not used and no failed or live port prevents final cleanup.

In `@docs/reference/troubleshooting.mdx`:
- Line 401: Update the “Uninstall NemoClaw” link in the troubleshooting
documentation to use the published Fern route
../manage-sandboxes/operate-sandboxes/uninstall-nemoclaw, preserving the
existing link text and surrounding content.

---

Nitpick comments:
In `@src/lib/actions/uninstall/all-gateway-ports.ts`:
- Around line 85-98: Update defaultRunPortPass so its spawnSync invocation
enforces a finite timeout for the child uninstall pass, using the existing
timeout configuration or an appropriate cleanup-specific limit. Preserve
inherited stdio, environment, arguments, and exit-code handling while ensuring a
hung child cannot block the host-wide sweep indefinitely.
- Line 1: Extend all-gateway-ports.test.ts with direct coverage for the
production defaults defaultRunPortPass and defaultListGatewayPorts by mocking
node:child_process.spawnSync and stubbing process.argv[1]. Verify
defaultRunPortPass constructs the expected uninstall command and environment,
maps spawnSync results correctly, and uses the missing process.argv[1] fallback;
retain existing injected-fake sweep tests.
🪄 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: e7c8ca0f-d69d-42ec-b2ba-e39aaf1fae77

📥 Commits

Reviewing files that changed from the base of the PR and between 4dcb89e and 9d624b0.

📒 Files selected for processing (13)
  • ci/source-architecture-budget.json
  • docs/manage-sandboxes/uninstall-nemoclaw.mdx
  • docs/reference/commands.mdx
  • docs/reference/host-files-and-state.mdx
  • docs/reference/troubleshooting.mdx
  • src/commands/internal/uninstall/run-plan.ts
  • src/lib/actions/root-help.ts
  • src/lib/actions/uninstall/all-gateway-ports.test.ts
  • src/lib/actions/uninstall/all-gateway-ports.ts
  • src/lib/actions/uninstall/run-plan-other-gateway-report.test.ts
  • src/lib/actions/uninstall/run-plan.ts
  • src/lib/tunnel/gateway-port-release.ts
  • uninstall.sh

Comment thread docs/manage-sandboxes/uninstall-nemoclaw.mdx Outdated
Comment thread docs/manage-sandboxes/uninstall-nemoclaw.mdx Outdated
Comment thread docs/reference/commands.mdx Outdated
Comment thread docs/reference/host-files-and-state.mdx Outdated
Comment thread docs/reference/troubleshooting.mdx Outdated
@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — No blocking findings reported

Advisor assessment: No blocking advisor findings reported
Next action: No advisor follow-up needed.
Findings: 0 blockers · 0 warnings · 0 suggestions

Model lanes

  • GPT-5.6 Terra (primary): Completed · medium confidence · 0 blockers · 0 warnings · 0 suggestions
  • Nemotron 3 Ultra (second opinion): Completed · high confidence · 0 blockers · 0 warnings · 0 suggestions
  • Model comparison: normalized findings match; normalized terminology decisions differ; normalized E2E selections differ; severity counts match.
5 terminology differences from the second opinion

Advisory only. These are normalized differences from the primary terminology receipt.

  • sibling gateway at src/lib/actions/uninstall/run-plan-other-gateway-report.test.ts:88: selected only by the second-opinion lane as established.
  • host-global at src/lib/actions/uninstall/all-gateway-ports.test.ts:162: selected only by the second-opinion lane as established.
  • gateway port at docs/manage-sandboxes/uninstall-nemoclaw.mdx:26: selected only by the second-opinion lane as established.
  • unidentified environment at docs/manage-sandboxes/uninstall-nemoclaw.mdx:65: selected only by the second-opinion lane as define.
  • sweep at src/lib/actions/uninstall/all-gateway-ports.ts:5: selected only by the second-opinion lane as justified.
3 additional E2E selections from the second opinion

Advisory only. The primary lane did not select these E2E jobs or targets.

  • sandbox-operations: The completed second-opinion lane identified E2E coverage that the primary lane omitted.
  • sandbox-survival: The completed second-opinion lane identified E2E coverage that the primary lane omitted.
  • state-backup-restore: The completed second-opinion lane identified E2E coverage that the primary lane omitted.

Second-opinion terminology and E2E selections are advisory. They do not change the primary assessment or E2E / PR Gate.

3 semantic terminology decisions

Terminology decisions are advisory. They affect the assessment only when a separate finding identifies concrete semantic impact.

  • justified — whole-host uninstall at src/lib/actions/uninstall/all-gateway-ports.ts:5: Keep "whole-host uninstall" where the text must distinguish the explicit all-port sweep from a selected-port uninstall.
  • established — gateway-port environment at docs/reference/commands.mdx:3496: Keep the established term for a separately scoped gateway instance.
  • define — unidentified environment at docs/reference/commands.mdx:3497: Keep the adjacent definition and operational limit that the sweep cannot select this environment until its gateway port is determined.

E2E guidance

Advisory only. E2E / PR Gate selects and runs jobs independently.

Recommended E2E: onboard-repair, onboard-resume, cloud-onboard

1 optional E2E recommendation
  • concurrent-gateway-ports

Workflow run details

This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge.

@laitingsheng laitingsheng added NV QA Bugs found by the NVIDIA QA Team area: sandbox OpenShell sandbox lifecycle, runtime, config, or recovery bug-fix PR fixes a bug or regression feature PR adds or expands user-visible functionality and removed bug-fix PR fixes a bug or regression labels Jul 30, 2026
Signed-off-by: Tinson Lai <tinsonl@nvidia.com>

@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 current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/reference/commands.mdx`:
- Line 3430: Verify the uninstall reporter in the checked-in source and update
this documentation sentence to match its behavior: since the command is emitted
only for the first sibling gateway-port environment, say it provides a command
to remove one of them rather than each listed environment. Preserve the existing
references to naming the environments and the whole-host sweep.
🪄 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: 7d144147-4153-4301-9269-0f457537bd91

📥 Commits

Reviewing files that changed from the base of the PR and between 9d624b0 and 222e19c.

📒 Files selected for processing (8)
  • docs/manage-sandboxes/uninstall-nemoclaw.mdx
  • docs/reference/commands.mdx
  • docs/reference/host-files-and-state.mdx
  • docs/reference/troubleshooting.mdx
  • src/lib/actions/uninstall/all-gateway-ports.test.ts
  • src/lib/actions/uninstall/all-gateway-ports.ts
  • src/lib/actions/uninstall/run-plan-other-gateway-report.test.ts
  • src/lib/actions/uninstall/run-plan.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • docs/reference/host-files-and-state.mdx
  • docs/reference/troubleshooting.mdx
  • docs/manage-sandboxes/uninstall-nemoclaw.mdx

Comment thread docs/reference/commands.mdx Outdated
@cjagwani

Copy link
Copy Markdown
Collaborator

Maintainer review at exact head c1bf665b58f5460073edf796c5e89999261f6b80: this is blocked by the product-scope gate. The linked issue #7791 records that persisted per-port binding is intentional and explicitly asks a maintainer to choose among sticky binding, rebind-on-unset, or a separate rebind command before implementation. This PR instead adds a new supported --all-gateway-ports / NEMOCLAW_UNINSTALL_ALL_GATEWAY_PORTS=1 whole-host uninstall surface, but I could not find an accepted maintainer decision defining that surface, its lifecycle contract, or how it satisfies the issue acceptance criteria. The exact-head advisor independently reports the same acceptance mismatch. Please record the maintainer product decision on #7791 (or link the accepted design here) before this can be approved. The implementation has 53 green current checks, DCO and Verified commits; I am not requesting a base refresh solely for currency.

@copy-pr-bot

copy-pr-bot Bot commented Aug 1, 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.

@cjagwani

cjagwani commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

Exact-head babysitting update for 3fb51da7e044f2bce1699043ab362af002908a0a (plain comment; no Changes Requested review): the product-scope gate remains blocked. Issue #7791 still has no accepted maintainer decision choosing sticky binding, rebind-on-unset, or a separate supported rebind command, so the new whole-host uninstall/rebinding surface still lacks an approved lifecycle contract. Exact-head ordinary CI passed, but native E2E run 30699967781 timed out after six hours waiting for trusted coordination; no protected E2E verdict surfaced. Its captured base 77ebb5b80a1aa5b4d636f105632ed869c553a6d7 is no longer current. I did not rerun or approve this head, and I am not asking for a base refresh solely for currency.

@laitingsheng laitingsheng removed the NV QA Bugs found by the NVIDIA QA Team label Aug 3, 2026

@senthilr-nv senthilr-nv 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.

Reviewed Files changed at commit 0a2837f. Product scope is approved, and the security and documentation findings are resolved. Approved.

@senthilr-nv

Copy link
Copy Markdown
Collaborator

Automated-review disposition for commit 0a2837f41223d16d990f5a2d6ac133c23b67bb2f:

  • Optional PR review advisor (Nemotron 3 Ultra) failed because its scope-risk-map-analysis turn exceeded the workflow's 900-second analysis timeout.
  • The job explicitly reported that advisor analysis did not produce a summary. It posted no finding or review comment to disposition.
  • The paired GPT-5.6 Terra advisor passed. CodeRabbit, CodeQL, the independent security review, and the documentation-writer review also completed with no actionable finding remaining.

This is recorded as an optional advisor infrastructure/timeout failure, not a required-check waiver and not evidence that the Nemotron review passed.

Failed job: https://github.com/NVIDIA/NemoClaw/actions/runs/30834952807/job/91757748397

@github-actions github-actions Bot added v0.0.102 Release target and removed v0.0.101 labels Aug 3, 2026
@senthilr-nv

Copy link
Copy Markdown
Collaborator

Product scope is approved independently of GitHub merge status for commit 60434b2. The approved surface is an explicit opt-in whole-host uninstall across discovered gateway ports; ordinary uninstall remains port-scoped. Discovery and incomplete cleanup fail closed, shared resources remain preserved when work is incomplete, external supervision and user-data preservation still apply, and completed independent cleanup is not rolled back. Decision record: #7791 (comment)

@senthilr-nv

Copy link
Copy Markdown
Collaborator

Optional-check disposition for commit 60434b2: Nemotron 3 Ultra analysis did not complete in workflow run https://github.com/NVIDIA/NemoClaw/actions/runs/30866895968. It published no summary, review thread, or actionable finding. Repository policy treats this advisor as optional; the required GPT-5.6 Terra advisor passed, so this optional infrastructure failure is reported separately and is not a merge blocker.

@senthilr-nv

Copy link
Copy Markdown
Collaborator

Product-scope approval applies to current commit aa46e8d on base 6a838ff. The signed upstream/main refresh left the reviewed PR patch byte-for-byte unchanged. The approved contract remains: ordinary uninstall is sticky and gateway-port scoped; the explicit opt-in whole-host sweep may remove all discovered gateway-port environments, fails closed on incomplete or unidentified cleanup, preserves shared resources when cleanup is incomplete, respects preservation and external-supervision controls, and does not roll back completed independent cleanup. This product decision is recorded independently of GitHub mergeStateStatus.

@senthilr-nv

Copy link
Copy Markdown
Collaborator

Product-scope approval applies to current commit 134b2a3 on base 5f87afa. The signed upstream/main refresh left the reviewed PR patch byte-for-byte unchanged. The approved contract remains: ordinary uninstall is sticky and gateway-port scoped; the explicit opt-in whole-host sweep may remove all discovered gateway-port environments, fails closed on incomplete or unidentified cleanup, preserves shared resources when cleanup is incomplete, respects preservation and external-supervision controls, and does not roll back completed independent cleanup. This product decision is recorded independently of GitHub mergeStateStatus.

@senthilr-nv

Copy link
Copy Markdown
Collaborator

Product-scope approval remains in force for current commit e493d7a on base 7e60e11. The approved contract is unchanged: ordinary uninstall remains port-scoped; the whole-host sweep is explicit opt-in, fails closed on incomplete or unidentified cleanup, preserves shared resources when work remains, respects preservation and external-supervision controls, and does not roll back completed independent cleanup. Decision record: #7791 (comment). This product decision is recorded independently of mergeStateStatus.

@senthilr-nv

Copy link
Copy Markdown
Collaborator

Product-scope approval remains in force for current commit 27e0a86 on base 95a9d6f. The approved contract is unchanged: ordinary uninstall remains port-scoped; the whole-host sweep is explicit opt-in, fails closed on incomplete or unidentified cleanup, preserves shared resources when work remains, respects preservation and external-supervision controls, and does not roll back completed independent cleanup. Decision record: #7791 (comment). This product decision is recorded independently of mergeStateStatus.

@senthilr-nv senthilr-nv 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.

Reviewed Files changed at commit 27e0a86. Product scope remains approved; the refreshed base does not change the intended uninstall behavior, and the security and documentation findings are resolved. Approved.

@senthilr-nv

Copy link
Copy Markdown
Collaborator

Product-scope decision for current commit 46d3d90291fe7c5a42c2cdffefd5969ba0b1964d on base 3fb4ac1d37bec961f494ca39faf996c990b9d06b: maintainer approval remains in effect for the explicit opt-in whole-host uninstall surface. Ordinary uninstall remains port-scoped; the opt-in sweep may remove all discovered gateway-port environments, fails closed on incomplete or unidentified cleanup, preserves shared resources after partial failure, respects preservation and external-supervision controls, and does not roll back already completed independent cleanup. The refresh leaves the reviewed patch byte-identical (SHA-256 1b11d9a93fca2e72da9e2f227072724c0fdf9253ee8e499ff0838480810b07ff). This product decision is recorded independently of GitHub mergeStateStatus; it does not claim human code review, sensitive-path owner review, or hardware review.

@senthilr-nv

Copy link
Copy Markdown
Collaborator

Product-scope decision and finding disposition for current commit 489a368a5d0ada868cd01c0dacfc1a99e64a15f1 on base a5562015029fd8cdbebdce5664e8b8bfda9d6ba8: the approved explicit opt-in whole-host uninstall contract remains unchanged. The #8158 composition finding is resolved: a successful unscoped cleanup now removes the host-global dual-Station bearer key whether no receipt remains or exact managed-pair cleanup succeeds; scoped cleanup, failed swept ports, and failed managed-pair cleanup preserve it. The non-default-selected sweep reproduction now reports exit code 0 with both keyRemains:false and selectedRootRemains:false. Documentation writer and nine-category security rereviews pass. Product approval remains recorded independently of GitHub mergeStateStatus; no human sensitive-path-owner or hardware review is claimed.

@senthilr-nv
senthilr-nv merged commit b22cd67 into main Aug 4, 2026
91 of 93 checks passed
@senthilr-nv
senthilr-nv deleted the fix/gateway-port-scope branch August 4, 2026 05:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: sandbox OpenShell sandbox lifecycle, runtime, config, or recovery feature PR adds or expands user-visible functionality v0.0.102 Release target

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants