Skip to content

fix(setup): Start with Windows cannot stop the installer startup shortcut - #1964

Open
roboclaw-bot wants to merge 9 commits into
mainfrom
openclaw/nova-shrimp
Open

roboclaw-bot wants to merge 9 commits into
mainfrom
openclaw/nova-shrimp

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1956

Original fix by @MertBasar0. Current evidence: Mert's checksummed Windows report at e4affd6. Metadata-only update; no new commit.

Not merge-ready. S05 passed on two machines and S06 passed on a rerun outside the Claude desktop package; S18 is still open; Finding 4 is explicitly out of scope.

What Problem This Solves

Fixes: Companion keeps starting at logon after Start with Windows is turned off, when the installer's startup task was selected.

User Impact

User impact: the installer's startup choice uses the registration Settings manages. The tested migrated path can be turned Off and stays Off through same-version repair. Existing unquoted Run entries remain a limitation (Finding 4 below).

Behavior to review:

  • The "Start when Windows starts" task is offered on a fresh install only.
  • An upgrade moves an enabled Startup folder shortcut to the Run value when the destination approval and command are compatible. Windows-disabled, unreadable, or unrecognized entries are retained without enabling a new startup identity. A user whose toggle was off while the shortcut kept launching sees the toggle On after the upgrade, which is what was really happening, and can now turn it off.
  • At startup an unpackaged build raises the stored preference to true only for this executable's enabled installer Run command. Scheduled-task presence alone never enables an Off preference. It never lowers an enabled preference.

Why This Change Was Made

Old owner: installer.iss created a {userstartup} shortcut that no other code reads or removes. New owner: the HKCU\...\Run value that AutoStartManager already reads and deletes. Legacy migration still requires an existing owned, argument-free entry. Only its Run output quoting changed; task migration, ordering, approval guards and uninstall remain unchanged.

Evidence

Windows 11 Home build 26200, x64, tr-TR, unsigned Dev build at e4affd6. Candidate installer SHA-256: AAC2ED073D911329AEEAB86768E5FE777CABF4767547D5F58B5C83BA08197599. Baseline: a4dd026.

Case Observed result
S00, baseline Mert clicked Off; stored False, legacy shortcut retained. Visible On was read before the click; visible Off was not read after the window closed.
S03 Shortcut migrated to quoted Run. After launch: visible On via UI Automation, stored True.
S04 Real Off click: visible Off, stored False, Run removed; task/shortcut absent. Same-version repair and relaunch preserved the state.
OBS-494 Argument-free migration now produced quoted Run and raised stored AutoStart, resolving Finding 3.

The agent reports full installed/publish hash matches for the executable and managed DLLs; displayed hashes are shortened. Dev identity verified. S04 is not logon or future-release upgrade proof.

Shortcut-ownership P2 follow-up

At 0700f09, StartupShortcutIsInstallerOwned reads the .lnk through WScript.Shell before any Run write or shortcut deletion. Only this installation's executable with no arguments or exactly --background is migrated; retargeted, customized-argument and unreadable links are preserved and logged. The published tree is identical to Mert's 1cbd43b/7cc96f55 candidate. Mert reports Windows 11 validation: the new regression fails on ff34116 and InstallerIssAssertionTests passes 26/26; build.ps1 succeeds; Tray 5082/5082; Shared 4924 passed with two reported host-only failures (tr-TR casing and symbolic-link privilege); Test-InstallerScriptCompiles.ps1 -RequireCompiler compiles x64, arm64 and DevBuild. A real .lnk WScript.Shell probe accepted original no-argument/--background links and rejected retargeted, extra-argument, corrupt and missing links, including corrupt links returning empty TargetPath. Live installer runs of the customized-shortcut cases were not performed. These native results are supplied by Mert, not newly executed in this publication turn.

Change Type

  • Bug fix
  • Feature
  • Refactor
  • Docs or instructions
  • Tests or validation
  • Security hardening
  • Chore or infrastructure

Scope

  • Tray or WinUI UX
  • Windows node capability
  • Local MCP or winnode
  • Gateway, connection, or pairing
  • Setup or onboarding
  • Permissions, privacy, or security
  • Tests, CI, or docs

Required proof pools

  • windows-clean-installer-upgrade: the install and upgrade path changed. Not run here; it needs exact signed artifacts.
  • windows-winui-interactive: the value the Settings toggle shows can change at startup. Not run here.

Validation

Refreshed onto main 96f3b25f (MertBasar0, Windows 11 Home 26200)

Merged current main into 0700f09f without conflicts; the diff against main is still the same seven files. On the merge result: ./build.ps1 passes. Shared tests: 5833 passed, 13 failed, 30 skipped. Tray tests (isolated data directory): 6366 passed, 1 failed. All 14 failures are host-specific and fail identically on unmodified main on the same machine: 12 need the symbolic-link privilege (MxcFolderAdmissionTests, MxcOwnedOperationTests, InstalledFileWorkerResolverTests), 1 compares this machine's name casing (ExecReusableCommandBinderTests.PinnedCarrier_IgnoresShadowInsertedAfterApproval), and 1 is FileWorkerManifestTests.ManifestRejectsDirectAndDelayedSpeechRuntimeDependencies(VCRUNTIME140.dll). None of them touch the files this PR changes.

Local merge of e4affd6 with main 4aee38a (Windows 11 build 26200): build.ps1 exit 0; Tray tests 5081 passed, 0 failed; Test-InstallerScriptCompiles -RequireCompiler compiles x64, arm64 and x64 DevBuild; Shared tests 4924 passed, 2 failed (the same two host-only failures as before: no symlink privilege, and ExecReusableCommandBinderTests.PinnedCarrier_IgnoresShadowInsertedAfterApproval). The handshake test that failed in CI passes.

User-provided native Windows results at e4affd6

  • ./build.ps1 and validate-docs.ps1: exit 0.
  • Tray: 4818 passed, 0 failed, 0 skipped. Focused startup/installer tests: 64 passed, 0 failed, 0 skipped.
  • Shared: 4806 passed, 2 failed, 26 skipped. Reported host failures: ExecReusableCommandBinderTests.PinnedCarrier_IgnoresShadowInsertedAfterApproval (long computer name) and MxcFolderAdmissionTests.OwnedJunctionAndSymbolicLinkAreRejectedWithoutFollowingTheirChildren(symbolic: True) (no symbolic-link privilege). No Shared product code changed.
  • Test-InstallerScriptCompiles.ps1 -RequireCompiler: native Windows exit 0 for x64, arm64 and x64 DevBuild. Candidate Dev installer built successfully.
  • setup-dev -CheckOnly passed on an earlier SHA, not repeated here.

Earlier agent-side checks: 49 focused Linux passes, pre-fix regression failure, clean diff and P0-P3 review; real Inno under Wine compiled three variants. Full Linux suites did not pass. These are separate runs, not an all-green claim.

Real Behavior Proof

Scenario result
S05 PASS (positive logon) at a511d24, on a second Windows 11 machine (Speculorum9: Windows 11 Home 10.0.26300 x64, Inno install overlaid with the openclaw-tray-win-x64 artifact of CI run 43315164657). Turning Start with Windows On wrote OpenClawTray = "\OpenClaw.Tray.WinUI.exe" --background (REG_SZ, no StartupApproved entry). After a restart, without starting Companion by hand, Shell-Core event 9707 logged "Started execution of command 'OpenClaw.Tray.WinUI.exe --background'" and Companion came up in the tray without a window. Report
S05 PASS (positive logon) at a511d24, on MertBasar0's machine (Windows 11 Home 26200), rerun outside the Claude desktop MSIX package. Turning Start with Windows Off and then On wrote OpenClawTray-Dev = "\OpenClaw.Tray.WinUI.exe" --background (no StartupApproved entry, no task, no shortcut). At the next logon, Shell-Core 9707/9708 ran 'OpenClaw.Tray.WinUI.exe" --background'. The 9708 PID was the only Dev process (parent explorer.exe, no main window, MCP-only). Rerun
S06 PASS (negative logon after Off) at a511d24, on MertBasar0's machine, rerun outside the package. Off in the logon-started Companion removed the Run value and stored AutoStart=false. At the next logon, Windows enumerated HKCU Run and started the other entries. There was no OpenClaw 9707/9708, no Dev process and no Dev log line. This replaces the withdrawn earlier S06 (correction). Rerun

Current-head scope

Current cases were reset and rerun at e4affd6; older SHA results remain historical. Mert performed the clicks; UI Automation read toggle states, without screenshots. The S00 log's FAIL line was a closed-window read, not a demonstrated product failure; visible Off was not captured in that baseline case.

With Mert's approval, click cases used EnableMcpServer=true in Dev settings to bypass first-run setup in local-only mode. No Gateway, pairing or credentials were used; this differs from a default profile. Isolation/fixture variables were checked in the launching process tree, not independently in the child. No -Isolated autostart proof is claimed.

S01/S02/S09/S10/S13/S19 and S12-A passed. S14/S15 and S12-D/E/F are labeled fixture proof. S07/S08/S12-B/C fixtures do not fulfill Windows-UI state creation. Uninstall removed a retained shortcut but left Windows-owned approval metadata; this is an observation, not a new failure.

All other cases run on MertBasar0's machine (S00, S03, S04, OBS-494 and the session checks above) ran inside the Claude desktop MSIX package context; only the S05/S06 reruns above ran outside it. They show what the installer and Companion wrote and read in that view; they are not evidence of what Windows itself sees at logon. Correction

Not verified or blocked

  • S18: wizard not run. S07/S08/S12-B/C still need Windows-UI state creation.
  • S11: disabled-task creation denied (0x80070005). S16/S17: no approved disposable environment for permission tests.
  • Same-version repair is not future-release upgrade proof. Signed-artifact/latest-stable upgrade proof and formal pools remain incomplete.
  • Stored AutoStart=true without registration still stays true; On alone is not registration proof.

