Skip to content

fix(update): guard Windows task autostart during package updates#100757

Merged
steipete merged 9 commits into
mainfrom
codex/pr-88292-replay
Jul 6, 2026
Merged

fix(update): guard Windows task autostart during package updates#100757
steipete merged 9 commits into
mainfrom
codex/pr-88292-replay

Conversation

@steipete

@steipete steipete commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Legacy Windows Gateway Scheduled Tasks can contain a PT3M repetition trigger. During a package update, stopping the running Gateway does not prevent that trigger from relaunching it while npm is replacing the package tree.

Fixes #87993. Replays and supersedes #88292 while preserving @vincentkoc's authorship.

Why This Change Was Made

Package updates now suspend only an enabled managed Scheduled Task before service or package mutation, retain that state through post-core work, and restore the original enabled state before restart, recovery, error return, or signal exit. Already-disabled tasks stay disabled; deleted tasks are treated as absent through a locale-independent Task Scheduler COM result; ambiguous query or mutation failures fail closed.

The replay also coordinates task restoration with the CLI's existing signal cleanup so Ctrl+C, Ctrl+Break, and proxy shutdown cannot race package mutation or lose the original failure. Git update behavior and non-Windows platforms remain unchanged.

User Impact

Windows package updates no longer risk a repeated Scheduled Task relaunching the Gateway against a partially replaced installation. Existing operator-disabled tasks are preserved, and stale gateway scripts without a Scheduled Task no longer block updates.

Evidence

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime cli CLI command changes size: L maintainer Maintainer-authored PR labels Jul 6, 2026
@steipete
steipete requested a review from a team as a code owner July 6, 2026 09:08
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: android App: android app: web-ui App: web-ui scripts Repository scripts commands Command implementations agents Agent runtime and tooling extensions: anthropic extensions: memory-wiki size: XL and removed size: L labels Jul 6, 2026
@github-actions github-actions Bot added the dependencies-changed PR changes dependency-related files label Jul 6, 2026
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Dependency graph guard cleared

This PR no longer has blocked dependency graph changes. A future dependency graph change requires a fresh /allow-dependencies-change comment after the guard blocks that new head SHA.

  • Current SHA: e6859381ad5f3daba6f3041648497d6796db8e35

@openclaw-barnacle openclaw-barnacle Bot added the channel: telegram Channel integration: telegram label Jul 6, 2026
@steipete
steipete force-pushed the codex/pr-88292-replay branch from 73c88f5 to e685938 Compare July 6, 2026 09:20
@openclaw-barnacle openclaw-barnacle Bot removed docs Improvements or additions to documentation channel: telegram Channel integration: telegram labels Jul 6, 2026
@openclaw-barnacle openclaw-barnacle Bot removed app: android App: android app: web-ui App: web-ui scripts Repository scripts commands Command implementations agents Agent runtime and tooling extensions: anthropic extensions: memory-wiki labels Jul 6, 2026
@github-actions github-actions Bot removed the dependencies-changed PR changes dependency-related files label Jul 6, 2026
@clawsweeper

clawsweeper Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: fix(update): guard Windows task autostart during package updates This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@steipete

steipete commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

Land-ready maintainer replay of #88292.

What changed:

  • During Windows package updates, suspend only an enabled managed Scheduled Task before stopping the Gateway and replacing the package tree.
  • Preserve already-disabled tasks, restore the original enabled state before recovery/restart, and fail closed when the task state cannot be proven.
  • Coordinate SIGINT, SIGTERM, and SIGBREAK cleanup so task restoration completes before process exit.
  • Preserve both primary and recovery failures through a causal AggregateError.

Proof on prepared head e6859381ad5f3daba6f3041648497d6796db8e35:

Known gap: the live Windows proof exercised task-state suspension/restoration and locale-independent existence probing, not a destructive real global package replacement. Exact-head CI and hosted build cover the package-update integration paths.

@steipete
steipete merged commit a13a198 into main Jul 6, 2026
110 of 114 checks passed
@steipete
steipete deleted the codex/pr-88292-replay branch July 6, 2026 09:33
@steipete

steipete commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 7, 2026
…nclaw#100757)

* fix(update): guard Windows task autostart

Co-authored-by: Vincent Koc <[email protected]>

* fix(update): preserve recovery error causes

* fix(update): retain restore failure causes

* fix(update): recover task on Ctrl+Break

* chore(update): document aggregate lint intent

* fix(update): tolerate deleted Windows tasks

* fix(update): preserve combined recovery failures

* fix(update): preserve aggregate error causes

* fix(update): construct aggregate causes consistently

---------

Co-authored-by: Vincent Koc <[email protected]>
giodl73-repo pushed a commit to giodl73-repo/openclaw that referenced this pull request Jul 8, 2026
…nclaw#100757)

* fix(update): guard Windows task autostart

Co-authored-by: Vincent Koc <[email protected]>

* fix(update): preserve recovery error causes

* fix(update): retain restore failure causes

* fix(update): recover task on Ctrl+Break

* chore(update): document aggregate lint intent

* fix(update): tolerate deleted Windows tasks

* fix(update): preserve combined recovery failures

* fix(update): preserve aggregate error causes

* fix(update): construct aggregate causes consistently

---------

Co-authored-by: Vincent Koc <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes gateway Gateway runtime maintainer Maintainer-authored PR size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Windows — openclaw update 期间 Scheduled Task PT3M 重复触发器重新拉起 gateway 导致竞态

1 participant