Repository navigation
refactor(update): persist execution phases in the worker - #161385
Conversation
Await validation, activation, and inspected Git target receipts through the existing shared-state mutation owner. Preserve phase ordering, terminal-row no-ops, and the synchronous ledger companion. Keep native receiver preparation with candidate validation and recheck the captured invocation before its probe after schema revalidation. Validation: original-caller causal controls; 93 final caller cases with 263 applicable surrounding-contract cases; full changed-source gate, including all 27 core-test type graphs; independent review. Installed package qualification follows in the PR. Related: #161104, #160592.
|
🦞👀 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 30, 2026, 12:09 AM ET / 04:09 UTC (Revision 5). ClawSweeper reviewWhat this changesThe branch moves validation, activation, and inspected Git-target phase writes into OpenClaw’s shared SQLite worker while retaining the existing update-history rules. Merge readiness⛔ Blocked before merge - 3 items remain Current main still writes these update phases on the CLI thread, so this PR remains useful. The final head still needs installed-update proof, and a test cost item from the prior review remains open. Priority: P2 Review scores
Verification
How this fits togetherThe update command records its progress in a SQLite history row during package and Git updates. The worker writes each phase and returns a receipt before the command continues. flowchart LR
A[Package or Git update] --> B[Execution authority check]
B --> C[Phase write request]
C --> D[Shared SQLite worker]
D --> E[Update history row]
D --> F[Phase receipt]
F --> G{Authority current?}
G -->|Yes| H[Continue update]
G -->|No| I[Stop update]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +61, Tests +548, Docs +7. Total +616 across 16 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the phase transition in the shared worker kernel and qualify the final head with a published-updater installed run that observes the receipts and a healthy service. Do we have a high-confidence way to reproduce the issue? Yes. Current-main source identifies the three synchronous phase calls, and the PR reports causal host-write controls for an earlier candidate; this read-only review did not execute them. Is this the best way to solve the issue? Yes. Reusing the shared-state worker and the existing phase kernel is a narrow ownership change; installed-update proof is still needed for the final composition. Full review comments:
Overall correctness: patch is correct AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against df2a29cac9ad. LabelsLabel changes: No label 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
HistoryReview history (4 earlier review cycles)
|
|
The installed-update proof requested in the review is complete for the unchanged reviewed head The retained affected-caller run passed 93 cases in 82.623 seconds with two workers, and the full changed gate passed in 2,264.539 seconds. These are command measurements, not standalone per-file timings or CI-seconds estimates. Additional replay solely to populate a timing inventory would not add correctness coverage; the actual scope, concurrency and timing limits remain explicit in the body. CI attempt 2 remains failed: its originating Gateway private-completion cancellation race is being repaired separately in #161461. That repair has a causal original-owner failure and a passing real Gateway/SQLite regression; neither its proof nor this installed proof relabels cancelled CI jobs as passing. |
Keep the original run and write capture together in the existing execution guard. Callers still await each receipt and recheck live authority before continuing. Preserve the unchanged worker transaction and synchronous ledger contract.
|
Maintainer disposition for the P3 timing item: the retained command measurements are sufficient for this cut; a new serial replay solely to populate a timing inventory is not a correctness gate. The final source passed all 231 selected cases in 95.133 seconds using two parallel plans, each with The separate installed-compatibility requirement remains active. Exact-head Package Acceptance for |
|
Final-head installed acceptance is now complete for This resolves the final-head compatibility proof gap in the current review. The P3 timing item is covered by the existing maintainer exception/disposition; whole-command times and concurrency remain explicit. The two independently attributed CI failures stay failed in native admission evidence, with no cancelled coverage relabeled as passing. |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
* fix(update): settle service receipts and interrupted rollback Await the existing bound worker phase receipt before native service stop, then revalidate the original executor/requester. Retain already admitted compensation through signal settlement, including its later phase writes, without retaining the unbounded forward operation. Keep current-core and rollback authority policies distinct. Preserve the existing ledger kernel, records, schema and recovery semantics. Related: #161385 Canonical stale-baseline context: #161766 Co-authored-by: Vincent Koc <[email protected]> * fix(test): register post-update worker fixture once Keep its existing worker registration instead of adding a duplicate that prevents CI compact timing generation. Preserve the strict uniqueness guard and the three newly required worker routes. The actual CI merge failed manifest generation and its existing registry regression; the baseline and one-entry correction passed the same selector. * test(update): retain real owners in module failure fixtures Load the mutable-signal and execution-guard owners in the existing VM fixture so post-update failures reach their original backup-retention assertions. Keep all19 inner cases and the synthetic service boundary. The original three-file CI group failed on the unexpected dependency call; the two real-module additions restore17 outer passes and19 inner passes. --------- Co-authored-by: Vincent Koc <[email protected]>
…1385) * refactor(update): persist execution phases in the worker Await validation, activation, and inspected Git target receipts through the existing shared-state mutation owner. Preserve phase ordering, terminal-row no-ops, and the synchronous ledger companion. Keep native receiver preparation with candidate validation and recheck the captured invocation before its probe after schema revalidation. Validation: original-caller causal controls; 93 final caller cases with 263 applicable surrounding-contract cases; full changed-source gate, including all 27 core-test type graphs; independent review. Installed package qualification follows in the PR. Related: openclaw#161104, openclaw#160592. * refactor(update): bind phase writes to execution custody Keep the original run and write capture together in the existing execution guard. Callers still await each receipt and recheck live authority before continuing. Preserve the unchanged worker transaction and synchronous ledger contract.
…aw#161851) * fix(update): settle service receipts and interrupted rollback Await the existing bound worker phase receipt before native service stop, then revalidate the original executor/requester. Retain already admitted compensation through signal settlement, including its later phase writes, without retaining the unbounded forward operation. Keep current-core and rollback authority policies distinct. Preserve the existing ledger kernel, records, schema and recovery semantics. Related: openclaw#161385 Canonical stale-baseline context: openclaw#161766 Co-authored-by: Vincent Koc <[email protected]> * fix(test): register post-update worker fixture once Keep its existing worker registration instead of adding a duplicate that prevents CI compact timing generation. Preserve the strict uniqueness guard and the three newly required worker routes. The actual CI merge failed manifest generation and its existing registry regression; the baseline and one-entry correction passed the same selector. * test(update): retain real owners in module failure fixtures Load the mutable-signal and execution-guard owners in the existing VM fixture so post-update failures reach their original backup-retention assertions. Keep all19 inner cases and the synthetic service boundary. The original three-file CI group failed on the unexpected dependency call; the two real-module additions restore17 outer passes and19 inner passes. --------- Co-authored-by: Vincent Koc <[email protected]>
What Problem This Solves
Mutable update phase tracking still performs SQLite writes on the CLI thread.
User Impact
Validation, activation, and inspected Git target tracking await worker-owned persistence. A replaced invocation is refused before starting the candidate capability probe. There are no schema, configuration, or CLI changes.
Why This Change Was Made
The three callers use the existing shared-state worker, synchronous phase kernel, and live executor/requester checks. The existing execution guard binds phase persistence to the original invocation; callers await that operation and recheck authority before continuing, so the Git helper cannot pair a run with a different write capture. Recovery policy stays inside the transaction; the synchronous ledger companion and terminal-row no-op behavior remain intact.
The conflict integration preserves main's configuration-refresh and rehearsal loop. Its existing validation helper consumes the captured original run, retains the native-probe authority checks, and replaces the superseded helper from the earlier candidate. Phase receipts and the consuming authority checks remain awaited before activation and Git inspection continue.
Other phase callers, generic progress, creation, diagnostics, final settlement, and native authority reads remain subsequent migration work.
Evidence
The final head (
ddaaa4848cd3) passed Package Acceptance and the genuine published 2026.9.4 updater → exact candidate → authenticated earlier same-versionf2fed5f693b5installed flow. Both parent runs succeeded and finished. The candidate parent recorded exactly one completed validating and activating receipt, plus completed snapshot/startup/cleanup canary receipts. All 11,263 candidate and 11,265 target application files matched their package inventories; both explicitly installed services passed health and readiness checks. All 65 commands joined, and cleanup left no running processes.All 231 cases across nine selected caller, ledger, Doctor, signal, and executor-settlement files passed with no skips. The full changed-source gate passed production and all 27 core-test type graphs, lint, line caps, dead exports, schema checks, and runtime import-cycle checks. Fresh independent source review found no actionable P0–P2 issue. Original controls reproduced the three host phase writes and probe-after-replacement defect before the repair.
Exact-head CI remains failed: an unchanged Codex successor fixture reused its predecessor thread ID during a required runtime rotation, and the unchanged fail-fast monitor received an Actions POST HTTP 500. Independent causal qualification and matching baseline/tested-merge inputs establish the fixture failure; canonical 52e60fb fixes it. These two originating failures also failed the aggregate CI gate. The monitor did not successfully cancel sibling jobs. The remaining jobs completed with 131 successes and 19 skips; no cancelled coverage is claimed. Landing uses the explicitly authorized, source-bound pre-existing-failure route, retaining security and review gates.
The runtime test command took 95.133 seconds using two parallel plans, each with
maxWorkers=2; the changed-source gate took 1,790.974 seconds. The installed proof command took 509.727 seconds. These are whole-command measurements, not standalone file costs or performance claims. The maintainer timing disposition explains why no timing-only replay was added.The installed proof uses manual stop,
--no-restart, and explicit service installation. It does not establish automatic restart, rollback-to-running, Windows, populated-agent migration, live Git, or performance. CPU-degraded startup telemetry and a portal-sync timeout after the successful run are retained. Earlier artifact-delivery failures were caused by a private input parser accepting an incomplete signed redirect; that parser was causally repaired before this successful run, without product, credential, provider, or proxy changes. Historical earlier-head proof remains separate.Related: #161104, #160592, #161461.