Repository navigation
fix(update): avoid stale chunks after same-commit Git rebuilds - #157350
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: blocked before merge. Reviewed September 24, 2026, 5:54 PM ET / 21:54 UTC (Revision 4). ClawSweeper reviewWhat this changesThe PR makes Git updates verify rebuilt runtime files in a fresh process, retains the previous checkout and runtime for final recovery, and updates updater tests and documentation. Merge readiness⛔ Blocked before merge - 5 items remain Keep open. Current main still selects the old process for same-commit Git rebuilds, but this PR can discard the previous runtime if its new post-activation identity read fails. The required published-driver upgrade observation is also outstanding. Priority: P0 Review scores
Verification
How this fits togetherThe Git updater builds a candidate runtime, stops the managed Gateway, activates the candidate, and verifies it before retiring recovery backups. Its result then feeds post-update convergence and service recovery. flowchart LR
A[Git checkout and local commits] --> B[Build candidate runtime]
B --> C[Stop managed Gateway]
C --> D[Activate runtime]
D --> E[Fresh process verification]
E --> F{Verified?}
F -->|Yes| G[Retire backups]
F -->|No| H[Restore prior Gateway]
Decision needed
Why: Candidate code cannot change an updater already running from the published release; accepting that upgrade limitation is a maintainer choice. Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +68, Tests +429, Docs +6. Total +503 across 62 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. Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Register finalizer custody before fallible activation-identity reads, preserve the prior runtime on every failure path, and document the proven first-hop behavior of the published driver. Do we have a high-confidence way to reproduce the issue? Yes. The PR's Linux systemd run reproduced the removed-chunk failure after a same-commit rebuild, and fetched main retains the selector that permits that path; this reviewer did not execute the exact fetched-main revision. Is this the best way to solve the issue? No, not yet. Fresh-process verification addresses the observed cause at the updater owner, but backup custody must precede the new fallible read and the published-driver upgrade path needs its required observation. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1ab1bb09789a. LabelsLabel changes: No label changes. Label justifications:
EvidenceAcceptance criteria:
What 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 (3 earlier review cycles)
|
d6749c3 to
0789d20
Compare
Route successful Git activation through fresh post-core continuation, compare the activated build at shared convergence completion, and retain existing source/runtime rollback through final verification. Reuse the current state/config/service finalizer and keep verified cleanup hiccups advisory. Document the published driver's first-hop limitation. Thanks @MikyWang for reporting the removed-chunk failure and stopped Gateway in #157012.
0789d20 to
99e6cf6
Compare
Move the unchanged step result contract to its own leaf and migrate every consumer directly. This removes the type-only cycle introduced by the retained Git transaction hook without changing runtime behavior.
…law#157350) * fix(update): recover same-commit Git runtime rebuilds Route successful Git activation through fresh post-core continuation, compare the activated build at shared convergence completion, and retain existing source/runtime rollback through final verification. Reuse the current state/config/service finalizer and keep verified cleanup hiccups advisory. Document the published driver's first-hop limitation. Thanks @MikyWang for reporting the removed-chunk failure and stopped Gateway in openclaw#157012. * test(update): extract Git runtime restoration cases * fix(update): isolate the step result type contract Move the unchanged step result contract to its own leaf and migrate every consumer directly. This removes the type-only cycle introduced by the retained Git transaction hook without changing runtime behavior.
What Problem This Solves
Fixes Git updates loading removed runtime chunks after rebuilding a checkout whose commit and version remain unchanged.
Fixes #157012. Thanks @MikyWang for the report and both failure traces.
User Impact
Successful Git activation uses fresh-process convergence. Activation captures the built commit and
distdigest; shared convergence compares that fact once, including in migrated candidate workers. A mismatch is a recorded verification failure. The existing finalizer retains the prior source/runtime through verification and restores the previous Gateway when its state/config/service safety checks permit rollback. Incompatible state changes or independent source edits retain backups and explain why automatic restoration was refused.The published 2026.9.5 driver still owns its first hop. Candidate code cannot replace that already-running parent's routing decision or recover backups it discarded. That hop may require the documented manual source update, stopping the Gateway through its actual service manager before rebuilding. Subsequent updates use the repaired driver.
Why This Change Was Made
An already-ahead checkout differs from upstream, so preflight builds it. Rebasing onto the existing ancestor can leave SHA and version unchanged. Activation replaces
dist, but the old selector treated matching source metadata as an unchanged runtime. The retained config factory then imported a removed content-hashed writer. The local-commit relationship is the trigger; the three commits' specific contents are unnecessary. The reporter's historical commit identities were not supplied, so the rig reproduces this execution class with synthetic commits.Scope stays with the existing routing, runtime inventory, and finalizer owners. There is no new recovery path, configuration, CLI option, dependency, or SQLite schema change. This branch was rebased once onto
d21bef382a187c6959efc55407c0a446505250e1; #156996 remained unmerged then. Its verified-artifact preflight and managed-stop protections complement this repair.Production is +228/−144, net +84 lines. Tests/support are +481/−82; docs +6/−0.
Evidence
Linux systemd user-service rig: Testbox run 35999950005, lease
tbx_01m39pjmrkksh2hwgnd9h23466. Both fixtures had exactly three local commits over unchanged upstream. Each update preserved its source SHA and version while replacing runtime chunks.openclaw update --yes --channel dev --jsonpost-update-failedokrpcOk: true; serving build matched activationThe baseline passed rebase, candidate build, staging, checkout, activation Doctor, and head verification before failing with:
The repaired driver recorded commit
5f5793f574d864a5c8a5d32318a4e60380c36c7dand digestcca97c95201bc0a7c708ff276adab16fddb0162f67dae64fb44b7d654f680e5d. Temporary-path service-definition advisories were separate from the reproduced failure. Both owned services/managers and the lease were stopped and independently verified completed.This is live proof of the driver at the branch base versus the repair, not a published-2026.9.5-driver cell. It preceded the final relocation of the same comparison to shared convergence; the final focused/dependent proof covers that placement and the migrated worker.
Final code proof on lease
tbx_01m39tnwqsdn599fkq7mf4nmkk, run 36007992647:check:changed: passed in 2393.713s, including all 25 test-type graphs, lint and every guard; run 36006462431, leasetbx_01m39sxyn33d6g8n23884nad59. Final documentation check: passed in 17.088s; all final code/test hashes remained unchanged.autoreview --mode branch --base origin/main: scoped-clean, no actionable P0/P1 findings on the committed branch.Measured
pnpm test <file> --maxWorkers=1costs:Recovery wall includes cold runtime preparation; the longest focused case was 1.898s. The full sweep's existing monolith took 248.556s of test time and lease suite 151.611s; maximum individual case was 13.689s. The coordinator waived the slow-test gate for this lane (#157018 owns the monolith split); no test was weakened or moved to another tier. Hosted CI duration is not yet available.
Validation repairs retained assertions: fixtures now materialize real build metadata/facts and truthful activation/current-core states. All six lifecycle cases remain, with actual resume production and exactly-one-handoff assertions; one-shot mock queues are reset between cases. The CLI monolith shrinks by one line. A mixed-E2E proof invocation initially skipped needed compiled workers; the final sequence uses native focused recovery preparation and verifies those artifacts before the mixed sweep. No unchanged rollback assertions or production code were altered for that harness error.