Repository navigation
feat: retain completed Git update download batches - #185398
duyufansh2008 wants to merge 2 commits 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 SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: blocked before merge. What this changesThis PR retains completed Git object-download batches across interrupted official-source updates and removes the cache after success. Example: An updater process exits after completing a 128-object batch.
Review scores
ProductKind: Feature · Worth it: Needs a maintainer decision · Fix scope: Partial Merge readiness⛔ Blocked before merge - 1 item remains Keep open: this PR provides useful, proven batch recovery with no concrete introduced defect found, but default adoption needs an update-owner decision about transfer overhead. Priority: P2 Decision needed
Before merge
FindingsNone. Agent review detailsHow this fits togetherThe Git updater fetches selected targets into a private inspection repository, prepares and validates candidates, then imports admitted objects before activating source and runtime. flowchart LR
A[Selected Git remote] --> B[Filtered metadata fetch]
B --> C[Locked stationary Git cache]
C --> D[Missing object batches]
D --> E[Private candidate inspection]
E --> F[Validation and mutation admission]
F --> G[Import and activation]
Technical reviewBest possible solution: Have the update owner decide whether native batch recovery warrants the measured transfer overhead before adopting it as the official-source default. Do we have a high-confidence way to reproduce the issue? Current-main inspection storage is temporary, establishing why its downloaded objects do not survive cleanup; supplied runtime output demonstrates the proposed recovery without executing target code during this review. Is this the best way to solve the issue? The smallest coherent implementation uses native Git objects, the existing lock and artifact storage, and existing candidate owners; it supplies batch recovery while leaving byte-offset continuation outside this PR. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 76754813847b. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +441, Tests +524, Docs +17. Total +982 across 7 files. Added test files: 2. View PR surface stats
Review metrics
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 (1 earlier review cycle)
Reviewed October 27, 2026, 1:11 AM ET / 05:11 UTC (Revision 2). |
|
@clawsweeper re-review The branch and PR body are current at The transfer-cost measurements and the update owner's default-adoption decision remain explicit; this is a request for review, with no merge or release requested. |
|
🦞👀 Re-review progress:
|
|
Thank you for the careful recovery work and for documenting both the successful restart tests and the transfer costs. Keeping completed object batches is a real capability beyond automatic retries; #189818 (1440bb1), which took over your #184452 with credit, does not provide byte-offset resume or durable recovery of these batches. After reviewing the complete diff against current main, I am closing this implementation because the added default transport does not meet the updater's reliability/maintenance tradeoff:
Main now has the much smaller shared fetch/clone recovery from #189818: up to four attempts, shared deadlines/cancellation, and cleanup before clone retries. I prefer to keep that default while we measure the remaining repeated-transfer problem. A smaller follow-up would be welcome with a representative interrupted-update case on top of #189818, measured normal/retry transfer costs, and bounded retention/cleanup owned by the existing inspection/transfer lifecycle. It should preserve ordinary Git on the normal path and non-official remotes, and demonstrate safe fallback before mutation when optional recovery storage is unavailable. True byte-offset continuation remains a separate design question in #185253. Thank you again for the contribution and the unusually clear evidence. |
Related: #185253
What Problem This Solves
An interrupted Git-source update should keep completed downloads when its temporary inspection checkout is removed or the updater process exits.
User Impact
Official public
openclaw/openclawsource checkouts can retry using already completed Git batches. Only missing objects are requested again; the interrupted batch can restart.This is object-batch recovery, not byte-offset continuation inside a pack. A metadata pack can also restart. Multiple requests and separate blob packs can increase first-transfer bytes and latency compared with ordinary Git. Private repositories, forks, other Git services and npm updates retain their existing transport.
Why This Change Was Made
Keep the existing remote, ref and candidate selection owners. Fetch commit/tree metadata first, then hydrate missing history and candidate-tree objects in native compressed Git batches of at most 128 object IDs. Keep Git's object store and negotiation tips in stationary artifact storage under the existing file lock; retain it on failure and remove it after success.
Hydration follows Git's native promisor-fetch contract, including disabled negotiation for missing objects. This also covers a cached pinned commit whose promised blobs are absent. Download work stays within cancellation and the original deadline, before candidate metadata reads, validation and mutation admission. There are no publisher artifacts, release-workflow changes, public options or database migrations.
Evidence
git diff --checkpassed. Independentautoreviewcompleted with no P0–P2 findings after fixing its cached-pinned-target finding.f623a2ccbd6ee80cb5ad1127c5cecfdf6e79d6db, realblob:nonemetadata fetch, completed first object batch, sustained TLS disconnect during the next batch, then a new Git process requested only the remaining objects. Strict fsck and all twelve historical/fallback trees matched ordinary Git.ok, including retained-runtime preparation, candidate build, Doctor, config/plugins/recovery checks, Gateway startup, admitted-pack import and activation. A new CLI process requested zero of the 654 blobs completed by earlier invocations. Installed source/build/runtime commits agreed afterward, the same isolated state loaded successfully, and the completed download cache was removed. Refused-network and SIGINT runs had previously left the old installation usable.tree:0regression. It was also compiled and booted separately; full CLI versus final-helper source scopes are stated below. The native published-latest-stable driver qualification also passed; its same-version/different-build source scope and captured result are below.Measured costs and proof boundaries
The live three-blob fixture deliberately used one object per batch to exercise interruption between batches. Including its interrupted request, the run used 83,322 server-to-client TLS bytes and 10 HTTP requests; ordinary Git for the same delta used 10,449 bytes and 2 requests. A separate all-three-object batch plus metadata used 68,865 TLS bytes and 4 requests. These are actual proxy-observed wire bytes, not local pack sizes. They demonstrate recovery and its overhead, not a general traffic or speed improvement.
Production uses up to 128 objects per batch. This bounds object count, not compressed bytes. Git object compression is retained; ordinary fetch may choose better cross-version delta bases.
New transport tests took about 2.3 seconds of test execution. The full rejection/retry/activation regression took 8.1 seconds on this host and covers two complete updater runs; helper-only tests would miss that lifecycle boundary. The six-suite run took 123.79 seconds including cold compiler preparation. The final head
5955935cpassed openclaw/ci-gate: 70 successful checks, 60 skipped and one neutral, with no failures. Skipped checks are not counted as passed qualification.The implementation has one internal download owner and uses native Git objects/refs instead of a new manifest, database or publishing protocol. Existing step factories moved to their command owner to keep the updater within its file-size gate. No version is published and no merge is requested.
Captured runtime output and exact scope
Executed through the supported CLI in a task-owned checkout, HOME/state directory and loopback listeners:
Selected fields from the captured CLI result and controller:
{ "exit": 0, "seconds": 1074.48, "status": "ok", "mode": "git", "before": "199d263a74fdd30e8225750a38f155beed689423", "after": "33b8144615ac38a58b2be2099e1bb02d175dabe5", "builtCommit": "33b8144615ac38a58b2be2099e1bb02d175dabe5", "sourceRuntimePrepared": true, "downloadCacheRemoved": true }Selected fields extracted from the actual client-side Git packet trace of the new CLI process:
{ "previously_completed_blobs": 654, "unique_wanted_oids": 91, "previously_completed_blobs_requested_again": [] }The branch moved while the interrupted update was being prepared. These are 91 newly requested object IDs, with no intersection against the 654 already completed blobs.
Captured production-helper SIGKILL/new-Node result:
{ "firstNodeReturncode": -9, "firstCompletedBatch": 128, "resumedBatchSizes": [ 128, 7 ], "repeatedCompletedObjects": 0, "metadataPackRetransferred": false, "staleLockReclaimedAndReleased": true, "strictFsck": "passed", "historicalFallback": "matched", "installedFilesUnchanged": 31 }Captured real live-holder contention result. The second Node reached the actual lock timeout, performed no shared-cache initialization, and used the existing Git fallback. After the holder released normally, a fresh Node reused its completed pack:
{ "liveHolderFirstBatch": 128, "contenderObservedLockTimeout": true, "contenderCacheInitializations": 0, "sharedPackHashesUnchangedDuringContention": true, "holderReleasedNormally": true, "resumedBatchSizes": [ 128, 7 ], "repeatedCompletedObjects": 0, "strictFsck": "passed", "productionSourceSha256ObservedAfterRun": "5bb67fad2d02cfba7eda8bc0a4e02c8733ecaad290e33ed96145bbdf7d62b992" }Captured Gateway readiness after the completed upgrade, and again after compiling the final helper repair:
{"ready":true,"coreReady":true,"failing":[],"eventLoop":{"degraded":true,"reasons":["cpu"]}}The host was running parallel builds during those probes; this is readiness evidence, not a performance qualification.
Source attribution: the full CLI run used the four production files from
10c73200, rebased by the ordinary dev-update flow onto official target63a05a41365026646b71df6ec7b0e390c506695a; its local installed result was33b81446. The only later production repair in5955935cchanges how an absent promised root tree is inventoried. That repair has an observed red→green regression, and its exact helper SHA-2565bb67fad2d02cfba7eda8bc0a4e02c8733ecaad290e33ed96145bbdf7d62b992matches the live contention proof and a separately compiled/booted isolated buildf926e640. The long normal upgrade is not being represented as a byte-identical run of that later repair.Existing isolated state was reused: agent
mainremained present; operator settings remained gateway modelocal, auth modetoken, update channeldev; public schema declarations remained state 34/agent 37. Real Doctor/recovery/Gateway processes consumed those databases. No database schema or storage format changes are introduced here. Existing unknown-writer recovery advisories were retained; this does not claim database bytes stayed unchanged or automatic database restoration was universally available.Default adoption and its measured transfer-cost tradeoff remain for the update owner to decide; this PR is not a merge or release request.
Published stable driver qualification: captured result
The native
scripts/e2e/published-driver-update-docker.shcell from5955935cpassed locally. It installed the stock npm[email protected]tarball, then used that published updater to install the locally built candidate tarball throughopenclaw update --tag /tmp/openclaw-current.tgz --yes --json. All native assertions ran, including durable update status, managed Gateway replacement, readiness, running build identity, persisted session content, retained state fixture bytes and incognito cleanup.Selected fields from the captured result:
{ "driverVersion": "2026.10.7", "beforeBuildId": "2026.10.7-release-157d8c2bc3ea-2026-10-24T02-45-17.235Z", "candidateBuildId": "2026.10.7-f926e64082ee-2026-10-27T04-33-00.957Z", "nativeExit": 0, "seconds": 838.165, "phase": "finished", "recordedStatus": "succeeded", "runningBuildId": "2026.10.7-f926e64082ee-2026-10-27T04-33-00.957Z", "managedGatewayPidReplaced": true, "durableSessionSentinelPreserved": true, "retainedStateSentinelBytesPreserved": true, "incognitoContentRemoved": true, "readinessHttpStatus": { "before": 200, "after": 200 }, "sameNumericVersionDifferentBuild": true, "teardown": { "containerRemoved": true, "volumesRemoved": true, "stopServiceExit": 0 } }This is published stable
2026.10.7→ a different local2026.10.7build, not a numeric-version upgrade. Candidate source is the post-upgrade moving-main buildf926e640described above, carrying the exact final-helper SHA-256 from5955935c; it is not being represented as a package built from the exact PR-head tree. Canonical packaging and integrity checks passed without altering producer receipts or stamps. The container, managed service and disposable volume were settled after the test. This package-compatibility cell supplements the real Git-source update and restart-recovery proofs; it does not change npm-update transport.