Repository navigation
feat: add standalone clean uninstall for demo devices - #1598
Conversation
Provide dry-run-first PowerShell cleanup with native Gateway teardown, guarded profile and model removal, and an All scope shortcut. Extend the uninstall skill and cover safety boundaries with isolated regressions. Co-authored-by: Copilot App <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. Reviewed October 6, 2026, 4:09 PM ET / 20:09 UTC (Revision 9). ClawSweeper reviewWhat this changesAdds a standalone PowerShell tool, operator instructions, and safety tests for previewing and removing selected OpenClaw installations, profiles, models, and WSL distributions. Merge readiness⛔ Blocked before merge - 8 items remain Keep open: the standalone workflow remains useful and is absent from current main, but both prior package-admission defects remain. Passing CI resolves the earlier test failure, not the destructive-cleanup safety gaps. Priority: P2 Review scores
Verification
How this fits togetherThe cleanup tool inventories Windows installations and local state, then applies operator-confirmed removal. Native Gateway teardown precedes package removal, followed by residual-state cleanup and absence checks. flowchart TD
A[Operator scope and confirmation] --> B[Inventory installations and state]
B --> C[Validate ownership and preservation]
C --> D[Preview exact targets]
D --> E[Confirmed native teardown]
E --> F[Remove packages and selected state]
F --> G[Verify removal and preservation]
Before merge
Findings
Agent review detailsSecurityNeeds attention: Package admission crosses a publisher trust boundary without validating the publisher. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the standalone workflow, enforce trusted package identities and explicit development consent, and verify removal and preservation on disposable existing installations before landing. Do we have a high-confidence way to reproduce the issue? Yes, source establishes both introduced triggers: default selection admits the development Gateway, and a same-name foreign-publisher package reaches teardown and removal. No destructive execution was performed. Is this the best way to solve the issue? No, the current package selector undermines the otherwise guarded workflow; mirror the existing exact identity contract and require development opt-in. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 791574ddf557. LabelsLabel changes: No label changes. Label justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (8 earlier review cycles)
|
Address all seven accepted Hanselman findings with isolated regressions, including real short-path TEMP handling and supported Inno version metadata. Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Use Windows profile deletion for exact unloaded isolated-profile registrations, with preview, elevation, SID/path rechecks and preservation gates. Never infer ownership from a folder name or select these profiles through -All. Co-authored-by: Copilot App <[email protected]>
Scoped maintainer triage verdictHOLD_FOR_AUTHOR. Take confidence: 10%. Recommendation confidence: 98%. Reviewed head: Basis and remaining gatesTwo source-level admission defects remain: default package selection includes the development Gateway identity OpenClaw.Gateway, and selection by package Name lacks Publisher qualification before package-qualified alias execution/removal. Require explicit dev opt-in and verified full package identity/publisher. Current hosted failure includes the PR-owned StandaloneCleanup_PassesIsolatedSafetyRegressions test. Mocked scenarios and read-only preview do not prove destructive package/CIM/profile cleanup. Never run this path on a shared developer profile. To reach 90%+ take confidencekarkarl: exclude dev Gateway identity by default; qualify package publisher and identity before alias execution/removal; fix own failing safety test. Then disposable-profile/CIM/package allow-deny proof. Floor + Installer/ARM64. Here, Floor means final-head Quoted execution results are author/maintainer receipts reviewed during the scoped triage, not tests rerun by this posting session. Missing or stale-head proof is not a pass. A dedicated child session is preparing a read-only revalidation/closeout plan; no implementation, destructive execution, CI rerun or merge is authorized by this verdict. |
Clear the inherited PSModulePath in the test child process so Windows PowerShell 5.1 resolves its own inbox modules instead of PowerShell 7 modules passed through the CI test host. Co-authored-by: Copilot App <[email protected]>
What Problem This Solves
Demo-device operators need a repeatable OpenClaw clean-retest procedure that works without Copilot, a build environment, or remembered cleanup commands.
User Impact
User impact: copy
scripts\clean-uninstall.ps1to a Windows test device and preview cleanup with Windows PowerShell 5.1. Repeat with-ConfirmDestructiveto apply.-Allenables dev-state, receipt-backed cached-model, and owned release/dev WSL cleanup together.-All -ExcludeCachedModelspreserves external shared cached models while selecting the other built-in scopes. Exclusion overrides explicit-RemoveCachedModelstoo. Extra app-data profiles remain explicit-AdditionalProfilePatharguments.-RemoveIsolatedProfilePathseparately selects exact leftover Windows isolated-profile directories, including registrations whose folders were manually deleted. Only unloaded, non-specialS-1-5-110profiles directly under WindowsProfilesDirectoryqualify. This is never implied by-All. Applying requires elevated Windows PowerShell as the same affected user; there is no automatic elevation. Unselected isolated profiles are reported with ownership unverified, not presumed to belong to OpenClaw.Confirmed cleanup permanently deletes selected identities, conversations, settings, and WSL filesystems. Models inside deleted app/Windows profiles or WSL filesystems are still removed even with
-ExcludeCachedModels. Diagnostic ZIP preservation is not a recoverable state backup. Explicit Windows profile cleanup removes registration and files, not unrecorded MXC backend sessions or local accounts.Preserved WSL storage must not overlap cleanup targets. The usual
%LOCALAPPDATA%\OpenClawTray\wsl\OpenClawGatewaylocation blocks default cleanup: explicitly select-RemoveWslGateway, or relocate the distro using supported WSL tools first. Choosing No in Inno does not make deleting a parent profile safe.Why This Change Was Made
Extends the existing uninstall skill using the prior native hard-clean procedure and Pedro's wiper as references, while keeping the legacy dev/WSL engine procedure distinct.
The script inventories exact targets, runs native Gateway teardown before package removal, keeps Inno interactive, and removes residual state only after teardown/unregistration checks. PID identity, protected-path/reparse, model-provenance/digest, startup ownership, and preserved-WSL checks stop uncertain cleanup. Explicit Windows profiles use
Remove-CimInstanceon freshly revalidatedWin32_UserProfilerecords, with SID/path/load-state checks and registration/directory absence verification. There is no fallback to deleting profile registry keys or sweepingC:\Usersby name pattern.Evidence
Thirty isolated PowerShell scenarios pass, including explicit profile cleanup with missing directories, dangerous/ambiguous target rejection, identity changes, provider failures, elevation/WhatIf gates, WSL/report overlap, and successful removal with no installed packages while retaining unselected profiles. The Shared suite runs the harness automatically. Cached-model opt-out binding coverage remains in the suite.
A live read-only preview selected the two user-reported missing-directory profile registrations and explicitly preserved six other isolated profiles. No actual Windows profile deletion was run. Rubber-duck review of this addition found no remaining blocking issues after fixing a lifecycle-wiring bug caught by the new apply regression.
Earlier Hanselman review used Claude Opus 5.5 and GPT-6 Astra independently; seven accepted findings and verified delta issues were addressed. The earlier short-path fix also passed a real 8.3 TEMP-alias harness run at
dd891023. Structured autoreview remains unavailable because Python/Codex tooling is missing. This PR stays draft pending disposable-device destructive proof.Change Type
Scope
winnodeRequired proof pools
windows-clean-installer-upgrade: prove native Gateway teardown, MSIX/Inno removal, residual profiles/models, optional WSL removal, and explicit Windows profile registration/file removal on a disposable device.windows-11-arm64: verify real destructive behavior on ARM64; local ARM64 builds and mocked operations alone do not establish it.Validation
Head:
b1afc9439fc0e95beaadbc264f1f390ac825d9cb. Tests used this worktree'sOPENCLAW_REPO_ROOTand an isolatedOPENCLAW_TRAY_DATA_DIR.powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\build.ps1: PASS, all five build targets.dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore --logger 'console;verbosity=minimal': PASS, 4,223 passed, 35 skipped, 0 failed on final full rerun.dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore --logger 'console;verbosity=minimal': PASS, 3,862 passed, 0 skipped, 0 failed.powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\scripts\test-clean-uninstall.ps1: PASS, 30 isolated scenarios.powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\scripts\validate-agent-skills.ps1: PASS, 8 skills and 17 Markdown files.git diff --check: PASS before commit.An initial Shared run hit the unrelated existing Markdown scaling threshold (751ms versus <500ms).
dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore --filter 'FullyQualifiedName=OpenClaw.Shared.Tests.MarkdownParserFuzzTests.Build_ManyListItems_ScalingCurve' --logger 'console;verbosity=minimal'then passed (1 test). All three required commands were rerun and passed without changing that test or its threshold.python .\.agents\skills\autoreview\scripts\autoreview --mode localwas blocked on the initial head by missing Python (exit 9009); Codex is unavailable. New-head CI must still pass; these are local results.Real Behavior Proof
b1afc9439fc0e95beaadbc264f1f390ac825d9cb(final source tested and committed unchanged).powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\scripts\test-clean-uninstall.ps1; live PowerShell preview invoked.\scripts\clean-uninstall.ps1 -All -ExcludeCachedModels -RemoveIsolatedProfilePath $paths, where$pathscontained exactly the two user-reported directories. No confirmation was supplied.Isolated harness output:
Yes/No/N/A): N/A; CLI-only change, redacted copied output above.Remove-CimInstancedeletion of real isolated profiles, Windows removal timing/locked-file behavior, and full native/MSIX/Inno/WSL destructive proof on disposable signed-artifact installations. Ordinary user profiles, unregistered residual directories, UNC targets, and reparse-point profile roots are unsupported. Native backend session/account removal is not replaced by explicit profile cleanup.Security Impact
Yes/No): Yes; explicit Windows profile deletion requires an elevated token. No automatic elevation.Yes/No): Yes; cleanup can delete selected credential/profile files and preserve local diagnostic ZIPs.Yes/No): No.Yes/No): Yes.Yes/No): Yes.Yes, explain the risk and mitigation: preview and destructive confirmation remain separate. Native teardown uses the selected package alias. Explicit Windows profiles require operator-selected paths plus unloaded/non-special isolated SID identity, root/path checks, preflight elevation, fresh identity checks, and provider-result verification. Unknown ownership is reported, never inferred from names. Shared model exclusion wins over removal flags, but data inside explicitly deleted containers is not retained. Reports remain local and may contain sensitive diagnostics. The tool targets quiescent trusted test devices, not hostile concurrent filesystem mutation.Compatibility and Migration
Yes/No): Yes; existing removal scopes are not expanded automatically. Unselected isolated-profile inventory now produces advisory warnings, and unreadable inventory remains a fail-closed condition.Yes/No): No persistent configuration changes. Run as the affected user; elevation is additionally required only when applying explicit Windows profile removal. Clear path overrides and supply extra paths explicitly.Yes/No): No.Review Conversations
App-native reviews were addressed locally. These unchecked boxes do not assert that every GitHub bot review thread has been resolved.