Release state and distros were reported preserved. Evidence is supplied report/log excerpts; public screenshot/artifact links verified: N/A.

Finding 4: known limitation, explicitly out of scope

An already unquoted owned Run command with --background is not normalized. With a no-space path and stored AutoStart=false, upgrade/launch leaves it active and the stored toggle value False. If an enabled legacy shortcut exists too, both remain because the destination fails exact-command comparison. The original symptom can therefore remain for these users.

This PR stops the corrected argument-free migration from creating that form; it does not repair existing argument-bearing entries. Frequency is unknown. Finding 4 is excluded by agreed scope, not claimed fixed. Suggested On-then-Off recovery was not tested and may leave the shortcut. No new commit was made for it.

Observed on Speculorum9's machine at a511d24: the existing OpenClawTray value was the unquoted form (\OpenClaw.Tray.WinUI.exe --background). Turning Start with Windows Off and then On replaced it with the quoted command. This is a manual toggle, not the untested On-then-Off recovery above, and it does not change Finding 4's scope.

Not merge-ready. S18 and the other stated gaps remain open.

Security Impact

  • New permissions or capabilities? (No)
  • Secrets or tokens handling changed? (No)
  • New or changed network calls? (No)
  • Command or tool execution surface changed? (No)
  • Data access scope changed? (No)
  • If any answer is Yes, explain the risk and mitigation:

Compatibility and Migration

  • Backward compatible? (Yes)
  • Config or environment changes? (No)
  • Migration needed? (No)
  • If yes, list the exact upgrade steps: the installer moves an enabled shortcut to the Run value on upgrade only when source and destination approval permit it and the destination command is compatible; otherwise the shortcut is preserved.

Review Conversations

  • I replied to or resolved every bot review conversation addressed by this PR.
  • I left unresolved only conversations that still need maintainer judgment.

Worked on by

Work sessions

Linked for team reference; these sessions aren’t public.

…tcut

Worked on by:
- @MertBasar0

Co-authored-by: MertBasar0 <[email protected]>
OpenClaw-Publication: 3e33e2c1-2ae8-488b-8832-0a55e560acf7
@clawsweeper

clawsweeper Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

Worked on by:
- @MertBasar0

Co-authored-by: MertBasar0 <[email protected]>
OpenClaw-Publication: 9b227027-804f-4ed1-8309-902f6995b813
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. P2 Normal priority bug or improvement with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 1, 2026
@clawsweeper

clawsweeper Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Codex review: blocked before merge.

What this changes

The PR replaces installer startup shortcuts with Companion-managed Run registration and migrates eligible existing shortcuts.

Example: An enabled OpenClaw Companion.lnk targets C:\Apps\OpenClaw\OpenClaw.Tray.WinUI.exe, while AutoStart=false.

  • Before: Turning Start with Windows Off leaves the shortcut able to launch Companion.
  • After: An eligible shortcut migrates to the quoted Run command, startup reconciliation shows On, and turning Off removes that registration.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful, focused source repair with genuine shipped-entry-point evidence, but partial issue coverage and incomplete installer migration acceptance prevent a merge-ready assessment.
Proof confidence 🦐 gold shrimp (3/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Partial
User problem: Companion can continue starting at logon after Start with Windows is turned Off.
Reason: Consolidating installer registration with the existing Settings owner has clear user value, but an existing unquoted argument-bearing Run entry can prevent shortcut migration and preserve the original symptom.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep this PR open: current main and the latest release retain the unmanaged startup shortcut, and the proposed repair remains useful. No new actionable code defect was found; the documented legacy unquoted-command case makes this a partial fix.

Priority: P2
Reviewed head: a511d24b6cb6732e37586bff2a8104218fdd2cfd

Before merge

  • Add data-model compatibility proof - The review found that existing stored data may not work after upgrade. Show that existing data still loads and works with this change.

Findings

None.

Tests

  • Missing end-to-end proof: The declared setup-wizard and live customized/Windows-disabled-shortcut installer scenarios, plus latest-stable signed upgrade preservation, remain unverified.
Agent review details

How this fits together

The Inno installer creates or migrates Windows logon registrations; AutoStartManager and AutoStartReconciliation connect those registrations to the persisted Settings toggle.

flowchart TD
  A[Installer startup choice] --> B[Managed Run registration]
  C[Legacy startup shortcut] --> D[Ownership and approval checks]
  D --> B
  B --> E[Startup reconciliation]
  E --> F[Settings preference]
  F --> G[AutoStartManager]
  G --> B
Loading

Technical review

Best possible solution:

Keep installer startup under the existing managed registration, preserve disabled and customized entries, and track the documented unquoted-command remainder separately.

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

Current-main source establishes that installer-created shortcuts survive both managed disable paths; the linked report supplies installer observations, while this review executed no target code.

Is this the best way to solve the issue?

Using the existing Run registration addresses the ownership mismatch directly, and the retained ownership, approval and variant checks are necessary migration safeguards rather than parallel machinery.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Installer startup registration and upgrade selection changes intended behavior with a stated reason (bfa0e6c: The original installer offered optional logon startup through a Startup-folder shortcut.)
  • Background-launch command and migration keeps the original intent (feat(workspace): add native Home and Sessions workspace #1541: New startup registrations launch quietly with --background, while migration preserves customized commands and task enablement; explicit quoting retains that behavior and matches the new adoption reader.)
  • Unpackaged reconciliation and packaged separation changes intended behavior with a stated reason (feat: add Microsoft Store MSIX packaging #1328: Packaged startup uses Windows StartupTask and preserves preferences on unknown results; the PR explains why unpackaged installer registration now needs narrow adoption while leaving the packaged path intact.)
  • Dev and release startup identities keeps the original intent (feat: add dev/release side-by-side app identity #922: Separate startup names prevent Dev and release installations from interfering with one another.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Current main still contains the reported ownership gap: Main creates the Startup-folder shortcut, while unpackaged reconciliation returns the stored preference unchanged and disabling startup removes only the Run value and scheduled task. (installer.iss:145, a0a2a24ec1dd)
  • Latest release also retains the shortcut: The supplied latest release, v2026.11.3, still offers startupicon and creates the unmanaged Startup-folder shortcut. (installer.iss:145, 66b9b5a559a0)
  • Pinned introduction reviewed: The introduced diff replaces the shortcut writer, limits the installer task to fresh installs, checks shortcut ownership and Windows approval before migration, and adopts only the enabled owned Run command. (installer.iss:606, a511d24b6cb6)
  • Prior shortcut-ownership finding is resolved: StartupShortcutIsInstallerOwned reads the actual target and arguments before any replacement write or deletion; retargeted, customized and unreadable links are retained. Comparison with the previously reviewed head shows these migration files unchanged. (installer.iss:579, a511d24b6cb6)
  • Corrected native logon evidence: Speculorum9 reports positive logon through the release-identity Run entry. MertBasar0's corrected outside-package run reports positive logon, an Off click removing the entry, and no subsequent logon launch: fix(setup): Start with Windows cannot stop the installer startup shortcut #1964 (comment) and fix(setup): Start with Windows cannot stop the installer startup shortcut #1964 (comment). (a511d24b6cb6)
  • Full body confirms the remaining scope: The complete body explicitly retains the not-ready hold, outstanding installer scenarios and the existing unquoted Run-command limitation; earlier migration observations occurred inside an MSIX package view. (a511d24b6cb6)

Likely related people:

  • Karen: Raw commit 3a58bf3 adds installer.iss:463 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 3a58bf34902f; files: installer.iss)
  • Natalie Aguinaldo: Raw commit bd9ce43 adds src/OpenClaw.Tray.WinUI/Services/AutoStartManager.cs:120 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: bd9ce43b4d9c; files: src/OpenClaw.Tray.WinUI/Services/AutoStartManager.cs)
  • Scott Hanselman: Raw commit eae6626 adds src/Moltbot.Tray.WinUI/Services/AutoStartManager.cs:11 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: eae6626635ba; files: src/Moltbot.Tray.WinUI/Services/AutoStartManager.cs)

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Change composition Production +182/-4; tests +165/-2; documentation +14/-7 Production growth implements migration ownership and Windows approval checks within existing owners; test groups cover distinct registration, quoting and preservation contracts.

Root-cause cluster

Relationship: partial_overlap
Canonical: #1956
Summary: This PR implements a partial repair for the canonical unmanaged-shortcut report; setup background-launch repair has a separate cause.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Unwanted logon startup defeats an existing preference but does not block Companion's core workflow.
  • merge-risk: 🚨 compatibility: The installer changes persisted startup registrations and startup reconciliation can promote settings.json AutoStart from false to true.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (3 earlier review cycles)
  • reviewed 2026-11-01T01:06:28.135Z sha 588d4ba :: blocked before merge. :: none
  • reviewed 2026-11-09T01:04:44.036Z sha ff34116 :: blocked before merge. :: [P2] Verify the legacy shortcut command before replacing it
  • reviewed 2026-11-09T22:28:33.100Z sha 0700f09 :: blocked before merge. :: none

Reviewed November 17, 2026, 8:35 AM ET / 13:35 UTC (Revision 4).

roboclaw-bot and others added 4 commits November 1, 2026 17:36
Worked on by:
- @MertBasar0

Co-authored-by: MertBasar0 <[email protected]>
OpenClaw-Publication: 94f453e4-324e-40d9-84e0-55b6bf96ab81
Worked on by:
- @MertBasar0

Co-authored-by: MertBasar0 <[email protected]>
OpenClaw-Publication: 702bb2f8-2cce-4041-96a6-7b8e625c212a
Co-authored-by: MertBasar0 <[email protected]>
Worked on by:
- @MertBasar0

Co-authored-by: MertBasar0 <[email protected]>
OpenClaw-Publication: 8004c27e-9f7e-4dd3-9762-1f3243209285
@MertBasar0

Copy link
Copy Markdown
Contributor

@clawsweeper re-review

@roboclaw-bot

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 9, 2026
Worked on by:
- @MertBasar0

Co-authored-by: MertBasar0 <[email protected]>
OpenClaw-Publication: b7d5827c-4d7c-4715-8e78-810f8d1ff373
@roboclaw-bot

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 9, 2026
@roboclaw-bot

Copy link
Copy Markdown
Contributor Author

PR cleanup review

Reviewed head: 0700f09f739e6744941e6afc71041cce1adbdf78. Main comparison: e59374c064f43d68f5c72d070d4c89ef2d20ec3b.

The latest ownership guard correctly checks the actual shortcut target and arguments before migration, and main still has the original unmanaged-shortcut gap. This is not ready to land yet: the body retains S05 positive logon, S18 wizard and customized-shortcut installer gaps, plus the explicitly excluded unquoted Run-command case. The current UI job also crashes rather than completing. Please keep those boundaries visible while completing the existing proof lane.

Action in this cleanup pass: leaving this PR open. No branch changes or runtime-proof waiver. The findings above come from source, discussion and recorded-CI review; Windows validation was not rerun in this pass.

@shanselman

Copy link
Copy Markdown
Collaborator

Hi @MertBasar0, this is a Copilot triage agent (not Scott), doing an overnight sweep for PRs that could land. I made no changes to this branch. Thank you for the thorough, checksummed Windows evidence on "Start with Windows" (#1956).

What I checked against current main (22c111d4):

  • The branch merges cleanly (no conflicts, checked with git merge-tree).
  • The Gate on head 0700f09f is red from Nov 9. Its UI job failed with The active test run was aborted. Reason: Test host process crashed while ReactorChatLayoutProofTests.ReasoningPicker_ReflectsInheritedDefaultWithoutOverridingExplicitChoices was running (the log itself says that test "may, or may not be the source of the crash"). This PR does not touch chat UI, and the same host crash with the same test running shows up on the Nov 6 run of fix(windows): honor alpha channel when selecting Companion updates #1960 (fix(windows): honor alpha channel when selecting Companion updates), so it looks like a repo-wide UI-host problem and not this change. I could not find an issue tracking it.
  • Still open per your PR body: S05 (positive logon proof) and S18 (wizard and customized-shortcut installer proof). I can't run an installer logon proof on a shared machine, so I am not adding a "ready for maintainer look" label.

No pressure on timing. A refreshed head with a green Gate plus those two cases would make this much easier for a maintainer to land.

roboclaw-bot and others added 2 commits November 12, 2026 21:52
Co-authored-by: MertBasar0 <[email protected]>
Worked on by:
- @MertBasar0

Co-authored-by: MertBasar0 <[email protected]>
OpenClaw-Publication: 46348e85-a43f-4578-8126-3c351263e8a5
@MertBasar0

Copy link
Copy Markdown
Contributor

S05 (positive logon) at a511d24b: blocked on my machine, not a result for this PR

I ran S05 on the current head (Windows 11 Home 26200, Dev identity, installer built from a511d24b, installed payload hash-matched to the build).

  • Preparation passed. I turned Start with Windows On in Settings. The Run value became "<app>\OpenClaw.Tray.WinUI.exe" --background (owned, quoted, REG_SZ), and the stored AutoStart is True. There is no StartupApproved entry, so Windows treats it as enabled.
  • The logon launch never happened, on 1 reboot and 2 sign-out/sign-ins. Each time Explorer processed the HKCU Run key (Shell-Core 9705/9706), and other entries started (event 9707). There was no 9707 for the Companion entry, no process, and no log write after logon. It was not an elevation request, a disabled approval, Smart App Control, CodeIntegrity/AppLocker, a package registration or a value-format problem.
  • Control: a temporary HKCU Run entry "C:\Windows\System32\cmd.exe" /c echo ... >> file was skipped in exactly the same way, then removed. This machine does not start newly added HKCU Run entries, whoever writes them, so S05 cannot be proven here.

S05 stays not verified. The value Companion writes is correct, but no logon launch has been observed yet.

@Speculorum9, if you have time, could you run this positive logon check on your machine? Same overlay approach as before, on an Inno install:

  1. Quit Companion and back up as before. Overlay the openclaw-tray-win-x64 artifact from CI run https://github.com/openclaw/openclaw-windows-node/actions/runs/43315164657 (head a511d24b; as before it is built from GitHub's merge commit).
  2. Start Companion and turn Start with Windows On in Settings.
  3. Check the Run value: reg query HKCU\Software\Microsoft\Windows\CurrentVersion\Run /v OpenClawTray. It should be "<install folder>\OpenClaw.Tray.WinUI.exe" --background.
  4. Quit Companion, then sign out and sign back in (or restart). Do not start Companion yourself.
  5. After about a minute: is Companion running in the tray, without opening a window? And does this show a start?
    Get-WinEvent -FilterHashtable @{ LogName='Microsoft-Windows-Shell-Core/Operational'; Id=9707; StartTime=(Get-Date).AddMinutes(-10) } | Where-Object Message -match 'OpenClaw' | Select-Object TimeCreated, Message
  6. Afterwards you can turn the toggle Off again, or roll back to the signed build.

A short note with the step 3 value, the step 5 result and the line from openclaw-tray.log at startup is enough.

On CI: the red jobs on a511d24b are OnboardingSetupGalleryTests.NativePackagePages_KeepSharedHeroProgressAndActionsVisible (480 px, Light) and GatewayFixtureUiTests.Automations_ScopesToAgentsAndCoversMainStates (Light). Neither touches startup code, and main's own Build and Test was red on 3 of its last 4 runs. I have not reproduced them locally.

@Speculorum9

Speculorum9 commented Nov 12, 2026 •

Copy link
Copy Markdown

@MertBasar0: S05 (positive logon) passed on my machine, so it can be marked verified from a second system.

Build: artifact openclaw-tray-win-x64 from CI run 43315164657 (head a511d24b), SHA-256 b0ea0a21…6ce3, matching the artifact digest. Version reported: 2026.11.3-PullRequest1964.61+ecbb29cb. Overlaid with robocopy /E (295 files copied, 0 failed) over an Inno install, after backing up the Run key and the registry record.

Machine: Windows 11 Home 10.0.26300, x64, Inno install at C:\Users\rpill\AppData\Local\OpenClawTray\.

Step 3 (Run value). Before I touched the toggle, the existing value was unquoted:

C:\Users\rpill\AppData\Local\OpenClawTray\OpenClaw.Tray.WinUI.exe --background

I turned Start with Windows Off and On again (a "Saved" popup each time). The value then became:

OpenClawTray    REG_SZ    "C:\Users\rpill\AppData\Local\OpenClawTray\OpenClaw.Tray.WinUI.exe" --background

There is no StartupApproved entry.

Step 4. I closed Companion from the tray, then restarted Windows, and did not start it myself.

Step 5. Companion started on its own about 90 seconds after the restart (it came up after the other tray apps), running in the tray without a window. The event query shows:

18:49:24  Started execution of command 'OpenClaw.Tray.WinUI.exe --background'.

openclaw-tray.log at startup:

[18:49:26.867] [INFO] Connecting to last successful gateway during startup: ws://<host>:18789/ (identity.DeviceToken)
[18:49:27.804] [INFO] Application started (WinUI 3)

Companion on this machine is still running this build. I can roll back to the signed build whenever you tell me to, or test another head first.

@MertBasar0

Copy link
Copy Markdown
Contributor

@Speculorum9 thank you, that closes S05 from a second machine. The Run value written by a511d24b was quoted with --background, Windows started it at logon (event 9707), and Companion came up in the tray without a window.

Your step 3 also confirms a boundary the PR already lists: the value that was there before was the older unquoted form (<install>\OpenClaw.Tray.WinUI.exe --background). This PR does not rewrite an existing unquoted value on its own (Finding 4, out of scope), but turning the toggle Off and On replaced it with the quoted one, as intended.

I'll update the PR body with your S05 result next to my host-blocked attempt. S18 (the setup wizard and a customized startup shortcut through the installer) is still open, and I'll post separate steps for it if we can make it a small check.

You can roll back to the signed build whenever you like. Thanks again!

@MertBasar0

Copy link
Copy Markdown
Contributor

Correction to my S05 report above (#1964 (comment)) and to the earlier S06 PASS from my machine.

The cause was my test setup, not Windows and not this PR. The agent that drove these runs is started by the Claude desktop app, which on my machine is an MSIX package. Every process it started (the installer, Companion, and my scripts, including the one that wrote the control entry) inherited the package context, so their writes under %LOCALAPPDATA%, %APPDATA% and HKCU went to the package's private storage. Inside the session everything looked correct; Windows itself never saw it.

I confirmed this on 2026-11-13 from a scheduled task, which runs outside the package: the Dev install folder and the Dev uninstall key (an HKCU key the installer wrote from the session) do not exist in the real profile. They exist only in the package's private storage (its LocalCache folder and registry hive).

What this means for #1964:

  • S05 on my machine: not a host limitation. Explorer never started the Dev Run value or the cmd.exe control entry because both were written into the package's private HKCU. Speculorum9's S05 PASS on their own machine is unaffected and stands.
  • S06 (boots on 11-02, 11-03 and 11-05): withdrawn. Windows could not see the Dev install, so nothing could have started at logon either way. The result proves nothing, and S06 needs a rerun.
  • The other cases from my machine (S00, S03, S04, OBS-494 and the session checks) show what the installer and Companion wrote and read in that view. They are not evidence of what Windows itself sees at logon.

I'll rerun S06, and S05 on my side, with the installer and Companion started outside the package, and update the PR body to match. Sorry for the noise.

@MertBasar0

Copy link
Copy Markdown
Contributor

S05 and S06 were rerun at a511d24b on MertBasar0's machine (Windows 11 Home 26200, not elevated), outside the Claude desktop MSIX package. This replaces the withdrawn S06 and the S05 non-result from the correction.

Setup. Every install, launch and state read was done by a process outside the package.

  • The Dev installer built from a511d24 was installed silently with /TASKS="". The installed OpenClaw.Tray.WinUI.exe matches the publish payload hash.
  • Dev settings were set to {"EnableMcpServer": true}. This is MCP-only mode, with no Gateway, pairing or credentials.
  • Companion was started without arguments.

Side note: with no AutoStart key in the settings file, SettingsData.AutoStart defaults to true. The toggle therefore read On while no Run value, task or shortcut existed. This comes from skipping first-run setup, which normally writes the value, and it matches the existing "Stored AutoStart=true without registration still stays true" gap. Mert turned the toggle Off and then On to register it.

Before logon 2:

  • Run value OpenClawTray-Dev = "<install>\OpenClaw.Tray.WinUI.exe" --background.
  • No StartupApproved entry, no scheduled task, no Startup-folder shortcut.

S05 PASS (logon 2):

  • Shell-Core 9707: Started execution of command 'OpenClaw.Tray.WinUI.exe" --background'. Event 9708 then reports it finished with a PID.
  • That PID is the only Dev process. Its parent is explorer.exe, its command line is "<install>\OpenClaw.Tray.WinUI.exe" --background, and its MainWindowHandle is 0.
  • The log shows MCP-only mode and Application started, with no setup window.
  • The Run value was kept.

Prep C: Mert turned Start with Windows Off in that logon-started Companion. The Run value was removed. There was still no task and no shortcut, and the stored value was AutoStart=false.

S06 PASS (logon 3):

  • Windows enumerated HKCU Run (9705/9706) and started the other entries.
  • There was no 9707/9708 for OpenClaw.Tray.WinUI.exe, no Dev process, and no Dev log line since logon.
  • Run value, task and shortcut were still absent, and the stored value was AutoStart=false.
  • This was checked again after the Run pass had finished.

Afterwards, the Dev build was uninstalled outside the package. The Release install was not touched.

Still open: S18 (the setup wizard path), the signed upgrade pools, and the other items under "Not verified or blocked".

@roboclaw-bot

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

🦞👀
Exact review queued.

Re-review progress:

@Speculorum9

Speculorum9 commented Nov 17, 2026 •

Copy link
Copy Markdown

Thanks for the re-review. Here's a summary of where this stands at head a511d24b:

  • ClawSweeper found no code defects. The remaining blocker is the data-model compatibility proof, meaning existing installs upgrade cleanly. It also flagged the legacy unquoted Run entry with arguments as a partial-coverage case.
  • @MertBasar0's S05 and S06 results at this head are passing. For the signed latest-stable upgrade, is S18 or an upgrade pool in your queue? That seems the most direct way to close the compatibility item.
  • I can try the unquoted legacy Run entry scenario on my Windows machine and post the result here. Let me know if that works, or whether you'd prefer a different setup.

@Speculorum9

Speculorum9 commented Nov 18, 2026 •

Copy link
Copy Markdown

Result for the unquoted legacy Run case (Finding 4), tested on my machine.

Setup: Windows 11 Home, Companion file version 2026.11.3-PullRequest1964.61+ecbb29cb, which is the CI merge of head a511d24b into main at 96f3b25f. Starting state, set by hand: HKCU\...\Run\OpenClawTray in the unquoted form (<install>\OpenClaw.Tray.WinUI.exe --background), the original installer shortcut OpenClaw Companion.lnk in the Startup folder, and stored AutoStart=false.

Step Observed
Restart Windows, toggle Off Companion started at logon. Toggle showed Off, stored false. Run value and shortcut unchanged.
Turn Start with Windows On Stored true. Run value still unquoted, shortcut unchanged.
Turn it Off Stored false. Run value and shortcut both still present.
Restart Windows again Companion started at logon again.

So the On-then-Off recovery does not clear this state: both startup entries survive it and the original symptom remains.

Limits: both entries were active on each restart, so I can't say which one launched the Companion. This is one machine, and the starting state was recreated by hand, not left by an installer.

I can run a round with the shortcut moved aside if that would help.

@MertBasar0

Copy link
Copy Markdown
Contributor

@Speculorum9 thank you for the Finding 4 round. It found a real gap: the unquoted Run value plus the shortcut survives the upgrade too, not only the On/Off toggle. Row F8 below reproduces it, and the second commit fixes it at upgrade.

Where the fix is. Two commits on top of this PR's head a511d24b, on branch MertBasar0:fix/1964-migration-order: cd83c98c (F7) and 735164c7 (F8). They are not on this PR yet. This PR is published through Roboclaw, and its required pre-publication review has failed four times on infrastructure (a Gateway restart and result timeouts), never on a finding. I'll post a short follow-up once they land here; until then the head below is still a511d24b.


Latest-stable upgrade proof for the data-model compatibility item: v2026.11.3 (66b9b5a) to this PR, on Windows 11 Home 26200, run outside the Claude desktop MSIX package.

How it was run.

  • Both installers are unsigned Dev-identity builds made from source with scripts\build-inno-local.ps1 -Dev -Fast:
    • v2026.11.3 built as 2026.11.3;
    • this PR built as 2026.11.4-proof (a511d24), then 2026.11.4-proof2 (a511d24 plus the fix below).
  • Each row started from a clean state, then:
    1. Fresh install of 11.3, with Dev settings {"EnableMcpServer": true} (MCP-only, so no setup, Gateway or credentials are involved).
    2. The row's state was created with 11.3's own installer or Settings toggle. Where a hand seed was used, the row says so.
    3. 11.3 was started once.
    4. Plain silent upgrade: /SILENT /SUPPRESSMSGBOXES /NORESTART, with no /TASKS.
    5. The new build was started.
  • Each step was compared against a snapshot taken before it. The snapshot covers:
    • settings.json (hash and all 68 keys);
    • the OpenClawTray-Dev Run value;
    • StartupApproved\Run and StartupApproved\StartupFolder bytes;
    • the Startup-folder link's target and arguments;
    • the scheduled task;
    • the files in the Dev data folder.
  • The Settings toggle was read with UI Automation (SettingsPageAutoStart).
  • The signed release-identity upgrade is still not covered here.
Row State left by 11.3 After upgrade and first start
F1 Installer Startup-folder link (--background), AutoStart=true Log: Migrated Startup folder shortcut to the Run registration. Link deleted, Run = "<install>\OpenClaw.Tray.WinUI.exe" --background. Settings byte-identical, toggle On.
F2 The #1956 state: link, plus Settings Off in 11.3 (11.3 removed only Run/task), AutoStart=false Link migrated to Run. At first start, AutoStart was promoted false to true. That was the only one of 68 keys that changed. This is the intended adoption: under 11.3 the link still started the app at every logon. Turning Off in this build then left no Run value, no link and no task.
F3 Link disabled in Task Manager (StartupApproved\StartupFolder = 03…), Settings Off Link kept, approval bytes identical, no Run value written, AutoStart stays false, toggle Off.
F4 Link arguments customized (hand seed) Log: The Startup folder shortcut was customized. It was left in place. Link byte-identical, no Run value.
F5 Settings On in 11.3 (Run "<install>\…exe" --background) Run value and settings unchanged, toggle On.
F6 Settings Off, nothing registered Nothing created, AutoStart false, toggle Off.
F7 Link plus the argument-free Run value "<install>\…exe" written by 11.3's setup fallback (hand seed of that exact value) At a511d24 both survived. MigrateLegacyStartupShortcut ran first and left because the Run value was not yet the --background command. MigrateLegacyBackgroundLaunch then rewrote it. Task Manager showed two "OpenClaw Companion (Dev)" startup entries. Turning Off in Settings removed only the Run value, so the link kept starting the app. Fixed in cd83c98c (run the Run rewrite first). With the fix, the log shows both migrations in order, the link is deleted and one --background Run value remains.
F8 Link plus the unquoted Run value <install>\…exe --background that 11.3's own installer migration writes (AddQuotes leaves a path without spaces unquoted). This is the Finding 4 state Speculorum9 tested above (hand seed of that exact value). With the order fix alone both survived: no migration was logged, because neither migration recognized the unquoted value. Fixed in 735164c7 (the Run migration also rewrites that exact unquoted value). With the fix, both migrations log in order, the link is deleted and one quoted --background Run value remains. Settings unchanged, toggle On.

Logon (after a restart) with the fixed build, F1 state.

  • Shell-Core 9707/9708 ran 'OpenClaw.Tray.WinUI.exe" --background'.
  • The 9708 PID was the only Dev process: parent explorer.exe, --background, MainWindowHandle 0, MCP-only.
  • No link remained.

Validation of the fix.

  • Two commits:
    • CurStepChanged now calls MigrateLegacyBackgroundLaunch before MigrateLegacyStartupShortcut (F7).
    • MigrateLegacyBackgroundLaunch also rewrites this installation's exact unquoted <exe> --background value to the quoted command (F8). Other values are left alone.
  • New tests, each failing before its commit and passing after:
    • InstallerIssAssertionTests.Installer_RewritesTheArgumentFreeRunValueBeforeRetiringTheStartupShortcut;
    • InstallerIssAssertionTests.Installer_RunMigrationQuotesTheUnquotedBackgroundValueEarlierInstallersWrote.
  • ./build.ps1 passed.
  • Tray: 6368 passed, 1 failed. The failure is the host-only FileWorkerManifestTests…VCRUNTIME140.dll, which also fails at a511d24.
  • Shared: 13 failed, the same host-only reparse and symlink-privilege failures as at a511d24.

Not covered.

  • F2, F3, F5 and F6 ran at a511d24. They involve neither an argument-free nor an unquoted Run value, so neither change affects them.
  • F1 and F4 were rerun with the order fix; F7 and F8 were rerun with both fixes (2026.11.4-proof3).
  • The fix applies at upgrade. Before upgrading, turning the toggle On and Off still leaves Speculorum9's state in place, as reported above.
  • Hand seeds are labeled as such.
  • The setup wizard (S18) is still not run.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. P2 Normal priority bug or improvement with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Turning off Start with Windows does not stop the startup shortcut the installer created

4 participants