Repository navigation
fix: keep update progress reads from blocking preparation - #161982
1052326311 wants to merge 1 commit into
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 30, 2026, 12:25 PM ET / 16:25 UTC. ClawSweeper reviewWhat this changesThe update CLI moves progress polling to the existing asynchronous SQLite reader and waits for that reader to settle before update activation. Merge readiness✅ Ready for maintainer review Current main and the latest release still use synchronous reads for update progress. This PR addresses the reported blocking path, and its bounded production-path observations show the intended improvement. No actionable patch defect was established. Priority: P1 Review scores
Verification
How this fits togetherThe update CLI reads a SQLite run ledger to display preparation phases. Its progress observer feeds phase output to the terminal, while the update executor later takes over for package replacement and service activation. flowchart LR
A[Update run ledger] --> B[Async progress reader]
B --> C[Phase display]
B --> D[Suspend and drain]
D --> E[Update activation]
E --> F[Package or Git mutation]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +56, Tests +198. Total +254 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: Land the existing asynchronous observer through the normal exact-head review gates, preserving the ledger owner’s activation drain and the update executor’s post-await fence. Do we have a high-confidence way to reproduce the issue? Yes. The related report gives a bounded installed-release probe, current main retains the synchronous polling path, and the PR records matched before-and-after production-reader observations; this review did not execute the probe. Is this the best way to solve the issue? Yes. Reusing the existing asynchronous ledger reader is a narrow repair, and the activation handoff waits for its read and database owner before mutation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 30e80e790da1. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Superseded by #162345, which landed the async live progress reader and its lifecycle coverage on main. Closing this older conflicting implementation so the merged owner remains canonical. |
Related: #161867
What Problem This Solves
Fixes foreground update progress repeatedly blocking the CLI event loop while reading SQLite history.
User Impact
Progress observation no longer waits synchronously for a snapshot worker. Cold readers still prepare snapshots asynchronously; this does not eliminate all snapshot I/O or all reported update delay. Existing warm-reader reuse is preserved.
Why This Change Was Made
The display uses the existing asynchronous ledger reader, allows only one read at a time, and rejects stale results across suspension, resumption, disposal, and report handoff. Committed step callbacks retain their rows. Before activation, it joins either lookup outcome and drains the canonical database owner for that run's exact path. Ordinary history lookup failures remain diagnostic-only; real drainage failures stop mutation. No schema, admission, or migration policy changes.
Evidence
Matched isolated10-second observations, with valid ledger/disabled controls and real
Phase: requestedoutput:The candidate performed four cold and32 warm polling read dispatches. Cold initialization was516.522ms original versus9.119ms candidate; warm was0.561ms versus4.229ms. These are single bounded samples, not benchmark distributions. Both warm cases already avoid snapshots. Cold fallback remains necessary when no native database is retained; the change does not bootstrap a database to manufacture a warm path.
Published OpenClaw2026.9.4 created a real isolated ledger in a separate process, then this candidate observed it: real phase output, four polling reads, five async snapshot preparations, zero synchronous polling workers. This covers installed-ledger-to-candidate progress observation, not complete package replacement/service activation. Call-through MessagePort instrumentation counts actual dispatches, not physical bytes or successful OS child launches. Filesystem events are supplemental only.
Candidate
d52f51daa7b92a8f1fce088751d3307d1e3b9c7e, basef64aad1090a2b7e6cb7c73c0d2f3c2be55cc200d; macOS arm64, Node26.8.2. Seven-file patch SHA256242b2638dab3494121750f95c5a3986ce66edd39d5169edff4adad57e8108eba.151 focused tests passed: progress31, execution76, command-run44. Prior unchanged adjacent ledger-reader19, migrated-update26, and warm-source5 passed. Scoped lint, core/CLI-update types, formatting, line-cap, guards, diff and secret checks passed. Execution tests took6.07s; combined progress/command-run16.85s. Hosted CI cost is unmeasured. Full repository tests/build and hosted CI were not run for this candidate.
Independent review found no actionable P0–P2 findings on the exact patch. Earlier clean reviews were superseded after the coordinator found missing activation drainage and ordinary-error availability issues; both were corrected before the final review. Fault injection exercises the real read/close owners and distinguishes released lookup rejection from retained cleanup failure, without claiming a live worker crash reproduction.
AI assistance: Codex assisted implementation, tests and evidence collection, with separate read-only review and coordinator review. The implementation owner understands the observation, generation, and exact-path drainage contracts.
Complete inspectable driver bytes and redacted outputs follow.
Reproduce the bounded progress observations
Inspectable progress observation evidence — publication draft
This is a bounded observation proof, not a complete package-replacement/service-activation test.
Cold fallback still prepares snapshots. Warm baseline already avoids snapshots; the candidate preserves that behavior.
Dispatch counts do not measure physical bytes or successful OS child launches. Filesystem events are supplemental only.
The installed-ledger cell uses OpenClaw2026.9.4 in a separate isolated process before candidate observation.
Save the exact driver below as scripts/repro-161867-update-progress.mts inside the candidate checkout.
Prepare original owner bytes with:
git show f64aad1090a2b7e6cb7c73c0d2f3c2be55cc200d:src/cli/update-cli/progress.ts > src/cli/update-cli/progress.baseline-proof.tsUse the repository's locked dependencies and supported scripts/tsx.mjs loader.
Run sequentially, replacing OUTPUT with an absolute evidence filename:
The last command requires the exact installed distribution path named in the driver; it must not be silently replaced with another version.
Each run creates private HOME/state/cache before production imports. It preserves its fixture. It does not claim runtime network blocking.
The published seed child calls the installed ledger owner; it does not invoke the live CLI or change the installation.
Redacted results
Derived directly from actual JSON; private fixture paths/run IDs and supplemental filesystem names omitted.
[ { "artifact": "baseline-cold-proof", "variant": "baseline", "temperature": "cold", "baseSha": "f64aad1090a2b7e6cb7c73c0d2f3c2be55cc200d", "candidateSha": "d52f51daa7b92a8f1fce088751d3307d1e3b9c7e", "ownerSha256": "3658249a60d52ca0569a5aa837547d94c274d82b54968f43306b5a20eba5c859", "candidateDiffSha256": null, "publishedDriver": null, "observationWindowMs": 10000, "initializationMs": 516.5220000000008, "syncPollingWorkers": 13, "asyncPollingReads": 0, "asyncPollingSnapshotPreparations": 0, "disabledWorkers": 0, "renderedPhases": [ { "stage": "enabled_initialization", "line": "Phase: requested" } ] }, { "artifact": "baseline-warm-proof", "variant": "baseline", "temperature": "warm", "baseSha": "f64aad1090a2b7e6cb7c73c0d2f3c2be55cc200d", "candidateSha": "d52f51daa7b92a8f1fce088751d3307d1e3b9c7e", "ownerSha256": "3658249a60d52ca0569a5aa837547d94c274d82b54968f43306b5a20eba5c859", "candidateDiffSha256": null, "publishedDriver": null, "observationWindowMs": 10000, "initializationMs": 0.5605839999989257, "syncPollingWorkers": 0, "asyncPollingReads": 0, "asyncPollingSnapshotPreparations": 0, "disabledWorkers": 0, "renderedPhases": [ { "stage": "enabled_initialization", "line": "Phase: requested" } ] }, { "artifact": "async-cold-proof", "variant": "candidate", "temperature": "cold", "baseSha": "f64aad1090a2b7e6cb7c73c0d2f3c2be55cc200d", "candidateSha": "d52f51daa7b92a8f1fce088751d3307d1e3b9c7e", "ownerSha256": "f8b2de8a0071bc9fb7521480a5b3de3b1aa5ea381819c534aa8aaf796c9c20a0", "candidateDiffSha256": "242b2638dab3494121750f95c5a3986ce66edd39d5169edff4adad57e8108eba", "publishedDriver": null, "observationWindowMs": 10000, "initializationMs": 9.118624999999156, "syncPollingWorkers": 0, "asyncPollingReads": 4, "asyncPollingSnapshotPreparations": 5, "disabledWorkers": 0, "renderedPhases": [ { "stage": "enabled_polls", "line": "Phase: requested" } ] }, { "artifact": "async-warm-proof", "variant": "candidate", "temperature": "warm", "baseSha": "f64aad1090a2b7e6cb7c73c0d2f3c2be55cc200d", "candidateSha": "d52f51daa7b92a8f1fce088751d3307d1e3b9c7e", "ownerSha256": "f8b2de8a0071bc9fb7521480a5b3de3b1aa5ea381819c534aa8aaf796c9c20a0", "candidateDiffSha256": "242b2638dab3494121750f95c5a3986ce66edd39d5169edff4adad57e8108eba", "publishedDriver": null, "observationWindowMs": 10000, "initializationMs": 4.229040999998688, "syncPollingWorkers": 0, "asyncPollingReads": 32, "asyncPollingSnapshotPreparations": 0, "disabledWorkers": 0, "renderedPhases": [ { "stage": "enabled_polls", "line": "Phase: requested" } ] }, { "artifact": "published-candidate-cold", "variant": "candidate", "temperature": "cold", "baseSha": "f64aad1090a2b7e6cb7c73c0d2f3c2be55cc200d", "candidateSha": "d52f51daa7b92a8f1fce088751d3307d1e3b9c7e", "ownerSha256": "f8b2de8a0071bc9fb7521480a5b3de3b1aa5ea381819c534aa8aaf796c9c20a0", "candidateDiffSha256": "242b2638dab3494121750f95c5a3986ce66edd39d5169edff4adad57e8108eba", "publishedDriver": { "version": "2026.9.4", "ledgerSha256": "12c7786dc59e77733fecd9e802ec88e45cf851bd387e2aefcd6e383c1cd1e7cd", "boundary": "installed createUpdateRun in isolated child -> candidate progress observation; not full package replacement or service activation" }, "observationWindowMs": 10000, "initializationMs": 12.4614160000001, "syncPollingWorkers": 0, "asyncPollingReads": 4, "asyncPollingSnapshotPreparations": 5, "disabledWorkers": 0, "renderedPhases": [ { "stage": "enabled_polls", "line": "Phase: requested" } ] } ]Exact driver bytes
SHA256:
e221cd469fca7344d1842f14741f5c4ac9ddbb68a2636bc4b9b98c6fc818647a