Repository navigation
fix(update): honor the update budget when probing the Windows Scheduled Task - #143292
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: needs maintainer review before merge. Reviewed September 9, 2026, 2:07 PM ET / 18:07 UTC (Revision 2). ClawSweeper reviewWhat this changesWindows update preflight honors the existing timeout setting, retries one timed-out Scheduled Task inspection, and reports the enforced budget when inspection still fails. Merge readiness✅ Ready for maintainer review The fix remains necessary: current main and the latest release retain the timeout defect. No blocking patch defect was found, and the updated maintainer discussion resolves the prior review’s optional native-proof concern. Priority: P0 Review scores
Verification
How this fits togetherBefore changing installed code, OpenClaw’s updater inspects the Gateway’s managed service and verifies ownership. On Windows, a PowerShell Task Scheduler query supplies runtime state that determines whether update preparation can proceed. flowchart TD
A[Update request and timeout] --> B[Read service definition]
B --> C[Probe Windows Scheduled Task]
C --> D{Probe timed out?}
D -->|Once| B
D -->|Success| E[Validate current ownership]
D -->|Repeated timeout| F[Refuse update with budget]
E --> G[Proceed or refuse safely]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +41, Tests +119, Docs +2. Total +162 across 7 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Use the existing update timeout consistently while retaining fresh service ownership checks and explicit timeout refusals. Do we have a high-confidence way to reproduce the issue? Yes, at the source level: a Windows runtime probe exceeding five seconds becomes unknown and blocks update despite a larger requested budget. The reporter supplies real-machine measurements; this review did not execute a reproduction. Is this the best way to solve the issue? Yes. Forwarding the existing budget repairs the responsible boundary without introducing another setting, and the single retry preserves ownership validation and refusal semantics. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 9865df7610c8. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
…ed literals (#145219) Derive update inspection, candidate startup, activation, and finalization allowances from measured SQLite state, observed startup, plugin count, and the caller's step budget. Forward the owning allowance through service commands, readiness, Doctor, and migrated finalization instead of imposing competing short cutoffs. Keep metadata and progress probes cancellable in child processes. Preserve update-activation-timeout settlement, integrity checks, live authority, and unsettled-writer ownership. Expiry alone never authorizes rollback, restart, or lease release. Installer network operations share the documented allowance. No new configuration, dependencies, schema, retries, or persistent retention/recovery semantics. The activation regression failed with the original resolver and passed with the repair; focused proof passed 102 tests in six files. Native POSIX FIFO cancellation and Chrome boundary proof are recorded in the PR. CI 34767727811 passed 129 jobs with 11 skips on a verified current-base merge checkout. The final refresh commit is tree-identical to the reviewed source. The maintainer accepts longer recovery waits and the incomplete slow-state published-driver/native Windows recovery qualification. An already-installed driver retains its loaded timers; containing-release delivery and reporter recovery remain unverified. Reported by @rlosito (#146637); the initiating timeout cause remains unproved. Related update-timeout reports are tracked in #145252. Refs #144758 #144901 #144890 #143292 #146637 #145252. Preserves the activation boundary from #147019.
…ed literals (openclaw#145219) Derive update inspection, candidate startup, activation, and finalization allowances from measured SQLite state, observed startup, plugin count, and the caller's step budget. Forward the owning allowance through service commands, readiness, Doctor, and migrated finalization instead of imposing competing short cutoffs. Keep metadata and progress probes cancellable in child processes. Preserve update-activation-timeout settlement, integrity checks, live authority, and unsettled-writer ownership. Expiry alone never authorizes rollback, restart, or lease release. Installer network operations share the documented allowance. No new configuration, dependencies, schema, retries, or persistent retention/recovery semantics. The activation regression failed with the original resolver and passed with the repair; focused proof passed 102 tests in six files. Native POSIX FIFO cancellation and Chrome boundary proof are recorded in the PR. CI 34767727811 passed 129 jobs with 11 skips on a verified current-base merge checkout. The final refresh commit is tree-identical to the reviewed source. The maintainer accepts longer recovery waits and the incomplete slow-state published-driver/native Windows recovery qualification. An already-installed driver retains its loaded timers; containing-release delivery and reporter recovery remain unverified. Reported by @rlosito (openclaw#146637); the initiating timeout cause remains unproved. Related update-timeout reports are tracked in openclaw#145252. Refs openclaw#144758 openclaw#144901 openclaw#144890 openclaw#143292 openclaw#146637 openclaw#145252. Preserves the activation boundary from openclaw#147019.
Fixes #143210
Additional instructions
Maintainers can update this branch in the OpenClaw repository.
What Problem This Solves
Fixes an issue where Windows users running
openclaw updatewould be refused atmanaged-service-preflightwhen the Scheduled Task runtime probe exceeded five seconds, even though the update allowed a longer timeout. The refusal hid the timeout behind generic service-access guidance.Why This Change Was Made
The Windows runtime reader now forwards the caller's timeout to the Scheduled Task probe, and the probe honors it instead of applying a hidden five-second ceiling. Calls without a valid positive finite budget retain the five-second default. Update entry points already pass their existing per-step budget.
An actual
ETIMEDOUTcarries structured timeout metadata into service inspection. Update preflight retries that inspection once, rereading the service definition and runtime before deciding ownership. Repeated timeouts still prevent mutation and report the enforced budget, including when revalidating previously admitted ownership. Other probe failures remain fail-closed without a retry. Only fixed timeout text and the numeric budget reach the refusal; arbitrary native error text is not added.User Impact
Slow Windows Scheduled Task queries can use the update's requested budget and recover from one timeout. A repeated timeout now explains why the update stopped. Each attempt receives the existing update step budget (
--timeout, default 1800 seconds), so two hung probes can consume twice that allowance. Status calls also receive the timeout they already request; the probe itself does not retry.Evidence
Regression tests were run against the unchanged production implementation by temporarily reversing only the production patch, then restoring it byte-for-byte. Before the fix:
Post-fix validation: 282 tests passed across six files (three routed Vitest shards):
The suite covers the actual Windows runtime reader and update preflight with mocked
spawnSync, including one-time timeout recovery, repeated-timeout refusal, preservation of timeout diagnostics after admission, and non-timeout refusal without retry. Existing numeric-state, ownership, activation, and recovery tests also pass.The final
node scripts/check-changed.mjsgate passed (including production/test typechecking, formatting, lint, and architecture guards), with a separate Vitest filesystem cache for the concurrent check process.git diff --checkpassed. The preflight suite passed all 28 tests again after a test-only lint cleanup.Exact-head CI passed: run 34383681387, head
5488b201bae96f14fd732dfc03920e3e52de493a. The bounded PR watcher completed withGREENand zero pending checks; both Windows Node test shards completed successfully.Known gaps: the tests exercise real runtime/preflight code with mocked Windows subprocess responses on macOS. No live Windows 11, PowerShell COM, antivirus-latency, or end-to-end package update proof was run. The separate missing-launcher existence-probe error path is outside this runtime-probe repair.
Thanks to @fanyuantaier for the detailed report and measurements.
Review notes
No persisted state, install records, or config schema changes. Both Windows Node CI shards executed their suites natively on Windows and passed in run 34383681387. The probe timeout path uses Node's documented
spawnSynctimeout andETIMEDOUTcontract; the focused regressions mock subprocess results. A live antivirus-latency reproduction is unavailable, and native PowerShell latency/termination was not independently demonstrated. The maintainer accepts this disclosed validation limit for the bounded timeout repair; this is not a claim of live Windows update proof.The ten regression cases cover omitted, zero, negative, infinite, 200 ms, and 30000 ms probe budgets; one timeout followed by success; two timeouts; two timeouts after prior ownership admission; and an
ENOENTfailure without retry. Fresh ownership checks and refusal on an unverifiable service remain enforced.