Repository navigation
fix(update): restore Windows task autostart after cancellation - #161990
Conversation
|
🦞👀 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. Reviewed September 30, 2026, 2:18 PM ET / 18:18 UTC (Revision 7). ClawSweeper reviewWhat this changesThe branch lets the updater restore or compensate Windows Scheduled Task autostart after cancellation and updates the signal regression test and CLI documentation. Merge readiness⛔ Blocked before merge - 2 items remain Keep this PR open. Current main still uses forward admission during Windows cancellation recovery, and the focused repair has no identified code defect. Native Windows Scheduled Task proof remains the landing gate. Priority: P2 Review scores
Verification
How this fits togetherThe update command temporarily disables Gateway Scheduled Task autostart while preparing an installation change. Its recovery path checks the original update executor and task before restoring autostart or reporting a failure. flowchart LR
A[Update command] --> B[Task autostart suspended]
B --> C[Cancellation signal]
C --> D{Executor and task current?}
D -->|Yes| E[Restore autostart]
D -->|No| F[Report recovery failure]
B --> G[Installation mutation]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -2, Tests +11, Docs +6. Total +15 across 4 files. View PR surface stats
Review metricsNone. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep phase-scoped compensation in the installed updater, with a native Windows cancellation run demonstrating restoration and changed-owner refusal before landing. Do we have a high-confidence way to reproduce the issue? Yes. The reported hosted failure and pre-fix callback regression identify the cancellation path, while current main still contains the forward-check call; native Windows behavior remains to be demonstrated. Is this the best way to solve the issue? Yes. Passing the existing restore phase only through compensation is a narrow repair that retains forward mutation fencing and the existing executor and task checks. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b475dc5df407. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (6 earlier review cycles)
|
176f0d3 to
50f76a5
Compare
|
Merged via squash.
|
Integrate main f02c8eb for the actual merge conflict. Keep the canonical Windows recovery source, tests, and documentation from #161990 without a competing repair. The 18 catalog files are unchanged from fe2610d. Post-resolution Testbox proof passed 54 catalog adoption, composed performance, and Windows recovery/ownership cases.
Preserve canonical #161990, its real callback fixture and documentation. Retain the separately proven failed-disable compensation and pre-stop cleanup fixes; the resulting change against main spans four files.
Carry the reviewed residual from #162050 at db545dc while preserving canonical #161990 restoration forwarding. Keep forward admission strict and use the original restore authority only for failed-disable compensation and pre-stop cleanup. The original executor and native service checks remain intact. The owning exact-main controls fail before the repair; the composed original CLI and native recovery suites pass 30 cases under simulated win32 on Darwin. Full selected checks and independent review passed at the repair owner. This receiving cut preserves the four qualified postimages exactly; it makes no native Windows execution claim.
* fix(plugins): await activation health cleanup * fix(update): preserve Windows cancellation compensation Carry the reviewed residual from #162050 at db545dc while preserving canonical #161990 restoration forwarding. Keep forward admission strict and use the original restore authority only for failed-disable compensation and pre-stop cleanup. The original executor and native service checks remain intact. The owning exact-main controls fail before the repair; the composed original CLI and native recovery suites pass 30 cases under simulated win32 on Darwin. Full selected checks and independent review passed at the repair owner. This receiving cut preserves the four qualified postimages exactly; it makes no native Windows execution claim. * refactor(plugins): keep activation cleanup scope focused Canonical Windows restoration fixes already resolve the original CI blocker. Leave the distinct failed-DISABLE compensation and additional regressions solely with #162050 instead of carrying its independent product change here. Preserve all 40 qualified activation file contents and the canonical updater owners. * test(gateway): bound hot-reload failure diagnostics Record phase, queued-result and lifecycle scalars only when the existing reload fixture fails. Preserve all waits, assertions and cleanup while replacing full serialized model requests with bounded diagnostics. The original CI timeout remains unattributed; the larger-host Linux pass is negative reproduction, not a failure waiver. * fix(github-copilot): reuse host-authorized setup credentials Fix red main exposed by 3c0ae56 (#162020), which added real Gateway retry coverage. Bisect confirms its parent passes and that commit first fails because the expected existing-account confirmation becomes a login note. Setup already supplies the saved profile, but Copilot's separate runtime store lookup sees none. Use the host-authorized existingProfiles contract introduced by 67fd7e9 for selection and resolve the selected credential's SecretRef directly. Preserve same-tenant reuse, forced login on tenant changes, and the unchanged first-signin integration assertions. Extend the provider cases for authorized re-login, reference-backed reuse, and absent/empty candidate lists. All four regressions fail on the old owner. Remove the retired TTY fixture and consolidate assertions without increasing the test file's counted lines. Validation: exact first-signin integration 3/3 passes; 277 sibling tests in 18 files; 56 provider tests (22.14s wall with one worker); core typecheck; changed-file checks; formatting and git diff --check. Independent autoreview through P1 completed before commit. * test(plugins): supply authorized Copilot reuse profiles Keep the shared provider auth contract fixture aligned with the existing host-authorized profile input used by the canonical Copilot reconnect repair. Preserve its original credential, model and configuration assertions. This is the exact reviewed fixture-only handoff from the independent reconnect owner; its separate authority follow-up remains outside this change.
Reuse main's canonical cancellation compensation owner from 05d3c90 (openclaw#161990), removing the parallel production implementation during conflict resolution. Preserve both regressions through its existing restore-phase API: forward cancellation permits original-task compensation, while owner revocation across inspection denies enabling. Four affected Windows test files passed 38 cases on this base; CLI-update test types, focused lint/format and GPT 6 Astra P0-P2 reconciliation review pass. Earlier full feature evidence remains revision-scoped. Co-authored-by: VACInc <[email protected]>
…law#161952) * fix(plugins): await activation health cleanup * fix(update): preserve Windows cancellation compensation Carry the reviewed residual from openclaw#162050 at db545dc while preserving canonical openclaw#161990 restoration forwarding. Keep forward admission strict and use the original restore authority only for failed-disable compensation and pre-stop cleanup. The original executor and native service checks remain intact. The owning exact-main controls fail before the repair; the composed original CLI and native recovery suites pass 30 cases under simulated win32 on Darwin. Full selected checks and independent review passed at the repair owner. This receiving cut preserves the four qualified postimages exactly; it makes no native Windows execution claim. * refactor(plugins): keep activation cleanup scope focused Canonical Windows restoration fixes already resolve the original CI blocker. Leave the distinct failed-DISABLE compensation and additional regressions solely with openclaw#162050 instead of carrying its independent product change here. Preserve all 40 qualified activation file contents and the canonical updater owners. * test(gateway): bound hot-reload failure diagnostics Record phase, queued-result and lifecycle scalars only when the existing reload fixture fails. Preserve all waits, assertions and cleanup while replacing full serialized model requests with bounded diagnostics. The original CI timeout remains unattributed; the larger-host Linux pass is negative reproduction, not a failure waiver. * fix(github-copilot): reuse host-authorized setup credentials Fix red main exposed by c3dd660 (openclaw#162020), which added real Gateway retry coverage. Bisect confirms its parent passes and that commit first fails because the expected existing-account confirmation becomes a login note. Setup already supplies the saved profile, but Copilot's separate runtime store lookup sees none. Use the host-authorized existingProfiles contract introduced by 0d6ab3c for selection and resolve the selected credential's SecretRef directly. Preserve same-tenant reuse, forced login on tenant changes, and the unchanged first-signin integration assertions. Extend the provider cases for authorized re-login, reference-backed reuse, and absent/empty candidate lists. All four regressions fail on the old owner. Remove the retired TTY fixture and consolidate assertions without increasing the test file's counted lines. Validation: exact first-signin integration 3/3 passes; 277 sibling tests in 18 files; 56 provider tests (22.14s wall with one worker); core typecheck; changed-file checks; formatting and git diff --check. Independent autoreview through P1 completed before commit. * test(plugins): supply authorized Copilot reuse profiles Keep the shared provider auth contract fixture aligned with the existing host-authorized profile input used by the canonical Copilot reconnect repair. Preserve its original credential, model and configuration assertions. This is the exact reviewed fixture-only handoff from the independent reconnect owner; its separate authority follow-up remains outside this change.
What Problem This Solves
A Windows update cancelled after suspending Scheduled Task autostart can fail recovery with
requester-revoked, leaving autostart disabled instead of finishing cancellation.Related: #161881
User Impact
After successful suspension, cancelling before installation mutation restores the original task's autostart setting before exit. Forward update work remains cancelled, and restoration still checks the original update owner and native task identity.
This behavior belongs to the installed updater; a release containing the fix enables it for that release's next update. The separate native failed-
/DISABLEfallback is outside this change.Why This Change Was Made
Windows recovery was using the forward execution guard after interruption had deliberately closed forward admission. Pass the existing
restorephase only through restoration, compensating re-disable, and recovery settlement. Suspension, mutation admission, and handoff retain forward checks. The existing executor, invocation, and service-identity owners continue to decide authority.The signal regression now invokes the real
beforeMutationandassertCurrentcallbacks from its resume mock, instead of skipping the boundary that failed. No dependencies, schemas, permissions, timeouts, retries, or new test cases are added.Evidence
restores Windows Scheduled Task autostart on SIGINT during package suspension(1 failed / 680 passed across 37 files). The exact original-order group reproduced that result locally in 883.30s.01b2bf1ecb7f4b132ffe536e689b17845d788a18, with and without the unrelated SQLite production changes, failed identically withmanaged-service-stop-failed: UpdateRequesterRevokedError: requester-revoked(78.18s / 66.05s). The updater/test bytes were identical; the three SQLite files were restored from tested main parent1b31d2443e51dccc595b3e7208b8b696df26e222. Both runs used the canonical CI shard entrypoint on macOS arm64 / Node 24.21.0. No inherited-failure waiver is requested.pnpm test src/cli/update-cli.windows-lifecycle.test.ts src/cli/update-cli/update-command-windows-task.test.ts src/cli/update-cli/update-command-service-maintenance.windows-recovery.test.ts --maxWorkers=1: 31 passed, 182.30s wrapper. Existing SIGINT and SIGBREAK cases took 4.807s and 3.753s. Coverage includes changed-task refusal, executor loss, transferred/closed recovery, failed restoration, and compensating re-disable. These exercise Windows control callbacks on macOS; they are not a native Windows scheduler run.8e303782bb5677edbb27c77c222b568fb692dbbf, is already in the base. Its unchanged failing updater case passed with this Windows-only patch (13.361s test / 64.69s wrapper). No SQLite changes are carried here.pnpm check:changedpassed, including production types, all 27 selected test type graphs, lint, export scans, and boundary guards. Final docs formatting and Markdown lint passed (zero issues);git diff --checkpassed.50f76a5f080b53d4329e88279b809399d2854925: 148 successful / 21 skipped;openclaw/ci-gateand applicable security checks passed. No failed or cancelled test coverage was waived.[email protected]→ exact candidate50f76a5fpackage cell passed on Linux arm64 / Node 24.21.0: 582s lane, 619s overall. The real updater returnedstatus: ok; its receipt finished withstatus: succeeded. Installed identity, migrations, post-update Doctor, dependency cleanup, registry checks, and Gateway readiness/status passed. Cleanup joined and the container is absent. Candidate tarball SHA-256:36c166181f74901d43fe174956380e8e2c33e271a73581fbe6c1f387824eb6aa. The existing migration fixture accepts this published baseline; no fixture or assertion was changed.cbx_ec68e02f1719(run record). RealCTRL_BREAK_EVENTdelivery producedSIGBREAKand exit 130. The baseline left an initially enabled task disabled withrequester-revoked; the fixed owner restored it; an initially disabled task stayed disabled. All three children joined and all three uniquely owned tasks were deleted.commandMs=0, so it supplied no product evidence. No proof rerun concealed either result.Native Windows command and state observations
The temporary four-file harness ran from exact head
50f76a5f080b53d4329e88279b809399d2854925; it changed no product source.node scripts/crabbox-wrapper.mjs run --target windows --windows-mode normal --fresh-pr 'openclaw/openclaw#161990' --apply-local-patch --no-hydrate --timing-json --ttl 90m --idle-timeout 30m --stop-after always --label windows-cancel-native-fresh-pr -- powershell.exe -NoProfile -NonInteractive -File proof-native-windows/run.ps1requester-revoked)Every cell observed
SIGBREAK, rejected forward work, exited 130, and joined. The fixed enabled case checked native task identity during suspension and again before restoration. Cell times were 26.026s, 8.369s, and 8.293s. Native runtime: Node 24.19.0, Windows x64. Cold dependency setup took 14m39.8s.Verified SHA-256 values:
The portal had a stdout-event append timeout; the inspected local capture contains all three distinct cells and cleanup receipts. Its failure summary repeats some lines, rather than representing additional executions.
No CHANGELOG edit.