Repository navigation
fix(setup): clean up owned Gateways after Companion uninstall - #1715
Conversation
|
🦞👀 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. |
|
@clawsweeper review Please review the current head (a1839d6). The PR body includes the Windows 11 ARM64 test machine validation, component receipts/screenshots, and the remaining proof limits. |
|
🦞👀 Re-review progress:
|
|
Codex review: needs real behavior proof before merge. What this changesThis PR adds ownership-based Gateway cleanup after Companion uninstall, startup reconciliation and preservation recovery, and Store Gateway update checks. Example: Uninstall Companion after it creates OpenClawGateway, then reinstall Companion.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 5 items remain Keep open: this PR contains useful, maintainer-supported lifecycle work absent from main, but legacy adoption can still authorize deletion of a replacement distro. Priority: P1 Before merge
Findings
Tests
Agent review detailsHow this fits togetherSetup records Gateway ownership outside the Companion MSIX; a current-user scheduled worker observes package removal, performs authorized cleanup, and supplies receipts that startup uses to reconcile saved connections and credentials. flowchart TD
A[Companion setup] --> B[Ownership records]
B --> C[Current user cleanup task]
D[Windows package lifecycle] --> C
C --> E[WSL or native package removal]
C --> F[Cleanup receipts]
F --> G[Startup reconciliation and recovery]
Technical reviewBest possible solution: Bind unattended deletion to a proven installation generation and preserve legacy distros whose ownership cannot be established. Do we have a high-confidence way to reproduce the issue? Source establishes the remaining failure: retain a legacy schema-1 marker, replace OpenClawGateway at the same path before first upgraded launch, and let startup adopt it without an existing owned.json; subsequent uninstall authorizes unregistering the replacement. Is this the best way to solve the issue? The external worker and visible preservation route address the approved lifecycle goal, but path-only legacy evidence must not silently become installation-specific deletion authority. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5f6b29290528. Merge-risk optionsMaintainer options:
Provenance checked
TestingProof path: in-process harness. SecurityNeeds attention: Legacy adoption can grant unattended deletion authority over a replacement installation. EvidenceSecurity concerns:
What I checked:
Likely related people:
Review metrics
LabelsLabel changes:
Label justifications:
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 HistoryReview history (5 earlier review cycles)
Reviewed October 14, 2026, 7:56 PM ET / 23:56 UTC (Revision 6). |
|
@clawsweeper re-review Proof capture is completed for the documented WSL installer lifecycle scope at a1839d6. The PR description now records that scope explicitly, with receipts and screenshots. Full native-flow testing was intentionally skipped; WSL testing was sufficient for the installer lifecycle scenarios exercised. Please reassess the proof labels against this scope: The requested product behavior is automatic cleanup of Companion-owned Gateways after uninstall through Windows Settings, allowing reinstall to provision a fresh Gateway. Gateways installed separately before Companion setup must remain user-owned. |
|
🦞👀 Re-review progress:
|
|
🦞👀 Re-review progress:
|
|
The cleanup and refresh goal makes sense, but these lifecycle cases need fixing before merge. Reviewed head: WSL deletion safetyIn
Local mocked checks reached deletion in both cases; no real distro was removed. Native package ownership
Local mocks selected package removal for both ownership scenarios; their user impact is supported by code tracing. Recoverable cleanup and reinstall
Consistent guidance
|
|
Review-update runtime proof: the product cleanup refused to unregister a WSL distro recreated at the same name and path with a different registration ID. The real preservation prompt then allowed startup to continue, retained the replacement distro and its data canary, and retired the stale managed connection and authentication. This used a disposable signed MSIX containing product assemblies and an actual WSL registration. {
"replacementRegistrationPreserved": true,
"replacementDataPreserved": true,
"productRecoveryPromptShown": true,
"preserveContinuedStartup": true,
"staleManagedAuthRetired": true
}Final commit |
Register user-scoped cleanup outside the Companion MSIX so Windows Settings removal retires verified Companion-owned Gateways. Bind WSL ownership to its registration and preserve borrowed, replaced, or shared native installations. Settle pending cleanup before reconnecting, retire removed managed connection credentials, and offer preservation when cleanup cannot safely proceed. Check Store Gateway updates while retaining development package selection.
a1839d6 to
0abcdf4
Compare
|
Addressed the actionable review comments in the single amended commit
Full build passed. Shared: 4,261 passed, 36 skipped; Tray: 4,000 passed; SetupEngine: 2,291 passed, 1 skipped. Ten controlled ownership scenarios, three reconciliation checks, task-SID checks, and real signed-MSIX/WSL lifecycle proof passed. Independent code/structured reviews are clean; final commit coherence is OK. No new test files or test methods were added. Recovery dialog and replacement-preservation proof. The PR description distinguishes the real lifecycle proof from mocked native inventory, the intentionally skipped full native flow, and the separate MXC download/UI-capture blockers. @clawsweeper review |
|
🦞👀 Re-review progress:
|
Preserve the contributor history while validating the lifecycle fixes against current main. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: bc8d76f0-2703-4cbf-b7a1-f6af1c3bb319
Remove startup adoption of legacy WSL markers. Fail closed on malformed cleanup receipts before worker effects and on invalid settings before credential retirement. Keep recovery evidence and surface actionable startup errors. Cover exact PowerShell guard/receipt behavior and C# reconciliation. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: bc8d76f0-2703-4cbf-b7a1-f6af1c3bb319
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: bc8d76f0-2703-4cbf-b7a1-f6af1c3bb319
|
Implemented the two accepted review findings in 0a74e82e, preserving the contributor branch and its history. The published head is
ValidationFinal-head validation used native Windows ARM64 with .\build.ps1
dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore --logger 'trx;LogFileName=head-shared.trx' --results-directory "$out\validation" --verbosity quiet
dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore --logger 'trx;LogFileName=head-tray.trx' --results-directory "$out\validation" --verbosity quiet
dotnet test .\tests\OpenClaw.SetupEngine.Tests\OpenClaw.SetupEngine.Tests.csproj --no-restore --logger 'trx;LogFileName=head-setup.trx' --results-directory "$out\validation" --verbosity quiet
The earlier focused cleanup plus current-main WSL registration-retry run also passed: 32 passed, 0 failed, 0 skipped. These tests are included in the final-head suites above. The build's documentation validation passed. Real behavior proof and remaining gatesThe filesystem and exact-function PowerShell tests are isolated regression evidence, not real packaged uninstall or Gateway/MXC proof. The earlier signed-MSIX/WSL lifecycle evidence in the PR description belongs to The strict command below was attempted before the final main-only integration, with the same cleanup implementation: .\scripts\validate-mxc-e2e.ps1 -NoBuild -RuntimeIdentifier win-arm64 -ResultsDirectory "$out\validation\mxc"Failed: 11 passed, 7 failed during fixture initialization. Ubuntu 24.04 acquisition returned The required proof pools remain An independent Copilot P0-P3 source review of the repair delta found no remaining P0/P1 issues. The final main merge left the cleanup implementation and its tests unchanged. The shared autoreview helper itself was unavailable (HTTP 401, no report produced); this is not a helper-clean or dual-model-clean claim. This comment supersedes the description's prospective-adoption, single-commit, no-new-tests, and final-clean-review statements. Fresh CI and the remaining runtime proof still need evaluation; this update does not claim merge readiness. |
Keep the current main removal of Gateway installation disclosure from PC capabilities and all six resource locales. Preserve the existing Gateway cleanup safety fixes and contributor history. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: bc8d76f0-2703-4cbf-b7a1-f6af1c3bb319

