Repository navigation
fix(update): prevent migrated results from appearing before cleanup - #159644
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 changes before merge. What this changesThis PR defers migrated update output and result callbacks until recovery, cleanup, and executor settlement finish. Example: The candidate finishes successfully, but package cleanup subsequently fails.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Partial Merge readiness⛔ Needs changes before merge - 1 item remains Keep this PR open: it repairs a current migrated-update publication defect through the existing terminal owner, with no introduced correctness or security findings; the author’s landing hold remains active. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe update CLI delegates migrated-state finalization to the candidate runtime, then settles retained-parent cleanup and executor ownership before delivering terminal output and callbacks. flowchart TD
A[Update CLI] --> B[Candidate finalizer]
B --> C[Prepared result and output]
C --> D[Recovery and package cleanup]
D --> E[Scratch and executor settlement]
E --> F[Terminal publication owner]
F --> G[Operator output and callback]
Technical reviewBest possible solution: Deliver migrated results through the existing terminal owner after settlement, preserving candidate-owned history and the documented forward-only rollout. Do we have a high-confidence way to reproduce the issue? Current-main source directly shows stdout publication preceding fallible compensation, package cleanup, scratch removal, and outer executor settlement; no target code was executed during this review. Is this the best way to solve the issue? The implementation repairs the publication boundary using the existing owner and exact failure identity, while preserving database handback and recovery policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 3b1bfb491a54. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +37, Tests +444. Total +481 across 10 files. Added test files: 2. View PR surface stats
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (20 earlier review cycles; latest 8 shown)
Reviewed October 17, 2026, 9:20 AM ET / 13:20 UTC (Revision 21). |
e02daab to
e144ea5
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Carry the census owner-deadline repair from a214e76 without release-CI policy changes. Keep cache timeouts and assertions unchanged while recording process and pipe settlement on successful and failed launches. Co-authored-by: Peter Steinberger <[email protected]>
Baseline-Refresh: b6203c135776c72114741a75cb08dac637653ab7
Baseline-Refresh: 2f3a7dab3fbc2c34209691399a18e29ef900bed5
Baseline-Refresh: ee5ca985771633464650a2c6a7276db5c19068ad
Baseline-Refresh: ead8560bfe03ccc6242803972ee72776dca396bf
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Baseline-Refresh: 704088a06c6344791a91bd321a8f4e5370dc4da0
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Baseline-Refresh: 738cb7a3c88a268a7573c3778e4bc5afefe90d87
|
@clawsweeper re-review Please review exact head The updated PR body separates fresh H12 normal-build/static/six-case proof from historical evidence and retains the execution and review limits. Current-head required CI and the five-file native Windows replay are running; their terminal results and ordinary native landing gates remain required. |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…penclaw#159644) * test(update): expose migrated output before parent settlement * test(update): finish candidate terminal fixture consistently * fix(update): defer migrated output until executor settlement * test(update): assert cleanup error identity across aggregate wrappers * test(acp): use the current host SQL observer contract * fix(update): reconcile terminal settlement with current executor ownership * fix(update): integrate canonical main validation repairs * fix(update): integrate canonical Doctor capture repairs * test(ci): preserve Windows census deadlines and trace cache settlement Carry the census owner-deadline repair from 79f95cd without release-CI policy changes. Keep cache timeouts and assertions unchanged while recording process and pipe settlement on successful and failed launches. Co-authored-by: Peter Steinberger <[email protected]> * merge: preserve migrated settlement across current Windows recovery Integrate frozen main c7b1062. Preserve healthy Windows recovery and the consolidated finalization result, while returning the original prepared failure and deferring output until all settlement owners finish. Retain both recovery and settlement regression coverage. * test(update): share migrated ledger observations * fix: refresh the reviewed correction baseline Baseline-Refresh: cba8c207955c935f7c10c6c589a1e424561db376 * test(update): extract migrated package settlement scenarios * refactor(update): share pre-mutation result construction Move the unchanged result factory to its canonical result owner to keep terminal settlement within the line-cap ratchet. Preserve publication and failure identity behavior. Carry only the two stale max-lines baseline removals from upstream a35cfd9 (openclaw#173343). * test(update): decode SQLite paths in migrated observer * fix: refresh the reviewed correction baseline Baseline-Refresh: a408acc9e10f7f583e7949d67ff7b71facc2a387 * fix: refresh the reviewed correction baseline Baseline-Refresh: ebdf351af0e3bed71866cae2421e38aaf5c2fe35 * test(update): exercise SQLite filename URIs in completion observers * fix: refresh the reviewed correction baseline Baseline-Refresh: b6203c135776c72114741a75cb08dac637653ab7 * test(cli): copy parent lifetime helper into launcher fixture * fix: refresh the reviewed correction baseline Baseline-Refresh: 2f3a7dab3fbc2c34209691399a18e29ef900bed5 * test(cli): retain the canonical launcher fixture dependency * fix: refresh the reviewed correction baseline Baseline-Refresh: ee5ca985771633464650a2c6a7276db5c19068ad * test(cli): preserve database context exports in native maintenance fixture * fix: refresh the reviewed correction baseline Baseline-Refresh: ead8560bfe03ccc6242803972ee72776dca396bf * fix: refresh the reviewed correction baseline Baseline-Refresh: 704088a06c6344791a91bd321a8f4e5370dc4da0 * fix: refresh the reviewed correction baseline Baseline-Refresh: 738cb7a3c88a268a7573c3778e4bc5afefe90d87 Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: Vincent Koc <[email protected]>
Related: #144739 and #143752. These are related references, not issue-closing claims.
Problem and operator-visible repair
Migrated updates could publish a terminal result before recovery and cleanup finished. A later settlement failure could then contradict the result already shown to the operator.
The terminal-publication owner now carries the prepared result and the same prepared failure object through compensation, package and scratch cleanup, and executor settlement. It publishes the result and callback once, only after the expected outcome survives settlement. Unexpected settlement failure suppresses publication and reports pending recovery without asking the older runtime to reopen newer state. Database handback, Windows recovery, child deadlines and receiver replay retain their existing owners; the retired automatic repair-agent path stays removed.
Forward-only rollout: the corrected ordering starts with the newly installed updater. An already-running published 9.4/9.6 parent keeps its earlier ordering. This PR does not establish first-hop recovery or complete interrupted-activation recovery for the related issues.
Both migrated-update SQLite test observers use the canonical SQLite filename decoder and normalize both compared paths through
resolveNodeSqliteLocation, then forward the original opener arguments. WHATWGfileURLToPathrejects the encoded separators used for Windows SQLite filenames. Package-completion success and failure cases exercise a separate real database, assert interception and closure, and retain the zero shared-state-opens assertions. Fault injections, completion outcomes, timeouts and cleanup remain unchanged.This builds on Jason Sy's and Vincent Koc's activation-recovery work.
Current source and scope
Signed H12:
3c3025371445baea5aea45f87241dfc812929ad8; tree3814ab3dff4ca095bce71e07d3a902f73809cd34. Its ordered parents are H11326028562949d1a325a19463df5c45b389462066and frozen canonical baseline663b7766cf4904da8bac733d938bd5e546966289. Original contributor-review authority is preserved.The PR changes 10 files: production +91/-54, net +37 for the deferred publication owner boundary, and tests +774/-330, net +444. The four production patches are byte-identical to H11. No configuration, documentation, dependency, protocol or schema-version delta remains relative to the selected baseline. The pure pre-mutation result factory belongs beside its result type; the deferred publisher keeps the original error identity and callback ordering.
The canonical agent-database ownership repair moved 13 existing inspection cases unchanged into
update-command-migrated-schema.test.tsand added eight owner-selection cases. That complete 21-case suite and canonical routing are retained, alongside the 28 package-finalization/settlement cases and both SQLite observer positive controls. No custom agent or plugin ownership policy is added.H12 resolves the subsequent real conflict with the canonical Windows fixture refactor. It adopts the incoming helper and outcome simplifications while preserving all six scenarios. Compensation refusal follows the candidate terminal receipt rather than taking the early replacement-refusal branch. Registered terminal ownership, identical prepared failure, suppressed stdout/callback, unchanged candidate history, zero new database opens and cleanup assertions remain intact. Sibling SQLite observers are unchanged.
Earlier launcher-fixture and native-maintenance mock/ledger repairs are supplied by the canonical baseline and no longer contribute to this PR's diff. Bounded tracing remains on the direct-run preload test, with cache sentinels, expected exits, assertions, managed cleanup and timeouts preserved. The historical Windows cache stall itself remains unidentified.
Fresh H12 evidence
663b7766cf4904da8bac733d938bd5e546966289 --no-merge-base(9,263 existing allowances); full normal distributable build with all three build-skip/private-QA overrides unset; and the complete resolved Windows recovery fixture through the canonical infra dispatcher without a name filter.settled=true, and outer execution returned 0 at 12:49:29 UTC.openclaw/ci-gatejob 117408612396 passed. Actual tested merge73c955e1df780898c00f84b589d6445cc7adcd47, tree2afa3a55213ef792233dfa33b810082613def717, has ordered parentsfa335db99b7be827316b2a2ce42e1a947ae0f158and H12. The event baseline is not substituted for that actual tested base. The canonical mock-export ratchet passed with 9,069 allowances from the actual CI base.d1dcae08d7e043cc21a6fcaf6abeb8b3477f04f5cb5ed88163794023634ce27f.The first H12 allocation, run 39003948600, queued before runner execution. Admission was cancelled with exit 130, the single native stop returned5, and one exact-run cancellation returned0. Authoritative state confirms cancellation before any runner or SSH step. All product phases on that attempt were unrun. The later explicitly authorized same-provider attempt above supplied the fresh proof; the cancelled attempt is not a success or runtime result.
Current-head hosted proof is qualified. Ordinary final native admission, exact-head/current-main checks and immediate squash remain required before landing. No inherited-CI exception has been granted or applied.
Historical evidence, retained at its original identity
H11: the normal build, diff/format/ratchet and complete migrated 28 + schema 21 suites passed, with final identity guards and native execution0. Its single native stop 255/context-deadline receipt remains separate from subsequently verified SSH/post-step closure. Required CI 39002074887, attempt 1 passed at04:45:14 UTC on October 17: 59 successful jobs,26 selected skips,0 failed. Actual tested merge
8dcbb2a5002e85d89111a2ab2b0baf005d9b0a40, treed395ec7989bc891310f4c479d93f5b855e799d0e, had ordered parentse8bb86a8fc832fa06aaf703441f7f6225050e1b2and H11. PostgreSQL executed 390 tests/69 files/6 shards,0 skip/0fail, including original Matrix 3, port 21 and recovery 12, with successful service teardown.H11 native Windows 39002176039, attempt 1 passed 118 tests,12 unchanged platform skips,0 failed in tooling → infra → cli-process order: checkout 49/7, direct-entry 14/5, Windows recovery 6/0, migrated 28/0, schema 21/0. Exact source/workflow H11, all 12 dependency hashes, Windows 2025/win32/x64, Node 24.21.0, full pnpm 12.11.1 pin, Vitest 5.0.3 and one worker were verified. Artifact 12089728719 was downloaded once:16,322 bytes, SHA256
433bc4ca8e9dce519042f0adbc036e11160b26d11a6470e3ca313f79031a73e1. Both URI controls, settlement variants, moved client case and new ownership cases passed. Process0/null signal/error, source/dependency checks and Actions teardown passed. Tree/test hashes are bound by immutable Git and checkout identity, not a separate runtime map. Descendant settlement is not attested; three retained namespaces belonged to Actions teardown.ClawSweeper revision20 reviewed exact H11 with no source/security findings or Rank-up moves. Its Before merge requirement was the genuine source conflict addressed by H12 and validation of the resulting head. H11 green checks and that source verdict do not cover H12.
H10: CI 38995759659 passed 61 jobs with 26 selected skips; PostgreSQL 390/69 and Windows 38995895439110/12 passed. Exact-H10 Claw revision19 had no findings, Before merge items or Rank-up moves. Initial CodeQL/OpenGrep attempts failed HTTP403; only each failed job was rerun once after recovery. CodeQL attempt 2 passed selection with 15 conditional analysis skips, not executed analysis. OpenGrep attempt 2 passed 106 rules/8 files/0 findings, SARIF upload and cleanup; its
using dbpartial-parse warning remains a coverage limit. Thenot_opted_inautomation disposition was unchanged. These older results are not H12 proof.Earlier failed required-CI runs remain failed. Canonical repairs resolve the observed per-task database-worker selection, launcher bootstrap dependency, Matrix preparation/legacy-dedupe seed and native-maintenance partial-mock defects. H8 CI passed PostgreSQL 389/389 but failed the mock-export ratchet; H9 passed its focused repair proof, then H10 passed the hosted ratchet. H7 CI exposed the Matrix fixture mismatch, repaired by canonical 682eb8ce. No executed baseline reproduction or waiver was claimed.
Historical H7 production Knip failed on
transcriptReadOperationsandQuotaSuspension. Defining source, consumers and 2,340 selected inputs matched its frozen baseline, but neither an executed baseline scan nor equal transitivepnpm dlxrealization was established. Its later export scan and trailing source guards were unrun; native product exit remained1. Earlier Knip results remain bound to their original heads. Prior proof leases are settled; original stop 5/255 lookup failures remain distinct from subsequent authoritative teardown.Remaining limits and follow-up
No installed-CLI settlement-failure trace, latest-stable first-hop proof, executed base-failure demonstration or complete interrupted-activation recovery is claimed. Real database observer controls and fault-injected lifecycle suites prove the tested owner boundaries, not those unexecuted deployment paths.
Named follow-up outside this repair: the local trusted-harness Git mock can delegate to a guarded wrapper that resolves back to the mock. This PR adds no raw-Git bypass, forced environment, timeout increase or weaker assertion.