fix(update): guard Windows task autostart during package updates#100757
Conversation
Dependency graph guard clearedThis PR no longer has blocked dependency graph changes. A future dependency graph change requires a fresh
|
Co-authored-by: Vincent Koc <[email protected]>
73c88f5 to
e685938
Compare
|
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. |
|
Land-ready maintainer replay of #88292. What changed:
Proof on prepared head
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. |
|
Merged via squash.
|
…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]>
…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]>
What Problem This Solves
Legacy Windows Gateway Scheduled Tasks can contain a
PT3Mrepetition 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
CHANGELOG.md; the seven code commits range-diff identically, followed by a second green focused suite and changed-gate run.