Skip to content

docs: document safe uninstall and dev cleanup - #1383

Merged
shanselman merged 6 commits into
mainfrom
pr/1275-validate
Sep 9, 2026
Merged

shanselman merged 6 commits into
mainfrom
pr/1275-validate

Conversation

@shanselman

Copy link
Copy Markdown
Collaborator

Summary

Current-main replacement for #1275 (docs: add uninstall info to README and uninstall skill), preserving Pedro Larroy's uninstall documentation and dev-cleanup procedure with final safety corrections.

  • adds a user-facing uninstall section to README and docs/SETUP.md;
  • adds .agents/skills/uninstall/SKILL.md for safely exercising the existing headless dev uninstall path;
  • requires a verified -DevBuild identity and matching architecture;
  • stops only the resolved dev executable by PID;
  • performs dry-run and explicit destructive confirmation;
  • refuses destructive execution while data-directory or exec-state overrides can redirect cleanup;
  • verifies the dry-run resolved exactly the expected OpenClawTray-Dev directories;
  • documents which gateway identities and root tokens are preserved or cleared;
  • documents current-run log retention and the actual cleanup postconditions.

Required proof pools

  • none: documentation and agent instructions only; no runtime code or registration changes.

Validation

  • .\scripts\validate-docs.ps1: passed, 48 Markdown files checked
  • proof-pool validation: passed, 7 named pools checked
  • documentation flow regression: passed
  • git diff --check: passed
  • structured review of the final safety correction: clean, confidence 0.93

Review disposition

The current-main review found and fixed two real documentation defects from the original branch:

  • inherited OPENCLAW_TRAY_DATA_DIR, OPENCLAW_TRAY_LOCALAPPDATA_DIR, OPENCLAW_TRAY_LOCAL_DATA_DIR, or OPENCLAW_STATE_DIR could redirect a destructive dev uninstall away from the documented paths;
  • root operator/node tokens are cleared when no external gateway record remains, not only when the removed gateway was the sole gateway.

A finding that exec-approvals.json survives uninstall was rejected as outdated: current TrayArtifactCleanup explicitly deletes active and legacy approvals files from roaming/local state.

Real behavior proof

The original contributor proof exercised the real native Windows dev uninstall path and documented distro removal and cleanup results. The runtime absent-distro fix is already merged separately through #1348 (fix(setup): let uninstall recover from absent WSL distro); this PR is documentation-only.

Supersedes #1275 (docs: add uninstall info to README and uninstall skill).

plarroy-nv and others added 6 commits September 9, 2026 16:14
- README: add an Uninstall section (GUI path, AppData cleanup note,
  link to docs/SETUP.md#uninstalling).
- .agents/skills/uninstall: new skill documenting the headless
  --uninstall --dry-run / --confirm-destructive CLI path on a dev
  build, including architecture matching, WSL distro checks, and
  verification steps.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
- README: the Windows installer uninstall prompts Yes/No for removing the
  local WSL gateway (installer.iss:177 EnsureLocalGatewayCleanupChoice);
  choosing No preserves it. Previous wording implied it always happens.
- uninstall skill: TrayArtifactCleanup (src/OpenClaw.SetupEngine/
  TrayArtifactCleanup.cs) resets/removes selected files in place and does
  not delete the AppData roots, so asserting Test-Path on
  %APPDATA%\OpenClawTray[-Dev] / %LOCALAPPDATA%\OpenClawTray[-Dev] can
  report a successful uninstall as failed. Check the specific artifacts
  the cleanup actually removes (Logs dir, run.marker) instead.

Addresses ClawSweeper review findings on PR #1275.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
- Require -DevBuild and verify app-identity.txt before running the
  headless uninstall skill; .\build.ps1 alone defaults to release
  identity, which would touch the real gateway/AppData state instead
  of the -Dev copies.
- Kill only the resolved dev-build PID, not by process name, matching
  this repo's kill-by-PID-only convention.
- Use RuntimeInformation.OSArchitecture for ARM64 detection instead of
  a WMI/CIM query, matching existing repo convention.
- Fix a stale step cross-reference, drop an em dash per AGENTS.md, and
  broaden the skill's postcondition checklist and description beyond
  just WSL/Logs.
- Narrow the README/SETUP.md claim that device identity files are
  never removed automatically: choosing Yes to remove the local
  gateway does delete that gateway's identity directory and can clear
  root device tokens.
- Add the missing headless-CLI pointer and Yes/No gateway-cleanup
  wording to docs/SETUP.md#uninstalling so it matches what the README
  promises there.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
The default headless uninstall cannot remove the roaming Logs directory:
Setup Engine opens its log and journal under Logs\Setup and only disposes
them at process exit, after TrayArtifactCleanup has already tried. Assert
that Logs\Setup retains only the current run's files instead of requiring
the directory to be absent, matching the observed current-head behavior.
Refuse destructive dev uninstall instructions when data-path overrides are active and document the actual external-gateway condition for preserving root device tokens.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 4f97b3a3-def7-4f33-b7d5-ece171b4fd0b
@clawsweeper

clawsweeper Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@shanselman shanselman added P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. labels Sep 9, 2026
@clawsweeper

clawsweeper Bot commented Sep 9, 2026

Copy link
Copy Markdown

ClawSweeper status: review started.

I am starting a fresh review of this pull request: docs: document safe uninstall and dev cleanup This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@shanselman
shanselman merged commit 3edc9b1 into main Sep 9, 2026
18 checks passed
@shanselman
shanselman deleted the pr/1275-validate branch September 9, 2026 23:31
@shanselman shanselman removed the status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. label Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants