Repository navigation
fix(update): bound activation and accept slow Windows identity reads - #147019
Conversation
Close executor admission and cancel owned commands when activation exceeds its existing multi-step budget. Bound settlement, retain unconfirmed writer leases, and report update-activation-timeout through status and Doctor. Reuse the canonical Windows process creation-time budget without weakening PID-reuse checks or changing Scheduled Task principals. Preserve native cleanup ordering and legacy migrated-finalization contracts. Related: #146860, #138560
|
🦞👀 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 13, 2026, 9:24 AM ET / 13:24 UTC (Revision 5). ClawSweeper reviewWhat this changesBounds update activation and cancellation settlement, adds timeout recovery guidance, and lets Windows process-identity checks use the shared reader’s longer allowance. Merge readiness⛔ Blocked before merge - 3 items remain This PR remains useful and has no actionable correctness finding. The documented landing disposition addresses the previous availability and Windows proof concerns; those accepted limitations do not require another approval cycle. Priority: P1 Review scores
Verification
How this fits togetherThe update executor coordinates installation changes, Doctor, plugin finalization, and Gateway service operations. It holds installation ownership while child work runs and publishes the outcome through update history and status. flowchart TD
A[CLI or Doctor update] --> B[Validate candidate and ownership]
B --> C[Activation deadline]
C --> D[Owned installation and service work]
C -->|Deadline expires| E[Cancel and join child work]
D --> F[Publish update outcome]
E --> F
E --> G[Retain unsettled ownership]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +292, Tests +447, Docs +10. Total +749 across 33 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the bounded executor and PID-reuse checks under the recorded availability decision, while keeping the unresolved Windows query diagnosis with its existing issue. Do we have a high-confidence way to reproduce the issue? Yes for the bounded source defects: main lacks the enclosing activation deadline and restricts lease identity reads to one second. The reporter’s exact Windows query failure remains unproven, and no runtime reproduction was executed in this review. Is this the best way to solve the issue? Yes for those defects: the patch extends existing executor, process, and timeout owners while preserving identity and settlement checks. It does not establish that all reported Windows handoff failures are fixed. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0a7b7fecfd7f. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
Keep the live-descendant and retained-installation assertions, then reuse the existing race-safe cleanup helper and assert the process has exited. The command scope can already have stopped it before fixture cleanup.
|
Merged via squash.
|
* commit '0ac8a700e43efceef73d92fe8e50b185819e38ad': (27 commits) test(acpx): prove targeted turn cancellation (#137049) fix(ci): honor realtime meeting live-test opt-in (#147044) improve: reduce heartbeat enrollment work for large fleets (#147055) fix(gateway): install despite stale Linux session bus addresses (#146569) chore(i18n): refresh native locales (#147025) fix: avoid Gateway reinstalls when macOS service inspection is inconclusive (#146880) fix(pairing): QR setup rejects trusted-proxy gateways without a shared secret (#147036) fix(update): bound activation and accept slow Windows identity reads (#147019) perf(accounts): avoid materializing avatars for owner checks (#147032) improve(status): report external and ArrayBuffer memory (#141902) fix(update): preserve linked plugins during post-core sync (#147009) fix(channels): keep replies working after hot config reloads (#147001) refactor(gateway): defer worker transcript runtime loading (#143495) improve: reduce GitHub OAuth maintenance work for large agent rosters (#147021) fix(test): avoid settings lock writer startup timeouts (#147029) fix(update): correct backup guidance and cover incident regressions (#147023) refactor(gateway): share connection lifecycle across transports (#145950) refactor(telegram): share HTML text escaping (#146936) perf(build): reduce disk use in UI performance checks (#146687) refactor(memory-wiki): share freshness result construction (#146935) ... # Conflicts: # src/config/sessions/session-accessor.sqlite-reclamation-memory.test.ts
…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.
…penclaw#147019) Bound update activation with the executor's existing multi-step budget, cancel owned commands at expiry, and report update-activation-timeout with next steps in openclaw update status and Doctor. Preserve unsettled writer ownership; timeout alone never authorizes rollback, restart, or lease release and can leave the Gateway stopped. Use the shared Windows process-start identity reader budget instead of the forced one-second override. Keep InteractiveToken support and PID-reuse checks. Native Windows published-driver upgrade/recovery proof remains a documented gap accepted for this landing; the reporter's identity-query trace remains outstanding. Refs openclaw#146860. Refs openclaw#138560. Reported by @rogerspires4452-dev (openclaw#146860).
…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.
Refs #146860. Refs #138560.
What Problem This Solves
Updates can remain in
activatingwithout an enclosing execution deadline, while the managed handoff rejects valid Windows process identities when their lookup exceeds a forced one-second budget.User Impact
Activation now has a bounded failure outcome,
update-activation-timeout, with next steps inopenclaw update statusand Doctor. Slow valid Windows identity reads use the existing shared reader budget.InteractiveTokenremains supported, and PID-reuse protection remains required.A timeout does not authorize rollback, restart, or lease release. Unsettled writers keep their ownership. If migration or pending recovery prevents safe history publication, the updater reports the timeout and preserves that state for its owning runtime. An activation timeout can leave the Gateway stopped.
Why This Change Was Made
The existing update executor owns the deadline through activation and settlement. It closes admission, cancels through the existing command-process scope, and joins within a finite allowance before reporting failure. Windows cleanup retains the existing taskkill ordering and join owner. Direct updates, Doctor updates, current-core plugin convergence, and migrated finalization use the existing multi-step envelope:
max(30 minutes, 6 × per-step timeout). Cancellation settlement has the same bounded allowance; expiry alone never proves that a writer stopped.The one-second override is removed from the lease reader. The canonical Windows reader already has a bounded ten-second envelope, with a five-second PowerShell attempt and any remaining time for WMIC. No new retry or principal-specific path is added. The report does not establish why the actual Windows query failed, and this change does not attribute that failure to stored task credentials.
Duplicate finalization budget formulas now share their existing owner. Runtime state preparation now sits with run admission and preserves its existing sequence and authority checks. A revoked delegated Doctor request is checked before loading the repair flow, then authority is rechecked after loading.
Sibling #145219 forwards caller budgets through handoff and runtime probes, but does not change the lease reader's forced one-second override. This PR handles that override; overlapping caller/docs changes will be reconciled when #145219 is rebased. No config, schema, dependency, protocol, or changelog changes. Production delta: +933/-641 lines (net +292); much of the diff is existing executor code wrapped by the deadline scope.
Reported by @rogerspires4452-dev (#146860).
Evidence
Final exact-head CI: run 34759230380 passed on
27bfeee0af2f078628cb7e7160db33e4a0248cec, including both Windows test jobs. Its checkout log confirms merge82931792276bagainst base060e856e5f9, including the required main repair; the exact-head watcher reportsGREEN. The first reopen used an obsolete merge, so a second close/reopen was needed. No code changed during landing.Before: a valid two-second identity probe throws
managed handoff process start identity is unavailable. After: all four lease identity boundary cases pass, including unavailable/exhausted-query refusal.Before: stalled executor settlement produces no terminal result, and synchronous work beyond its deadline returns success. After: timeout is recorded as
finished/failed, the reason is preserved, outstanding ownership excludes another update, and normal completion is unchanged.Before: commands ignore scope cancellation; Windows taskkill is never dispatched. After: all 46 process and Windows command tests pass, including forced-taskkill join ordering and sibling isolation.
CLI, status, Doctor, migrated-state, and legacy-producer boundary tests exercised the actual owners. One delegated-Doctor fixture initially hit its unchanged 15-second child deadline; moving requester refusal ahead of the repair-flow import made that regression pass without increasing its timeout.
Launchd/systemd activation cancellation: four focused boundary cases pass. Legacy 2026.9.4 grant fixtures exercise the real candidate worker and native-command receiver.
Initial Linux CI exposed an executor-test cleanup race (
kill ESRCH) after the command scope had already stopped its descendant. Commit27bfeee0af2freuses the existing race-safe cleanup helper and asserts exit, preserving the live-descendant and retained-installation assertions. Both focused cases, their changed-file checks, and a fresh P1 review pass.Runtime build and
pnpm check:changedpassed. Independent P1 autoreview is scoped-clean; its parent-budget finding was fixed and re-reviewed.Initial-head CI on
9030b95481b0958ae1afd3a7416853059f5907dareported a main-side failure in check-test-types-core-2:session-accessor.sqlite-reclamation-memory.test.ts:44,50has TS2322/TS2339 errors aroundonCommitRequest. The file was added on main by fix(memory): admit shared index writes through the agent owner #146760 (e05d8b6c907) and is absent from this branch. CI checked mergeed796165against basebf066ff9; this unrelated file was left untouched. The same file also failed at runtime inchecks-node-compact-small-1; its callback contract changed on main in perf(sessions): keep cleanup responsive and reuse workers #140897.No Windows-native end-to-end managed update with an
InteractiveTokenScheduled Task was available. The Windows CI unit-test shard passed on the initial head. Evidence is the reporter's run records, unit/boundary tests, mocked Windows taskkill ordering, and real local subprocess/legacy-worker tests. The installed updater runs first; a candidate cannot retroactively repair an old driver's pre-candidate identity lookup.ClawSweeper review
The completed review of
27bfeee0af2f078628cb7e7160db33e4a0248cecfound no actionable code defect. The maintainer landing decision accepts the documented availability tradeoff and native Windows upgrade/recovery proof gap: activation expiry can leave the Gateway stopped, and unsettled ownership remains retained for recovery. The reporter's identity-query trace remains outstanding, so #146860 remains open; this change cannot repair an installed updater's earlier lookup. Budget-forwarding overlap will be reconciled at #145219's rebase. No persistent schema or retention contract changes are introduced; existing migrated-state and legacy-producer boundary evidence is retained. No code fixups or re-review request were needed for this landing.