Repository navigation
fix(update): preserve automatic update policy and outcomes - #134566
Conversation
Keep saved channels authoritative, retire stopped schedulers, and record automatic failures before campaign completion. Use managed handoff for automatic installation and preserve scoped web reconciliation across reloads.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 31, 2026, 9:42 PM ET / September 1, 2026, 01:42 UTC. ClawSweeper reviewWhat this changesThe PR preserves saved automatic-update policy and update outcomes across managed-service handoffs, restarts, and Control UI reloads, while exposing the existing update-check setting for recovery. Merge readinessKeep open for normal maintainer validation: the prior recoverability finding is addressed and no introduced functional or security defect was found, but this compatibility-sensitive update lifecycle change still needs final real-environment evidence and completion of its exact-head checks. Priority: P1 Review scores
Verification
How this fits togetherThe update subsystem turns saved Gateway policy into scheduled update campaigns and managed-service handoffs, then returns restart status to the Control UI. The UI reconciles that status after reconnecting so operators can see an outcome or actionable recovery path. flowchart LR
A[Saved update policy] --> B[Update scheduler]
B --> C[Update campaign]
C --> D[Managed service handoff]
D --> E[Restart verification]
E --> F[Gateway update status]
F --> G[Control UI recovery notice]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +385, Tests +1313, Docs +26, Other -1. Total +1723 across 45 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep saved policy and lifecycle ownership canonical, then attach after-fix managed-service and Gateway-connected UI evidence before landing. Do we have a high-confidence way to reproduce the issue? Yes, from source: save a stable channel, install a one-off beta, and verify startup retains stable policy; the review could not execute that scenario because it is read-only. Is this the best way to solve the issue? Yes: the change preserves the configured policy at its owning resolver and makes disabled update checks recoverable through the existing settings surface rather than adding a workaround. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against bd2a91dac35a. LabelsLabel 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
History |
Use the canonical Doctor policy for fresh finalization and package verification so only the updater activates the managed Gateway. Preserve named profiles and explicit stop/update/start guidance in recovery commands. Move the web update lifecycle into its own owner and fence delayed hold responses from newer campaign or authority state. Cover the live-found activation defect and UI races with existing owner-boundary tests.
|
@clawsweeper re-review The new head fixes the live-found duplicate service activation by keeping fresh Doctor passes under the updater's existing activation policy. It also extracts the web update lifecycle, fences delayed hold replies, and preserves profiles in manual recovery guidance. Focused tests, browser regression scenarios, independent review, and the full package build pass. Final real npm/service and Gateway-connected browser evidence is being completed and will be added before landing. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
…134566) * fix(update): preserve automatic update policy and outcomes Keep saved channels authoritative, retire stopped schedulers, and record automatic failures before campaign completion. Use managed handoff for automatic installation and preserve scoped web reconciliation across reloads. * fix(update): retain activation ownership through finalization Use the canonical Doctor policy for fresh finalization and package verification so only the updater activates the managed Gateway. Preserve named profiles and explicit stop/update/start guidance in recovery commands. Move the web update lifecycle into its own owner and fence delayed hold responses from newer campaign or authority state. Cover the live-found activation defect and UI races with existing owner-boundary tests. * fix(update): make automatic update recovery actionable * test(update): align pricing fixtures with main
What Problem This Solves
Fixes cases where saved update policy was displaced by a one-off beta install, stopped discovery could revive an old campaign, and the Updates page lost the result or allowed conflicting changes during installation. Live testing also exposed a managed service restarting twice and an Updates page that could not recover when update checks were disabled.
Why This Change Was Made
The saved core channel now owns channel selection, cached availability belongs to its channel, and stopped schedulers cannot publish or apply late results. An applying campaign retains its exact target. Failed attempts are recorded before observers refresh, while rejected or retired requests leave the active owner's result intact.
Automatic installation uses the existing managed-service handoff. Foreground Gateways record a skipped attempt with stop → update → launch guidance; backend/CLI instructions preserve the active profile. Fresh Doctor processes and package verification share the existing update policy; the parent updater owns service refresh and activation, preventing the extra restart found in the live test.
The Control UI has one update lifecycle owner for busy state, status refresh, hold responses, and result reconciliation. A bounded Gateway/profile-scoped browser notice preserves reconciliation across reloads; it never replays an update. Historical attempt details show the recorded Before update and After attempt identities rather than inferring a target from a later available release. Recovery text wraps within its status row.
User Impact
Channel policy stays consistent across CLI, Gateway, and web updates, including after a one-off
--tag beta. Controls lock during installation, recorded failures remain visible, and reloading during an update preserves pending reconciliation.Settings → Updates → Check for updates now edits the existing
update.checkOnStartpreference through the normal save flow. Turning checks off disables the Automatic updates control while preserving its saved preference; turning checks on resumes discovery and any enabled automatic-update policy. Both the visible label and existing setting are searchable. No config key, default, SQLite schema, or feature-statistics preference is added or changed.Foreground automatic installation intentionally becomes a recorded skip with explicit manual recovery guidance. Plugin compatibility channel selection remains unchanged. Old unscoped success toasts are discarded; the new notice is transient per-tab display state.
Evidence
These four service cases passed on
48bfd0ba447d60097d5e88e02c664ed66bdd7c6f; subsequent changes affect UI, tests, docs, and the measured UI baseline. Core production source is unchanged. The original duplicate-activation failure was retained and rerun successfully after the Doctor ownership repair.The isolated lane uses Linux/ARM64, Node 24.19.0, npm 11.17.0, and native systemd. Release metadata and tarballs use a fixture registry; the compiled CLI, countdown, npm install/swap, Doctor, managed helper, authenticated RPC, and HTTP health checks are real. Synthetic versions contain the same candidate code, so this establishes lifecycle/install behavior rather than historical-release compatibility. No operator Gateway was changed.
The canonical package embeds final commit
c48b22a855d395f462d61ea5a0eb2863c788debf; its SHA-256 is3c7a659eb7c9f0f710ab40bfbf3fe2e016224a777e1749aa65254e44859829b6. All 6,971 non-UI runtime JavaScript files are byte-identical to the package used for the four passing service scenarios. All 187 dependency inputs are unchanged. Build identity, final UI assets, and declaration member/chunk ordering account for the other artifact differences.The final Gateway-connected browser run used this exact package with no RPC mocks: the browser enabled checks, persisted
checkOnStart: truewhile preservingauto.enabled: true, observed the production countdown and recorded skipped outcome, then reloaded and recovered the same result. The package stayed unchanged and healthy, controls settled, no update request replayed, no page errors occurred, and HTTP-served JavaScript/CSS matched the installed archive. Final startup JavaScript measured 347,787 bytes, below the existing 348,368-byte limit.Exact-head CI passed: 208 successful jobs, including Windows and the real-Gateway and native-browser lanes.
Before/after: controls during an automatic apply (controlled browser regression)
Before, policy controls remained usable during apply:
After, both policy toggles and update actions are locked while applying:
Final real Gateway: disabled checks and recorded recovery
Uncut 70-second recording, started after authentication, showing the real settings recovery, countdown, terminal outcome and reload:
openclaw-auto-update-recovery-video.webm
Production delta: +386 lines; tests/test support: +1,312; docs: +26. Growth owns cancellation, durable outcomes, bounded browser continuity, and an operable existing-setting recovery path. The unsafe foreground subprocess and duplicated status/Doctor policy paths are removed. The measured startup baseline is 347,792 bytes with the existing 348,368-byte enforcement limit; the 358,400-byte hard cap and growth/variance allowances are unchanged.
CI exposed a missing export in a whole-module CLI fixture and two provider fixtures tied to the real UTC pricing cutoff. The unnecessary CLI stub is removed. The provider fixtures match the equivalent fixes already landed in #134564; production pricing is unchanged. Earlier browser CI stopped at the stale intermediate bundle baseline, which is now refreshed from the canonical production measurement. The final exact-head CI run passes. A prior native-browser tab-creation case also passes on the final head without browser-source changes.
The latest review's recovery finding is addressed by the explicit checks control, search, interaction coverage, and connected-browser proof. Foreground compatibility and production growth are documented above.
Remaining boundary: direct CLI invocation still uses the existing install-coordinator contract. This change does not claim cross-process serialization between every direct CLI update and managed helper. Lost RPC responses without a handoff ID retain the existing identity-based reconciliation limit.
Named UI follow-up: expose backend-owned, profile-aware terminal recovery commands in the browser; its current terminal fallback remains generic. The backend/CLI profile-preservation proof does not claim that browser behavior.
Build follow-up: identical source/dependencies can reorder declaration members and change generated chunk names; runtime JavaScript identity is unaffected.