Repository navigation
fix: preserve normal installs during isolated patch cleanup - #1951
Conversation
Add an explicit exact development patch and disposable Companion profile scope, bound to an unchanged preview and verified native teardown. 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. What this changesAdds explicit cleanup of one development Gateway patch and selected disposable Companion directories, guarded by an unchanged preview digest. Example: Clean development patch pr225-test while retaining the normal Companion and Store Gateway.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 4 items remain Keep open: this maintainer-authored draft adds a useful cleanup scope absent from main; no discrete introduced code defect was found. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe standalone PowerShell cleanup script consumes current-user package, session, process and filesystem inventories, delegates session teardown to the selected package CLI, then unregisters that package and deletes approved directories. flowchart TD
A[Explicit patch and profile scope] --> B[Package and ownership inventory]
B --> C[Preview digest and consent]
C --> D[Package qualified teardown CLI]
D --> E[Revalidate ownership and state]
E --> F[Unregister selected patch]
F --> G[Delete selected disposable directories]
Technical reviewBest possible solution: Keep exact-scope selection in the standalone cleanup owner and delegate MXC session removal to the registered patch's lifecycle CLI. Do we have a high-confidence way to reproduce the issue? Source confirms that main's standalone script cannot express isolated-patch-only cleanup and always enters ordinary cleanup; no target code was run during this read-only review. Is this the best way to solve the issue? The maintainer-authorized standalone scope is coherent: existing source-build unregister requires its packaging checkout and does not provide preview-bound disposable-directory cleanup; the added checks serve distinct safety invariants. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against a4dd026cc5f8. Merge-risk optionsMaintainer options:
Provenance checked
TestingProof path: in-process harness. SecurityNeeds attention: No concrete security defect was found, but native enforcement of the destructive ownership boundary remains unproven. EvidenceWhat I checked:
Likely related people:
Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 31, 2026, 12:29 PM ET / 16:29 UTC. |
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
What Problem This Solves
Fixes: isolated development cleanup would select the normal Companion and Store Gateway instead of the named test patch.
User Impact
Developers can explicitly preview and clean one owned development Gateway patch plus disposable Companion directories without selecting their normal install, other patches, WSL or external model weights. Ordinary cleanup defaults are unchanged.
The caller must separately verify and stop its owned Companion instance and ensure no other session uses the disposable directories. Apply requires destructive consent and the unchanged preview digest. In-profile data, including identities and models, is destroyed. Native runtime proof is deferred, so this draft is not approval to run cleanup.
Why This Change Was Made
An isolated-only scope cannot be composed from the old additive flags. A separate path pins the exact registered development package/layout, patched lifecycle alias, affected user, task-owned Companion binary, package-bound session record and explicit profile inventory. An unchanged SHA-256 preview is mandatory for apply. Supported native teardown must confirm structured success before that registration is removed. Existing path/reparse/WSL safeguards are reused; there is no process-killing or account-deletion fallback.
Evidence
The baseline parameter contract rejects
-IsolatedOnly. The updated standalone Windows PowerShell 5.1 fixture suite passes 44 cases, covering normal-mode preservation, isolated script routing, exact patch/layout/alias/session ownership, stale previews, teardown failures, explicit profile guards, concurrent unrelated processes and external-cache preservation. These are executable script tests with temporary data and mocked package/process/WSL operations, not real uninstall evidence.Independent Copilot rubber-duck ownership review and P0-P3 coverage confirmation found no actionable issues. Its assessment has no shared-helper isolation or structured machine-status guarantees; concrete model identity is unverified. Codex CLI is unavailable. The existing named-mutex availability boundary, Windows case-insensitive filename comparison and repeated hashing costs were consciously retained: they preserve cooperative build exclusion, native path semantics and drift guards.
Change Type
Scope
winnodeRequired proof pools
windows-clean-installer-upgrade: one consented live ARM64 development-patch teardown/unregister cycle and preservation checks completed. Further Store reinstall, exhaustive cache-content, residual-state and cross-platform proof remain out of scope/unverified; this single cycle does not complete the entire pool.Validation
powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\scripts\test-clean-uninstall.ps1: passed, 44 cases, no skips..\build.ps1: passed, all five projects, native ARM64 Debug; includes documentation validation (69 Markdown files and seven proof pools).dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore --logger 'console;verbosity=quiet': passed, 4,810 passed, 24 opt-in native/integration skips, zero failures; 2m36s.dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore --logger 'console;verbosity=quiet': passed, 4,799 passed, zero skips/failures; 1m34s..\scripts\validate-agent-skills.ps1: passed, 15 skills and 24 Markdown files..\scripts\test-agent-skills-validator.ps1: passed, 27 fixtures plus repository skills.git diff --check: passed.Tests set
OPENCLAW_REPO_ROOTto this isolated worktree and an isolated temporaryOPENCLAW_TRAY_DATA_DIR. Initial .NET runs omitted--no-restorebecause this was a fresh worktree. One early cleanup-fixture run failed because its invalid-JSON expected error text did not match PowerShell 5.1 wording; the explicit parse error and assertion were corrected, then the entire focused suite was rerun.Real Behavior Proof
b896c9e42500dab049a80aa6dded38bb57d122f9.pr225-testand the approved disposable Companion profile, then applied the same scope using the unchanged preview SHA-256.Yes/No/N/A): N/A.Security Impact
Yes/No): No.Yes/No): No credential export/copy added. Disposable-profile deletion remains explicitly destructive; fingerprints read file bytes without exporting contents.Yes/No): No.Yes/No): Yes.Yes/No): Yes.Yes, explain the risk and mitigation: the new opt-in scope can run only a registered package-qualified patched teardown alias and delete only explicitly supplied disposable directories. Exact registration/development mode/layout/manifest/session ownership and an unchanged affected-user preview digest gate apply. No Companion/process stop, ordinary uninstall, WSL command, wildcard deletion, credential copy or guessed account cleanup is performed. Identifiable unrelated processes may remain; the caller must independently establish exclusive ownership of selected profiles. Cooperating source builds are excluded by the existing named mutex; hostile writers and concurrent out-of-band lifecycle operations are not supported.Compatibility and Migration
Yes/No): Yes, ordinary cleanup behavior remains unchanged.Yes/No): No persistent changes; new isolated command parameters only.Yes/No): No.Review Conversations