Skip to content

winget uninstall removes the local WSL gateway without asking #1955

Done

Description

@MertBasar0

Summary

winget uninstall removes the local WSL gateway without asking. The distro and everything inside it are gone, with no prompt and no way to keep them. The README tells users they will be asked.

This needs a product decision, because DEVELOPMENT.md documents the silent behavior on purpose: "A silent uninstall (/SILENT, /VERYSILENT) always removes the gateway."

Why I think the default should change

  • installer.iss already says why the dialog defaults to No: removing the WSL gateway "is destructive and unrecoverable", and someone uninstalling in order to reinstall "must not lose their gateway by pressing Enter". A silent uninstall skips that protection and picks the destructive answer.
  • A silent uninstall is what package managers do by default. Companion is on winget as OpenClaw.OpenClawCompanion, and winget uses the entry's QuietUninstallString (unins000.exe /SILENT) unless the user passes --interactive.
  • Someone running winget uninstall to reinstall, or a fleet script removing the app, did not ask to delete a gateway and its workspace.
  • feat(migration): gate Inno-to-Store migration preview and preserve the gateway on uninstall #1461 (feat(migration): gate Inno-to-Store migration preview and preserve the gateway on uninstall) already moved one silent case toward preserving, but only where a Store app is registered.

Reproduce

Unsigned Dev installers built from main a4dd026, Windows 11 x64 build 26200. I registered a throwaway OpenClawGateway-Dev distro with wsl --import, read QuietUninstallString from the entry, and ran exactly that command.

QuietUninstallString: "<app>\unins000.exe" /SILENT
distro registered before: True
still in Installed apps: False; distro registered after: False

Options

  1. Keep the gateway on a silent uninstall, and let an unattended caller ask for removal with /RemoveLocalGateway=yes. This is my recommendation. Nothing is lost by default, and the removal stays available to scripts. Scripts that rely on today's behavior would need the new switch.
  2. Keep today's behavior and correct the docs. Add the warning to the README and the winget description. This changes no code, but the data loss stays.

I built option 1 and ran it on the same setup:

QuietUninstallString: "<app>\unins000.exe" /SILENT
still in Installed apps: False; distro registered after: True
log: Silent uninstall: preserving the OpenClawGateway-Dev WSL distro and generated state. Pass /RemoveLocalGateway=yes to remove them.

unins000.exe /VERYSILENT /RemoveLocalGateway=yes
distro registered after: False; install folder left: False
log: Silent uninstall: /RemoveLocalGateway=yes requested local gateway cleanup.
log: Local gateway cleanup completed successfully.

Not verified

  • I did not run the winget command itself. The Dev entry does not appear in winget list on my machine, and running it on the real package would remove my installed Companion. The steps above run the same registered command winget reads. winget uninstall on a throwaway machine would confirm the last link.
  • Signed artifacts, and a distro with a real Gateway inside it.

Which option do you want? Option 1 is ready as a PR once it is agreed.

