Repository navigation
fix(windows): install an unattended-capable Gateway task and size readiness to cold boot - #165163
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 October 5, 2026, 3:35 AM ET / 07:35 UTC (Revision 9). ClawSweeper reviewWhat this changesThe branch adds unattended Windows Gateway tasks, preserves Password registrations, migrates recognized older task definitions, and extends cold-start readiness allowances. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness⛔ Blocked before merge - 4 items remain The work remains necessary on current main, but both previously reported correctness blockers remain unresolved. The merged reinstall repair addresses a different service-lifecycle problem. Priority: P1 Review scores
Verification
How this fits togetherWindows Task Scheduler launches and supervises the Gateway from generated launcher files. Installation, Doctor, and update flows manage those definitions, while readiness observers determine whether the Gateway started successfully. flowchart TD
A[Install Doctor or update] --> B[Inspect existing task]
B --> C[Preserve or migrate task policy]
C --> D[Publish launcher files]
D --> E[Windows Task Scheduler]
E --> F[Supervised Gateway]
F --> G[Service and HTTP readiness]
G --> H[Ready starting or failed result]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +182, Tests +696, Docs +22, Other -1. Total +899 across 41 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one task lifecycle owner that refreshes every retained generated launcher, settles failed readiness promptly, and preserves existing registrations through a verified Windows upgrade. Do we have a high-confidence way to reproduce the issue? Yes, source establishes both introduced triggers: a stopped Gateway leaves uncancelled HTTP polling under the new 90-minute budget, and an identified-user Password task can retain an unrefreshed legacy VBS action. No runtime reproduction was executed. Is this the best way to solve the issue? Not yet: sharing the timing owner and preserving stored task credentials are sound directions, but failure settlement and retained-launcher publication must be completed before the implementation meets its lifecycle claims. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 56bdfc723e0d. LabelsLabel changes: No label changes. Label justifications:
EvidenceAcceptance criteria:
What 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 (8 earlier review cycles)
|
903544c to
cfe1463
Compare
cfe1463 to
a5f537a
Compare
Install S4U boot/logon tasks with a direct CMD action and repair shipped logon-coupled definitions through Doctor's backup and rollback owner. Preserve operator-managed Password registrations and launcher ownership. Share the existing update-step budget with Windows readiness observers. Thanks @desksk for the detailed report and corrected launcher analysis.
a5f537a to
6f6de5a
Compare
…diness to cold boot (openclaw#165163) Closes openclaw#143757 Reported and diagnosed by @desksk.
Closes #143757. Thanks @desksk for the detailed reproductions and corrected launcher analysis.
What Problem This Solves
Windows Gateway tasks can remain stopped after an unattended reboot because they require interactive logon, and short readiness windows report failure during cold starts that take tens of minutes.
Why This Change Was Made
The Windows task writer emits a password-free S4U principal, boot and logon triggers, and a direct CMD action. Doctor migrates recognized shipped logon-coupled definitions through the existing backup/rollback owner. The supervisor binds direct CMD launchers to their verified Windows Job Object owner so task termination contains the Gateway process tree.
resolveGatewayStartupTimingowns the Windows readiness budget used by wizard finalization (src/wizard/setup.finalize.ts), system-agent setup (src/system-agent/setup-apply.ts), and the update readiness verifier (src/cli/update-cli/update-command-readiness.ts). Setup reserves three default update steps (90 minutes). Implicit Windows update observation uses ten times measured canary startup, bounded between that floor and four steps (120 minutes). Explicit per-step--timeoutvalues remain authoritative. The same owner returns the diagnostic derivation, so displayed bounds and computed deadlines agree. This removes the erroneous one-hour cap that always clipped the previous 90-minute floor.User Impact
Installation reports its selected startup mode.
openclaw doctor --fixrepairs recognized older definitions with backup and rollback. Existing Password registrations retain their stored credentials, action, and triggers during launcher refresh; exported task XML cannot restore a password. Node hosts retain interactive desktop startup.S4U cannot use Windows network credentials or encrypted files. Operators needing those capabilities can retain a configured Password task. Boot-task registration requires sufficient Windows permissions. A desktop/Startup-folder fallback is explicitly reported and still requires logon. Updates preserve their existing still-starting outcome while allowing slow cold boots time to become ready.
Evidence
09242dc32ae1182f72856721170524882051f0f8to resolve conflicts withconfig/test-mock-exports-baseline.txt,src/daemon/schtasks-install.ts, andsrc/system-agent/setup-apply.test.ts; no behavior change.<Command>. Local reproduction matched all seven failures. This was stale test setup, not a production ordering defect: unattended tasks reference the existing CMD in<Arguments>. The fixture now reads that action, retains all six original retirement/interruption cases on the supported explicit desktop VBS path, and adds five unattended CMD rollback cases plus its compensation-warning case. Assertions verify original CMD bytes before re-registration, read-back of restored XML before VBS retirement, retained launchers and recovery instructions on failed compensation, and that the existing CMD is never deleted. Production backup/rollback ordering is unchanged.service-definition-backup.ordering.test.ts) passed 247 tests ×3 locally in 268.58 / 205.54 / 155.62 seconds wall. The first full gate caughtoxc(no-map-spread)in the new case table; replacing the spread with conditional arrays preserved every case and its order. The final ordering file then passed 24 cases ×3 withpnpm test src/daemon/service-definition-backup.ordering.test.ts --maxWorkers=1in 36.34 / 28.23 / 34.14 seconds wall (6.400 / 8.348 / 7.103 seconds test time). No individual test in the three combined passes exceeded 11.679 seconds. Hosted timing for this new correction is not available yet.node scripts/check-changed.mjscompleted in full with exit 0 after the test-table lint correction. Both closure guards passed: 20 tests, 104.17 seconds wall. No production module was added or removed; the wrapper inventory remains closed without changes. All commands used isolatedOPENCLAW_STATE_DIR. Remote check-changed was blocked by proof infrastructure during the original lane, so validation ran locally under the ruling; remote proof was off for this correction.update-cli.windows-lifecycle.test.tsrun hit 12 local 120-second test timeouts. Profiling found over 90% of samples blocked in synchronous SQLite snapshot subprocesses. The isolated-install case passed on unchanged HEAD in 58.932 seconds and on the corrected code in 50.994 seconds; these diagnostic passes do not erase the broad-run failures. The fixture performance issue is recorded without increasing timeouts, adding retry settings, weakening assertions, or claiming that it is fixed. The unchanged database-rollback package/git cases also took 51.126 / 45.186 seconds and perform real child-process, Doctor, SQLite recovery, and Git work.Latest ordering correction: production +0/−0, tests +93/−44 (one file). Full PR: production +255/−73, tests/support +882/−201, docs +30/−8, one removed mock-baseline entry, and one inherited stale max-lines allowance removed (42 files; +1167/−284).
src/daemon/schtasks-install-files.tsandschtasks.install.test.ts, both suites' cases retained; two inherited baselines shrink-only. No behavior change.