Windows Settings uninstall leaves Companion-created Gateways behind, allowing a later install to reuse an older Gateway. Register bounded cleanup outside the Companion MSIX, scoped to the current Windows user, and settle pending cleanup before reconnecting after reinstall.
Addresses #1712. Local AI diagnostics remain separate in #1716. One commit (
0abcdf4c0e996112a3832bf9e4c16f7d8f7a5eb7), 25 files, 487 additions and 62 deletions; no new test files or test methods.Required proof pools
windows-11-arm64: final branch build and required tests on the requested Windows ARM64 device.windows-clean-installer-upgrade: actual signed disposable MSIX update/uninstall/reinstall plus product lifecycle APIs.windows-winui-interactive: real product recovery dialog captured below; full onboarding and Settings/consent screenshots were not captured in this desktop session.windows-wsl-gateway-e2e: real WSL registration/disk lifecycle; controlled minimal root filesystem, not a running inference/Gateway service.windows-wsl-mxc: strict E2E attempted; its Ubuntu acquisition failed with HTTP 404 before Gateway/MXC execution.Validation
All new execution/testing used the requested Windows 11 ARM64 device, with isolated source checkouts, disposable packages, WSL registrations, and profiles.
Final independent code/structured reviews and commit-coherence advisory: clean / OK. Changed source files match the tested checkout after CRLF/LF normalization. Test projects were built/restored explicitly before
--no-restoreruns.Proof completed
The WSL lifecycle and ownership checks below are complete. Full native acquisition/onboarding was intentionally skipped; WSL testing covers these lifecycle scenarios. Native ownership edge cases were checked with controlled package inventory/acquisition outcomes.
Real behavior proof
Real signed MSIX + actual WSL registration/disk, using product cleanup/initialization APIs:
{ "ordinaryMsixUpdatePreservedGateway": true, "fastReinstallRemovedOwnedWsl": true, "savedSettingsReconciled": true, "replacementRegistrationPreserved": true, "replacementDataPreserved": true, "preserveContinuedStartup": true, "staleManagedAuthRetired": true }The fresh profile retained its unrelated remote Gateway/token, MCP preference, theme, and an unknown settings field. A recreated WSL distro at the same name/path was preserved because its registration ID differed.
Focused regressions, before/after:
Earlier baseline screenshots document the original report:
Not verified / blocked
The strict
scripts/validate-mxc-e2e.ps1 -NoBuild -RuntimeIdentifier win-arm64run reached WSL acquisition and failed because the Ubuntu 24.04 download returned HTTP 404. It did not establish Gateway/MXC execution; no skip or capability bypass was substituted. This is separate from the passing real-package/WSL lifecycle checks above.The desktop supplied no foreground HWND for the opt-in WinUI capture tests. Full shipped onboarding and Settings/consent capture remain unavailable. The recovery dialog and copied diagnostics were captured; no full native/GPU inference claim is made.