Skip to content

feat: add safe CLI script uninstallers - #1008

Draft
bbednarski9 wants to merge 9 commits into
NVIDIA:mainfrom
bbednarski9:bbednarski/installer-uninstall
Draft

feat: add safe CLI script uninstallers#1008
bbednarski9 wants to merge 9 commits into
NVIDIA:mainfrom
bbednarski9:bbednarski/installer-uninstall

Conversation

@bbednarski9

@bbednarski9 bbednarski9 commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Overview

Add supported, safety-first uninstall scripts for NeMo Relay CLI binaries installed with install.sh or install.ps1. The scripts provide a clean reinstall path without removing Relay configuration, output, PATH entries, or coding-agent integrations.

  • I confirm this contribution is my own work, or I have the right to submit it under this project's license.
  • I searched existing issues and open pull requests, and this does not duplicate existing work.

Details

  • Add root-level Unix shell and PowerShell uninstallers with matching default install locations, custom install-directory support, dry-run support, idempotent absent-install handling, and explicit help text.
  • Limit removal to the selected installed nemo-relay binary. Preserve its installation directory, PATH changes, Relay configuration and observability output, and managed coding-agent integrations.
  • Refuse a normal uninstall while the selected binary has active Relay processes.
  • Keep force mode interactive and prompt once per detected shutdown tree:
    • For an MCP Relay process, select a recognized Codex, Claude, or pi ancestor when one can be established.
    • If no coding-agent owner can be established, target only the Relay MCP process instead of guessing that an adjacent shell, plugin host, or supervisor owns it.
    • Deduplicate multiple MCP processes owned by the same coding-agent process.
  • Refuse force shutdown when the proposed target is an ancestor of the uninstaller itself. This prevents the script from killing its own shell before binary removal and directs the user to rerun from an independent terminal.
  • Verify the installed executable's identity, including binaries launched through PATH or by absolute path. Immediately before signaling, revalidate the target relationship and stable process identity (parent/start time on Unix; parent/creation time/executable path on Windows) to avoid PID-reuse races.
  • Treat an exited-but-unreaped Unix zombie as stopped so binary removal does not wait on a parent process to reap it.
  • Emit PowerShell process diagnostics directly to stderr so $ErrorActionPreference = 'Stop' does not bypass dry-run or force-confirmation control flow.
  • Keep process safety in the standalone uninstallers so a current script can remove an older script-installed CLI that does not provide a newer package-uninstall command.
  • Document default and custom-directory uninstall, package-manager alternatives, optional integration cleanup, and the download-first PowerShell invocation required for -Force or -InstallDir.
  • Add the uninstallers and their tests to the existing installer CI path filter and Linux, macOS, and Windows matrix.

The change is not breaking. Existing CLI-managed integrations remain installed unless the user explicitly runs nemo-relay uninstall all before removing the binary.

Validation:

  • sh scripts/test-install.sh
  • sh scripts/test-install-mocks.sh
  • sh scripts/test-uninstall.sh — 8 groups, including active-process refusal, accepted/rejected force confirmation, process-tree termination, MCP-owner deduplication, absolute-path discovery, and self-tree refusal
  • pwsh -NoProfile -NonInteractive -ExecutionPolicy Bypass -File scripts/test-uninstall.ps1
  • PowerShell parser validation
  • YAML parsing and git diff --check
  • GitHub Check / Run passed, including repository pre-commit checks
  • Installer matrix passed on Linux x86-64/ARM64, macOS ARM64, and Windows x86-64/ARM64
  • Fern content validation passed; the current preview publication failure is in the remote ledger's theme-asset upload step
  • The current Windows ARM Go failure is an unrelated existing clang -mthreads toolchain issue

Where should the reviewer start?

Start with the shutdown policy in uninstall.sh and uninstall.ps1, especially MCP-owner resolution, self-tree refusal, and process-identity revalidation. Then review scripts/test-uninstall.sh for the destructive process-tree scenarios and scripts/test-uninstall.ps1 for Windows active-process, dry-run, and confirmation coverage.

Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)

Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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

@github-actions github-actions Bot added size:L PR is large Feature a new feature labels Sep 8, 2026
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

@bbednarski9 bbednarski9 added this to the 0.9 milestone Sep 8, 2026
@bbednarski9 bbednarski9 self-assigned this Sep 8, 2026
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
@github-actions github-actions Bot added size:XL PR is extra large and removed size:L PR is large labels Sep 8, 2026
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature a new feature size:XL PR is extra large

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant