Repository navigation
fix(update): await transferred progress before finalization - #162909
Conversation
…riter Await buffered progress receipts in the fresh candidate receiver before finalization, preserving captured database context and live executor/requester admission. Refused receipts stop replay; uncertain writes retain the existing cleanup failure. This candidate-side change preserves published drivers, schemas, stored state, and recovery policy.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed October 1, 2026, 2:32 PM ET / 18:32 UTC (Revision 2). ClawSweeper reviewWhat this changesThe candidate update receiver records transferred progress through the existing SQLite worker and awaits each receipt before finalization. Merge readiness✅ Ready for maintainer review This remains useful work, with no actionable introduced defect found. Current main and the latest release retain synchronous receiver replay; the prior PR-body heading follow-up is resolved. Priority: P2 Review scores
Verification
How this fits togetherWhen an update advances database schemas, the installed updater transfers buffered progress to a fresh candidate process. That receiver records the progress before completing update finalization. flowchart TD
A[Installed updater] --> B[Schema handoff]
B --> C[Candidate receiver]
C --> D[Live authority checks]
D --> E[SQLite progress writer]
E --> F[Committed receipt]
F --> C
C --> G[Update finalization]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +13, Tests +138, Docs +7. Total +158 across 4 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Use the shared async progress writer for receiver replay while preserving shipped drivers, stored receipts, and existing recovery ownership. Do we have a high-confidence way to reproduce the issue? Yes, source inspection identifies the remaining synchronous receiver path, and the captured regression evidence demonstrates ordering failures when the new await is removed. This review did not execute a current-main reproduction. Is this the best way to solve the issue? Yes, moving replay onto the existing writer is a narrow cutover that preserves the mutation kernel and adds sequential settlement without creating a competing owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0dd332fa7358. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
…riter (openclaw#162909) Await buffered progress receipts in the fresh candidate receiver before finalization, preserving captured database context and live executor/requester admission. Refused receipts stop replay; uncertain writes retain the existing cleanup failure. This candidate-side change preserves published drivers, schemas, stored state, and recovery policy.
What Problem This Solves
After a schema handoff, the fresh update receiver still replayed transferred progress receipts synchronously. This was the remaining receiver path left by #162098.
Why This Change Was Made
Replay buffered steps through the existing async shared-state writer, awaiting each receipt in order before finalization. Capture the environment and database context once and recheck the live executor and requester at write admission. Refused receipts stop replay and finalization; uncertain outcomes retain the existing cleanup failure.
User Impact
Transferred progress follows committed history. The same writer now owns ordinary progress and fresh-receiver replay, while shipped synchronous ledger exports and recovery policy retain their existing contracts. Production delta: +17/−4 lines, net +13, in one file; four changed files including tests, fixture support, and documentation.
Update behavior
The receiver ships with the candidate, so this fix is available when an installed driver hands finalization to that candidate. Published drivers are unaffected. No schema, stored-state, durability, retention, or restart-policy change.
Evidence
On the exact committed source tree, Blacksmith Testbox ran each command as
pnpm test <file> --maxWorkers=1:src/cli/update-cli/update-command-migrated.test.tssrc/infra/update-migrated-finalize.worker.test.tssrc/cli/update-cli/update-command-legacy-finalize.test.tsThe migrated suite's command includes runtime preparation; Vitest duration was 76.34s. Its real fresh-process, delegated-executor, migrated-schema and SQLite worker boundaries catch regressions that helper mocks cannot. The two replay cases took 5.18s and 4.70s. CI file timing is not available at PR creation.
A scratch copy with the receipt
awaitremoved failed both new replay cases: the second receipt entered before the first settled. Filtered command wall: 66.282s. Source was restored and the scratch worktree removed.Production types and all 27 test type graphs passed. Scoped oxlint, formatting, dead-export scans, both import-cycle checks (zero cycles), database worker ratchet against
510beb8d52bd, and all remaining selected guards passed.git diff --checkpassed. Independent Codex branch review is clean through P2.The aggregate
node scripts/check-changed.mjs --base 510beb8d52bdstopped at an inherited graph-budget failure:agents-otherhas 724 roots against a 720 limit. The agent test inventory, shard configurations, and checker are unchanged from the base. Every downstream lane was run explicitly and passed; the aggregate command itself is not claimed green. The first local test attempt stopped before Vitest because managed-Gateway artifact separation could not be verified; actual tests ran in isolation on Testbox.A canonical local package of
92663a401056passed its complete build and tarball integrity/import-graph checks in 1376.562s. It is a local canonical pack, not a Package Acceptance artifact: version 2026.9.7, state20/agent24, SHA-2568fa0abb426c82c7fa4a59708edede0657f8c91b7893ae822e3c3e1b9a7f65c58.The single published 2026.9.4 → candidate installed hop passed on Blacksmith Testbox. The recipe manually stopped the service, then ran the published CLI's managed update with
--yes --tag file:<candidate> --json --no-restart: exit 0, 46.353s, normally joined. The fresh receiver adopted the run, replayed the buffered Doctor receipt and two advisory receipts in producer order at positions 14–16, and finalized runb96ceeb0-326c-4190-8346-374b000cb014assucceeded/finished. Start/completion coalesce into one stored Doctor row, so these three rows represent at least four buffered writes. Candidate service health and account/service/process cleanup passed with no remaining owned PIDs. The manual post-hop start is a service smoke check, not an updater-owned restart claim.Artifact delivery used the prior recipe's private broker chunks after whole-file transfers stalled. Two initial chunk batches hit broken pipes; all affected objects were reconciled by complete hashes or 404, then one bounded recovery succeeded. The guest verified the original complete tarball hash before the only installed update began. The complete evidence archive was independently hash-verified locally. No product test or update was retried to obtain green. The lease is stopped.
Retained evidence:
receiver-successor-proof-20261001/qualification.jsonandextracted/evidence/results/published-hop-receiver-replay.json.