Repository navigation
Description
Summary
If "Start OpenClaw Companion when Windows starts" was selected in the installer, Companion keeps starting at logon after the user turns Start with Windows off. An upgrade can also bring the startup entry back.
Cause
There are two separate autostart registrations, and only one of them is managed.
| Owner | Registration | Settings can see it | Settings can remove it |
|---|---|---|---|
installer.iss, startupicon task |
{userstartup}\OpenClaw Companion.lnk |
No | No |
AutoStartManager |
HKCU\...\Run value and logon scheduled task |
Yes | Yes |
AutoStartManager.SetUnpackagedAutoStart(false) and SetupStartupPolicy.ApplyUnpackaged(false, ...) delete only the Run value and the scheduled task. The setup wizard's startup choice goes through the second one, so it cannot remove the shortcut either.
Inno also inherits earlier task selections on an upgrade, so a shortcut the user deleted by hand comes back.
Reproduce
Unsigned Dev installers built from main a4dd026, Windows 11 x64 build 26200, on the Dev identity. The Settings toggle binds to SettingsData.AutoStart, so I set the state the toggle stores, launched the installed tray with --background, and read the state back.
installed with /TASKS=startupicon, AutoStart set to false
settings.json AutoStart (the Settings toggle): False
startup shortcut: True; Run value: absent
shortcut deleted by hand, then a silent upgrade
startup shortcut: True; Run value: absent
Fix I have ready
- The installer task writes the same Run value that Settings manages, with
--background, instead of a shortcut. - The task is offered on a fresh install only, so an upgrade cannot turn autostart back on.
- An upgrade moves an existing shortcut to the Run value and removes the shortcut.
- At startup an unpackaged build reports an existing registration in the toggle, so a user who turned the toggle off before the upgrade sees On and can really turn it off. It never lowers an enabled preference.
Results with the fix, on the same setup:
fresh install with the task
startup shortcut: False; Run value: "<app>\OpenClaw.Tray.WinUI.exe" --background
fresh install without the task
startup shortcut: False; Run value: absent
baseline with the shortcut and AutoStart false, then upgrade
startup shortcut: False; Run value: <app>\OpenClaw.Tray.WinUI.exe --background
log: Auto-start setting corrected from False to True to match Windows.
settings.json AutoStart (the Settings toggle): True
Run value removed, then a silent upgrade
startup shortcut: False; Run value: absent
Not verified
- I did not click the toggle in the UI or reboot. That the toggle removes the Run value comes from reading
SetUnpackagedAutoStart. - Signed artifacts.
I found no existing issue or PR for this. I will open a PR.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Projects
- StatusShow more project fieldsBacklog
Activity
clawsweeper commentedon Oct 31, 2026
Codex review: this still needs some work.
Summary
This issue identifies a current startup-control bug: the installer creates a shortcut that neither Settings nor setup removes, so disabling autostart can leave Companion launching at logon.
Reproducibility: Current source establishes the shortcut creation and both incomplete disable paths; the reporter adds Dev-installer observations, but this read-only review ran no Windows reproduction or tests.
Next step
Coordinate with the reporter's prepared fix and establish a failing regression showing that disabling startup removes installer-created autostart and remains disabled after upgrade.
Review details
Best possible solution:
Use a registration that Companion can inspect and disable, retire owned legacy shortcuts, and prevent upgrades from restoring disabled autostart.
Do we have a high-confidence way to reproduce the issue?
Current source establishes the shortcut creation and both incomplete disable paths; the reporter adds Dev-installer observations, but this read-only review ran no Windows reproduction or tests.
Is this the best way to solve the issue?
Consolidating installer registration with Companion's managed startup paths addresses the defect directly, provided migration preserves user intent and packaged-app boundaries.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
Codex review notes: model internal, reasoning medium; reviewed against a4dd026cc5f8.
Label changes
Label changes:
P2: A reproducible ownership mismatch defeats an existing startup preference without blocking Companion's core workflow.impact:ux-friction: The displayed Off preference can leave a separate startup entry active, requiring recovery outside Companion.issue-rating: 🦞 diamond lobster: Current issue advisory state selects this label.clawsweeper:source-repro: Current issue advisory state selects this label.clawsweeper:queueable-fix: Current issue advisory state selects this label.clawsweeper:fix-shape-clear: Current issue advisory state selects this label.Label justifications:
P2: A reproducible ownership mismatch defeats an existing startup preference without blocking Companion's core workflow.impact:ux-friction: The displayed Off preference can leave a separate startup entry active, requiring recovery outside Companion.Evidence reviewed
Acceptance criteria:
What I checked:
installer.iss:145, a4dd026cc5f8)src/OpenClaw.Tray.WinUI/Services/AutoStartManager.cs:223, a4dd026cc5f8)src/OpenClaw.Tray.WinUI/Services/SetupStartupPolicy.cs:26, a4dd026cc5f8)src/OpenClaw.Tray.WinUI/App.xaml.cs:4182, a4dd026cc5f8)tests/OpenClaw.Tray.Tests/InstallerIssAssertionTests.cs:63, a4dd026cc5f8)How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.Reviewed October 31, 2026, 7:23 PM ET / 23:23 UTC.