Repository navigation
fix: finish Companion upgrades that hung on the old startup task - #2373
roboclaw-bot wants to merge 2 commits into
Conversation
Worked on by: - @MertBasar0 Co-authored-by: MertBasar0 <[email protected]> OpenClaw-Publication: 6362370f-8338-46de-9b4f-b21b8863d148
|
🦞👀 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. |
|
Codex review: blocked before merge. What this changesThis PR replaces an interactive startup-task migration command with a noninteractive Task Scheduler COM update. Example: A Windows 11 silent upgrade encounters an argument-free OpenClaw Companion startup task.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains This PR fixes a verified installer hang that remains on main and in v2026.11.3; no actionable correctness or security defect was found. Reviewed head: Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe Inno installer runs legacy startup migration after installing files, reads the installation's existing Windows scheduled task, and saves its action arguments through Task Scheduler. flowchart TD
A[Companion installer] --> B[Post install migration]
B --> C[Existing task definition]
C --> D[Installation ownership guards]
D --> E[Task Scheduler COM update]
E --> F[Updated task or logged refusal]
F --> G[Setup finishes]
Technical reviewBest possible solution: Retain the guarded COM update in the existing installer migration and complete the required signed-artifact validation. Do we have a high-confidence way to reproduce the issue? Current-main source confirms the hidden synchronous wait, and the linked report and PR supply Windows reproductions with the password prompt and blocked installer; this review did not execute them. Is this the best way to solve the issue? The direct COM update addresses the interactive command at its existing owner, preserves the original migration guards, and catches refused saves without adding timeout or child-process machinery. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against e4bedeb1d2cc. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
Preflight sourceSource 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
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes: No label 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 HistoryReviewed November 25, 2026, 8:22 AM ET / 13:22 UTC (Revision 3). |
|
I also ran the original #2320 case on the same Windows 11 machine: a legacy task created from an elevated prompt, then a non-elevated silent upgrade. It used the Dev identity and the same two installers as the PR body: main The task was created elevated with
For this case the change ends the hang, but it does not migrate the task. A standard user cannot write a task that an administrator created, so setup logs the existing line and finishes. The task keeps starting Companion at logon without |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Worked on by: - @MertBasar0 Co-authored-by: MertBasar0 <[email protected]> OpenClaw-Publication: eda987ee-d21a-416d-946b-c599de625a54
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Closes #2320
What Problem This Solves
Upgrading Companion can hang forever when the PC still has the old startup task that launches Companion without
--background. Setup moves that task to--backgroundwithschtasks /Change.schtasksthen asks for the account's password on a console window that setup keeps hidden, and setup waits for an answer that never comes.The task does not have to be unusual. A plain task created by the signed-in user, with no stored password, triggers the prompt (proof below).
User Impact
User impact: an upgrade over the old startup task finishes. The task is moved to
--background, and its account, logon type, triggers and enabled state stay as they were. If Windows refuses the change, setup logs the existing "Re-enable Start with Windows in Settings" line and carries on.Why This Change Was Made
The migration already reads the task through the Task Scheduler COM object (
Schedule.Service). It now changes the action's arguments on that same definition and saves it withRegisterTaskDefinition, passing the task's own logon type and no account or password. The flags areTASK_UPDATE,TASK_IGNORE_REGISTRATION_TRIGGERS(saving cannot start a task that has a registration trigger) andTASK_DONT_ADD_PRINCIPAL_ACE(the task's security descriptor is left as it is). This API has no console and cannot prompt. Its errors are caught, so a refused update fails closed instead of stopping setup.What did not change:
schtasks /Delete /F).Required proof pools
windows-clean-installer-upgrade: the installer's upgrade path changed. The runs below use unsigned Dev-identity installers, not the signed artifacts this pool requires.Validation
First commit: source
2a70483b(tree0950211f) on main17cadf79, Windows 11 Home 26200 x64. The installer used in the first proof runs below was built from this tree'sinstaller.iss(blob1f95bfd4).InstallerIssAssertionTests: RED on main (2 of 22 failed: the updated existing assertion and the newInstaller_UpdatesTheLegacyStartupTaskWithoutAnInteractiveCommand). GREEN with the fix (22/22)../scripts/Test-InstallerScriptCompiles.ps1 -RequireCompiler: compiles for x64, arm64 and x64 DevBuild../build.ps1: passed.OpenClaw.Tray.Tests: 6948 passed, 1 failed. The failure isFileWorkerManifestTests…("VCRUNTIME140.dll"), which also fails on this host on plain main.OpenClaw.Shared.Tests: 5958 passed, 13 failed, 30 skipped.a1a26972, tree5b45e505,installer.issblobf7ba8d58):InstallerIssAssertionTests: 1 of 22 failed with the previous head'sinstaller.iss, and 22/22 passed with the flags../build.ps1passed.Real Behavior Proof
Run on a real Windows 11 desktop session, Dev identity only (
OpenClaw Companion (Dev)), non-elevated, with/SILENT /SUPPRESSMSGBOXES /NORESTART. Before each upgrade the test registered the old task shape: one action,"<app>\OpenClaw.Tray.WinUI.exe", no arguments. Because it was registered without elevation, the task has no logon trigger: a standard user cannot create one on this machine.installer.issidentical to17cadf79)schtasks.exe /Change /TN "OpenClaw Companion (Dev)" /TR "\"<app>\OpenClaw.Tray.WinUI.exe\" --background". After that child was ended, setup loggedCould not migrate startup task.and exited. Task arguments still empty.Migrated existing scheduled task to background launch.Task arguments--background. Logon type Interactive, run level Limited, same user, enabled, and same trigger and action count as before.The same
schtasks /Changecommand run directly against such a task, with redirected input, printedPlease enter the run as password for <user>:and did not exit within 15 s. A COM update of the same task finished in 17 ms and kept its logon type.Task created from an elevated prompt (the #2320 case)
The legacy task was created elevated with
schtasks /Create /SC ONLOGONand no/RU. That gives a logon trigger, Interactive, Limited, and no arguments. The signed-in user gets read access only. The upgrade then ran without elevation.schtasks.exe /Changechild. After that child was ended, setup loggedCould not migrate startup task.and exited. Task unchanged.Could not migrate startup task. Re-enable Start with Windows in Settings.Task unchanged: no arguments, Interactive, Limited, logon trigger, enabled.Here the change ends the hang, but it cannot migrate the task because a standard user cannot write it. The end state is the same one main reaches after its hang is ended.
Afterwards the Dev install, its folders and its task were removed. The installed Companion and its
OpenClaw Companionstartup task were unchanged.Registration trigger (flags commit)
A legacy task can also carry a registration trigger, and saving its definition with
TASK_UPDATEalone runs it. Both upgrades below ran over an argument-free task with one registration trigger, created by the signed-in user.7b919f57(TASK_UPDATEonly)--background, and the save started Companion:"<app>\OpenClaw.Tray.WinUI.exe" --background, and the task's last-run time moved.--backgroundin 9.4 s. Nothing started, and the last-run time was unchanged.Other runs with the flags build:
TASK_DONT_ADD_PRINCIPAL_ACEmade no difference that could be seen on this host. In a direct Task Scheduler probe, a task with a customized security descriptor kept it unchanged withTASK_UPDATEalone and with the new flags. Here this flag is a safeguard, not a fix for an observed problem.Not verified / blocked
windows-clean-installer-upgradepool (maintainer-scheduled).Data compatibility
The only stored state this change touches is the existing Windows scheduled task. It writes no app settings or files. On upgrade, the task either gets
--backgroundwith every other field kept, or it stays exactly as it was:--background. Account, logon type, run level, enabled state, triggers and actions unchanged.--background, and saving does not start the task. Other fields unchanged.--background)CI attribution at
7b919f57(previous head)This PR changes only
installer.issandInstallerIssAssertionTests.cs.Setup and connect E2E (WSL Latest)failed inSetupAndConnectTestsSearchProof.ReleasedGateway_SearchDenialAndDashboardRoutes. The same test failed on main3981f636, this PR's base, in run 45558413148.Mock Gateway application and compatibility testsfailed in the chat UI testGatewayFixtureUiTests.LocalDraft_SendAcceptedAfterAwayAndBack_PromotesNavigationIdentity. That test does not use the installer.CI Gatereports those two failures.Work sessions
Linked for team reference; these sessions aren’t public.
Worked on by