Autostart turned on during setup opens the Companion window at logon
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 20/100
Research direction
Start with the two writers in AutoStartManager (ApplySetupPreferenceAsync and SetUnpackagedAutoStart) and the matcher WindowsStartupTaskRegistration.MatchesExpectedTask, which SetupStartupPolicy.ApplyUnpackaged relies on. Done means the setup Run key value includes --background, the strict check accepts the app's own task, and ActivationRouterTests still passes. Pull request #1963 already implements this, so review or test it rather than starting a new patch.
Written by the indexing model from the issue text.
Description
Summary
When setup turns on Start with Windows in a session without elevation, the registration it falls back to has no --background. Companion then opens its window at every logon instead of starting quietly. A second defect in the same path makes setup report that startup registration could not be confirmed, even when the app's own task is in place.
Cause
Run key without the argument. A logon scheduled task needs elevation here, so schtasks /Create is refused and setup falls back to the Run key. The two writers in AutoStartManager disagree:
// ApplySetupPreferenceAsync, the setup path
key.SetValue(AppName, $"\"{exe}\"");
// SetUnpackagedAutoStart, the Settings path
key.SetValue(AppName, $"\"{exePath}\" --background");
docs/CONNECTION_ARCHITECTURE.md says new autostart registrations pass --background to remain quiet, and ActivationRouterTests pins that an unpackaged launch with no arguments opens a window. installer.iss already migrates this exact argument-free value to --background, but only during an upgrade, and setup can write it again afterwards.
Strict check that rejects the app's own task. WindowsStartupTaskRegistration.MatchesExpectedTask requires empty arguments, while CreateRegisterProcessStartInfo always registers --background. InspectStrict therefore returns Different for a task the app created. It matters when schtasks times out or returns an unclassified error after creating the task: SetupStartupPolicy.ApplyUnpackaged throws "Windows startup registration could not be confirmed". The existing test fixture uses empty arguments, so it did not catch this.
Evidence
Windows 11 x64 build 26200, main a4dd026, standard session without elevation:
schtasks /Create /SC ONLOGON /HRESULT exit: 0x80070005
Tests against the baseline matcher, using a task description with the arguments the app really registers:
Failed OnlyExactEnabledStartupTaskCountsAsCompletedRegistration(changed: "expected", matches: True)
Failed OnlyExactEnabledStartupTaskCountsAsCompletedRegistration(changed: "no-arguments", matches: False)
Fix I have ready
One shared CreateBackgroundLaunchCommand for the scheduled task and both Run key writers, and MatchesExpectedTask now requires --background.
Not verified
- I did not complete the setup wizard and log on again, so the window at logon comes from the code and the router test, not from watching it happen.
- The strict check's failure path was tested through the matcher, because a logon task cannot be created on this machine without elevation. The new round-trip test exits early when Windows refuses the task, as it does here, so it only proves something on an elevated host.
I found no existing issue or PR for this. I will open a PR.
- Dominant language
- C#
- Stars
- 2.2k
- Forks
- 336
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 156
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from openclaw/openclaw-windows-node
-
clawsweeper:fix-shape-clear clawsweeper:needs-maintainer-review clawsweeper:no-new-fix-pr clawsweeper:not-repro-on-main impact:ux-release-blocker issue-rating: 🦪 silver shellfish P0
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
openclaw/openclaw-windows-node#1843 · 3 comments · 2 reactions ·
Maintainers usually reply within 1 day
-
clawsweeper:needs-product-decision clawsweeper:needs-security-review clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:security impact:ux-friction issue-rating: 🦞 diamond lobster P2 stale
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
openclaw/openclaw-windows-node#1763 · 2 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster P3 stale
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
openclaw/openclaw-windows-node#1762 · 2 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
bug clawsweeper:needs-live-repro clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr impact:auth-provider impact:session-state issue-rating: 🐚 platinum hermit local-models P2
Difficulty 4/5 3-5 days Newbie friendliness 18/100
openclaw/openclaw-windows-node#1976 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
clawsweeper:needs-product-decision clawsweeper:needs-security-review clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:security impact:ux-release-blocker issue-rating: 🦞 diamond lobster P0
Difficulty 4/5 3-5 days Newbie friendliness 18/100
openclaw/openclaw-windows-node#1975 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
All issues in openclaw/openclaw-windows-node
Similar issues
-
is:build
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
nopSolutions/nopCommerce#8440 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
RadicalCSG/com.chisel#192 ·
Maintainers usually reply within 1 day
-
area-testing p2-post-1.0 technical-debt
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
RazorConsole/RazorConsole#447 ·
Maintainers usually reply within 1 day