Repository navigation
fix(update): keep progress display from blocking package preparation - #162345
Conversation
Observe active update progress through the existing live read worker instead of repeatedly taking synchronous full-state snapshots. Cancel pending reads across activation and final reporting while preserving artifact-safe history reads. Keep disabled progress read-free, await asynchronous fixture cleanup, and reuse compiled entrypoints in the existing foreground handoff proof. Closes #161867
|
🦞👀 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 changes before merge. Reviewed September 30, 2026, 11:36 PM ET / October 1, 2026, 03:36 UTC. ClawSweeper reviewWhat this changesThe branch makes update progress read committed SQLite records asynchronously, cancels pending observations during lifecycle transitions, and reduces foreground-handoff test preparation overhead. Merge readiness⛔ Needs changes before merge - 1 item remains This remains a useful repair: current main and the latest release still use synchronous progress reads. No introduced correctness or security defect was found, but the repository-required published-driver × candidate update evidence remains incomplete. Priority: P1 Review scores
Verification
How this fits togetherThe updater records its phases in OpenClaw’s shared state database. The CLI progress observer reads those records to display progress, while a separate report owner produces the final authoritative outcome. flowchart TD
A[Update command] --> B[Committed update ledger]
B --> C[Read-only database worker]
C --> D[Progress observer]
E[Activation or final reporting] --> F[Cancel pending observation]
F --> D
D --> G[Terminal phase display]
B --> H[Final update report]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +64, Tests +93, Docs +3. Total +160 across 10 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: Keep progress observation within the existing asynchronous state-reader owner, with bounded polling and reliable retirement across package activation. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the synchronous polling-to-snapshot path, and the reporter supplies bounded installed-release measurements. This read-only review did not execute the reproduction. Is this the best way to solve the issue? Yes, reusing the existing worker reader is a focused repair that preserves snapshot-based history and final reporting; production update evidence must still cover the lifecycle boundary. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b4836fcbb487. 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
|
|
Landed via the admin exception for an inherited failure (squash |
Live update progress can leave committed data in an orphan WAL. Windows rollback closes its native exclusion probe before replacing files, which checkpoints that WAL and makes the saved physical write generation look changed. The updater then refuses recovery and leaves the failed candidate package installed. Run the same Windows exclusion probe before eligible snapshot capture, under the existing maintenance owner. Keep snapshot-only manual recovery when another SQLite connection prevents exclusion, and preserve strict fingerprint, ownership, and cleanup checks. The existing Windows lifecycle regression and all its restoration/autostart assertions remain unchanged. Regressed by 6e6458a (#162345), confirmed by reverting only its progress.ts changes. This repair belongs to the installed updater; a candidate cannot repair an already-running driver. Validation: 252 selected lifecycle, rollback, progress, and direct-caller tests passed. The known admission-ledger "Phase: verifying" failure remains unchanged and is owned by #162495. Core types, all 27 core test type graphs, changed-file checks, formatting, diff checks, and managed Codex review through P2 passed.
…oll (openclaw#162345) The CLI update progress display polled getUpdateRun every 250 ms and, on the shared-state path, each synchronous read staged a full SQLite snapshot in a worker and blocked the updater's event loop. Progress now uses one reusable live read per session (at most one snapshot launch across all polls, none when the display is disabled) with cancellation fenced during suspension and disposal; phase rendering is unchanged. A foreground-handoff wait in the same owner dropped from 156 s to about 67 s. The pnpm stdin contract (openclaw#161866) is covered separately by openclaw#161920. Closes openclaw#161867 Refs openclaw#161866
Live update progress can leave committed data in an orphan WAL. Windows rollback closes its native exclusion probe before replacing files, which checkpoints that WAL and makes the saved physical write generation look changed. The updater then refuses recovery and leaves the failed candidate package installed. Run the same Windows exclusion probe before eligible snapshot capture, under the existing maintenance owner. Keep snapshot-only manual recovery when another SQLite connection prevents exclusion, and preserve strict fingerprint, ownership, and cleanup checks. The existing Windows lifecycle regression and all its restoration/autostart assertions remain unchanged. Regressed by 9989f92 (openclaw#162345), confirmed by reverting only its progress.ts changes. This repair belongs to the installed updater; a candidate cannot repair an already-running driver. Validation: 252 selected lifecycle, rollback, progress, and direct-caller tests passed. The known admission-ledger "Phase: verifying" failure remains unchanged and is owned by openclaw#162495. Core types, all 27 core test type graphs, changed-file checks, formatting, diff checks, and managed Codex review through P2 passed.
Closes #161867
Refs #161866
What Problem This Solves
Fixes stalls during package preparation while
openclaw updatedisplays progress.User Impact
Progress follows committed phase changes without synchronously copying shared state every 250 ms. Disabled progress performs no reads. Phase rendering and the final authoritative report are preserved.
This improves updates launched by the fixed updater; a candidate cannot retrofit the progress reader already running in a published older driver. There are no schema, configuration, package dependency, or CLI option changes.
Why This Change Was Made
The 250 ms progress poll used an artifact-preserving reader that copied the full SQLite database synchronously. The active updater already writes its ledger, so its display now uses the existing state owner's reusable read-only worker connection, with the same admission and identity checks. Other history readers retain their artifact-preserving snapshot contract. Progress allows one asynchronous read at a time and cancels pending observations across activation, suspension, disposal, and final reporting.
This is the part B only path. The read-only owner review found #161920 correct for the pnpm terminal defect; this PR does not duplicate or supersede it. Thanks @alkor2000 for the pnpm terminal diagnosis and repair. The contributor's exact published-driver/pnpm proof and landing gates remain with that PR.
Evidence
Linux Testbox: original progress code fails the new regression with
expected 6 to be less than or equal to 1after the initial read and five ticks. The candidate passes while observing a later committed phase; disabled progress launches no reads.The two progress files passed all 27 tests in three runs. The real-state regression took 366 ms of test time; the first combined run took 25.62 s, dominated by shared compiler preparation. Subsequent combined runs took 2.82 s and 2.98 s.
Focused ledger, error-mapping, and worker-lifecycle suites passed. The importer run exposed synchronous fixture teardown racing a pending progress borrower; switching the fixture to the canonical awaited database close made its 42 tests and the original CLI group pass.
The required slow-test audit found 156.378 s in the existing release-only foreground handoff file. Reusing the existing compiled fixture entrypoints reduced the same 21 cases to 67.108 / 67.199 / 67.253 s in three runs. The longest case was 13.302 s. All process, IPC, ownership, and lease assertions remain; the real 10-second notice timeout remains covered.
Fresh Codex P1 review: scoped-clean, no accepted/actionable findings. The selected importer runs passed, including the final seven files (53 tests). A clean candidate replay also passed all 69 tests in the three progress/command files in 34.05 s.
Final
node scripts/check-changed.mjs --base 42e3cffdae5d3f6e25205c673e0ab9012b1ce14aexited 0 on Linux Testboxtbx_01m3tp1cwsc1x65xn26nemyhb6, after fetching the exact pushed commit and installing withpnpm install --frozen-lockfile. All 27 test-type graphs passed (1,017 s total); lint reported 0 warnings and 0 errors; all remaining guards and dead-export scans passed.The performance fixture retains real parent/helper/updater processes because their PID identity, lease custody, port closure, and cancellation are the tested contracts. Shared compiler/build preparation is reported separately from test time.
Production: +94 / −30 lines (net +64); tests and test support: +149 / −56; docs: +4 / −1. The production growth supplies asynchronous read cancellation, observation ordering, and a narrow live-read mode at the existing database owner; it removes the synchronous progress polling path.
The two pre-existing paired-node E2E suites passed but remain slow: lifecycle 187.170 s and upgrade 113.115 s of test time. These are the existing L1347 follow-up; the campaign lead explicitly waived them as a blocker for this PR. They exercise repeated worker installation, serialized turns, and restart/recovery contracts. Their separate runtime build took 10m 21.5s.
The plugin authority fixture permission failure was resolved by incorporating its existing main owner fix,
42e3cffdae5d3f6e25205c673e0ab9012b1ce14a. The earlier dirty-source QA bootstrap failure disappeared with the verified clean candidate and matching build; no publication guard was weakened.