Activity

  1. added
    clawsweeper:intake:bug
    clawsweeper:intake:needs-environment
    P0
    clawsweeper:fix-shape-clear
    clawsweeper:needs-maintainer-review
    clawsweeper:needs-product-decision
    clawsweeper:no-new-fix-pr
    clawsweeper:source-repro
    impact:data-loss
    issue-rating: 🦞 diamond lobster
    and removed
    clawsweeper:intake:bug
    clawsweeper:intake:needs-environment
    on Oct 31, 2026
  2. clawsweeper commented on Oct 31, 2026

    @clawsweeper

    Codex review: this still needs some work.

    Summary
    Current main still removes the eligible WSL gateway during silent uninstall, and the reporter’s open fix PR awaits a decision about reversing this documented default.

    Reproducibility: Current source establishes silent selection through WSL unregister, corroborating the reporter’s Dev-installer output; this read-only review ran no uninstall, builds, or tests.

    Root-cause cluster
    Relationship: canonical
    Canonical: #1955
    Summary: This issue tracks the silent-uninstall policy, with one open PR implementing its preservation option.

    Members:

    These related items are listed for context. Any action on an item requires its own checks.

    Maintainer decision needed

    • Question: Should silent Inno uninstall preserve the local WSL gateway unless /RemoveLocalGateway=yes is supplied?
    • Recommendation: Preserve by default: Approve the linked PR’s direction, document the explicit removal switch and retained state, and require installer proof before landing.
    • Why: The existing destructive default is intentional and documented, while the issue and linked PR record no owner approval to reverse its unattended-removal contract.

    Next step
    Decide the silent-uninstall default through #2324 (fix: keep the local WSL gateway when winget uninstalls Companion), then validate the chosen installer behavior.

    Review details

    Best possible solution:

    Preserve gateway data by default, retain migration safeguards, and require explicit consent for unattended deletion.

    Do we have a high-confidence way to reproduce the issue?

    Current source establishes silent selection through WSL unregister, corroborating the reporter’s Dev-installer output; this read-only review ran no uninstall, builds, or tests.

    Is this the best way to solve the issue?

    Gating the existing cleanup owner is a focused solution to the safety concern, but preservation and a new removal switch change documented policy and require an owner decision.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • Changing the default breaks unattended scripts that currently rely on silent uninstall to remove the gateway and leaves its stored credentials in place.
    • The reporter exercised the registered uninstall command with unsigned Dev installers; actual winget invocation, signed artifacts, and a populated Gateway remain unverified.

    Codex review notes: model internal, reasoning medium; reviewed against 0d9aba1e3cac.

    Label changes

    Label changes:

    • add clawsweeper:linked-pr-open: Current issue advisory state selects this label.
    • remove clawsweeper:fix-shape-clear: Current issue advisory state no longer selects this label.
    • remove clawsweeper:needs-maintainer-review: Current issue advisory state no longer selects this label.

    Label justifications:

    • P0: The normal silent uninstall path can irreversibly delete the registered gateway distro and all workspace data inside it without separate deletion consent.
    • impact:data-loss: The cleanup helper invokes WSL --unregister, deleting the distro rather than merely removing Companion.
    Evidence reviewed

    What I checked:

    • Verified current default branch: GitHub main and the checkout both resolve to 0d9aba1; the working tree remained clean. (0d9aba1e3cac)
    • Current source selects destructive cleanup: After migration-preservation exits, UninstallSilent sets LocalGatewayCleanupRequested to True; interactive uninstall instead offers a No-default choice. CurUninstallStepChanged then invokes the cleanup helper. (installer.iss:848, 0d9aba1e3cac)
    • Cleanup reaches WSL deletion: The helper repeats migration admission and then invokes WSL --unregister for the selected distro before removing its generated directory. (scripts/Uninstall-LocalGateway.ps1:884, 0d9aba1e3cac)
    • Documentation and tests retain the existing policy: DEVELOPMENT.md explicitly documents automatic silent removal, and InstallerIssAssertionTests still expects the unconditional cleanup selection. (tests/OpenClaw.Tray.Tests/InstallerIssAssertionTests.cs:98, 0d9aba1e3cac)
    • Open same-author PR owns the proposed remedy: fix: keep the local WSL gateway when winget uninstalls Companion #2324 (fix: keep the local WSL gateway when winget uninstalls Companion) remains open and explicitly closes this issue; it implements preservation with /RemoveLocalGateway=yes and acknowledges the compatibility decision and outstanding signed-installer proof.
    • Historical silent default was deliberate: Merged Add uninstall choice for local WSL gateway #591 (Add uninstall choice for local WSL gateway) explicitly retained automatic silent removal while adding interactive consent; its commit patch adds the current silent-selection branch. This establishes the branch’s provenance, not the first gateway-removal implementation. (installer.iss:850, 8af4b70360a9)
    How this review workflow works
    • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
    • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
    • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
    • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
    • Maintainers can also comment @clawsweeper review to request a fresh review only.
    • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge; those execution lanes are retired.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

    Reviewed November 30, 2026, 11:30 PM ET / December 1, 2026, 04:30 UTC.

  3. github-actions commented on Nov 15, 2026

    @github-actions
    Contributor

    This issue has been automatically marked as stale due to inactivity.
    Please add updated OpenClaw Windows details or it will be closed.

  4. added
    clawsweeper:intake:bug
    clawsweeper:intake:needs-environment
    and removed
    clawsweeper:intake:bug
    clawsweeper:intake:needs-environment
    on Nov 15, 2026
  5. github-actions commented on Dec 1, 2026

    @github-actions
    Contributor

    This issue has been automatically marked as stale due to inactivity.
    Please add updated OpenClaw Windows details or it will be closed.

  6. added
    clawsweeper:linked-pr-open
    and removed
    clawsweeper:fix-shape-clear
    clawsweeper:needs-maintainer-review
    on Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0clawsweeper:linked-pr-openclawsweeper:needs-product-decisionclawsweeper:no-new-fix-prclawsweeper:source-reproimpact:data-lossissue-rating: 🦞 diamond lobster

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions