Skip to content

Installer upgrade hangs on schtasks /Change when an argument-free startup task exists #2320

In review

Description

@MertBasar0

Summary

MigrateLegacyBackgroundLaunch in installer.iss updates an argument-free startup task with:

schtasks /Change /TN "<task>" /TR "\"<exe>\" --background"

It runs through Exec(..., SW_HIDE, ewWaitUntilTerminated, ...). For the task I tested, schtasks prompts on its hidden console for Please enter the run as password for <user>: and waits. The upgrade therefore never finishes.

Reproduction (Windows 11 Home 26200, unsigned Dev-identity builds from source)

  1. Install a v2026.11.3 Dev build.
  2. From an elevated prompt, create the pre-feat(workspace): add native Home and Sessions workspace #1541 argument-free task:
    schtasks /Create /TN "OpenClaw Companion (Dev)" /TR "\"<install>\OpenClaw.Tray.WinUI.exe\"" /SC ONLOGON /F.
  3. Run a newer Dev installer non-elevated: /SILENT /SUPPRESSMSGBOXES /NORESTART /LOG=….

Result.

  • Files are installed and the log reaches Installation process succeeded.
  • Setup then stays at ssPostInstall with a child schtasks.exe /Change … running.
  • I waited over 6 minutes. After schtasks.exe was ended, the log showed Could not migrate startup task. Re-enable Start with Windows in Settings. and setup exited.

The same command run non-elevated with redirected output: it did not exit within 15 s; stderr was Please enter the run as password for <user>:; the task was unchanged.

Scope

  • The code is the same in v2026.11.3 (66b9b5a) and current main.
  • It only runs for a task whose single action is this installation's executable with empty arguments.
  • On this machine such a task can only exist if an elevated process created it, because non-elevated /Create /SC ONLOGON is denied. I could not test a task a standard user created on a machine that allows it.

Possible directions (not tested)

  • Bound the wait: use ewNoWait plus a timeout, or give schtasks a closed stdin, so the migration fails closed with its existing log line.
  • Or change the action through the Task Scheduler COM object (RegisterTaskDefinition with TASK_UPDATE) instead of schtasks /Change. The migration already uses that object to read the task.

Activity

  1. added
    clawsweeper:intake:bug
    P2
    clawsweeper:fix-shape-clear
    clawsweeper:queueable-fix
    clawsweeper:source-repro
    impact:crash-loop
    issue-rating: 🦞 diamond lobster
    no-stale
    and removed
    clawsweeper:intake:bug
    on Nov 18, 2026
  2. clawsweeper commented on Nov 18, 2026

    @clawsweeper

    Codex review: this still needs some work.

    Summary
    This issue remains valid on current main, and an open PR explicitly owns the fix, so it should stay open until that PR is resolved.

    Reproducibility: Current source establishes the hidden, unbounded synchronous wait; the reporter supplies the Windows task shape and password-prompt reproduction, corroborated in the linked PR, but this review ran no native reproduction or tests.

    Regression provenance
    Possible regression — suspected (reviewed change). No predecessor PR is attributed.

    Root-cause cluster
    Relationship: canonical
    Canonical: #2320
    Summary: This issue owns the installer hang, and the linked open PR directly targets its blocking migration call.

    Members:

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

    Next step
    Review and complete signed upgrade validation for #2373 (fix: finish Companion upgrades that hung on the old startup task), including visible recovery guidance for refused migration, before closing this issue.

    Review details

    Best possible solution:

    Complete the linked PR’s signed-installer validation and land its noninteractive migration with visible Settings recovery when Windows refuses the update.

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

    Current source establishes the hidden, unbounded synchronous wait; the reporter supplies the Windows task shape and password-prompt reproduction, corroborated in the linked PR, but this review ran no native reproduction or tests.

    Is this the best way to solve the issue?

    The linked PR addresses the existing migration owner directly through Task Scheduler COM, retaining ownership checks and handling denied updates without interactive child-process machinery; signed-artifact acceptance remains necessary.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • The candidate fix has unsigned Dev-installer evidence, but its required signed-artifact upgrade acceptance remains unverified.
    • Password-logon tasks and an updateable task with a real logon trigger remain unverified in the candidate PR.

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

    Label changes

    Label changes:

    • add P0: The specified UX override applies: an affected upgrade cannot finish, and recovery requires identifying and terminating a hidden child process.
    • add impact:ux-release-blocker: The installer offers no in-product way past the hidden password prompt.
    • add clawsweeper:linked-pr-open: Current issue advisory state selects this label.
    • add clawsweeper:no-new-fix-pr: Current issue advisory state selects this label.
    • remove P2: Current review triage priority is P0, so this older priority label is no longer current.
    • remove clawsweeper:queueable-fix: Current issue advisory state no longer selects this label.
    • remove clawsweeper:fix-shape-clear: Current issue advisory state no longer selects this label.

    Label justifications:

    • P0: The specified UX override applies: an affected upgrade cannot finish, and recovery requires identifying and terminating a hidden child process.
    • impact:ux-release-blocker: The installer offers no in-product way past the hidden password prompt.
    • impact:crash-loop: The installer suffers a demonstrated process-level hang.
    Evidence reviewed

    What I checked:

    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 26, 2026, 12:23 AM ET / 05:23 UTC.

  3. added
    P0
    clawsweeper:linked-pr-open
    clawsweeper:no-new-fix-pr
    impact:ux-release-blocker
    and removed
    P2
    clawsweeper:queueable-fix
    clawsweeper:fix-shape-clear
    no-stale
    on Nov 26, 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:no-new-fix-prclawsweeper:source-reproimpact:crash-loopimpact:ux-release-blockerissue-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