Repository navigation
improve(update): retry interrupted downloads and show transfer progress - #184452
duyufansh2008 wants to merge 4 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 gives updater fetches four attempts, displays numeric Git transfer progress, and adapts upgrade assertions to verified archive retirement. Example: A Git HTTP server interrupts the first two pack responses, then serves the third at 128 KiB/s.
Review scores
ProductKind: Feature · Worth it: Needs a maintainer decision · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep open: this PR provides a concrete, supported improvement beyond current main; accepting the longer download retry policy remains an owner decision. Priority: P2 Decision needed
Before merge
FindingsNone. Agent review detailsHow this fits togetherThe updater command runner executes Git through the shared retry owner and forwards sanitized transfer events to the existing CLI presenter; candidate validation and activation retain their existing owners. flowchart LR
A[Update CLI] --> B[Updater command runner]
B --> C[Shared Git retry owner]
C --> D[Native Git transport]
D --> E[Numeric progress parser]
E --> F[Existing CLI presenter]
D --> G[Candidate validation]
Technical reviewBest possible solution: Approve or decline the fetch-only retry schedule while retaining the existing retry owner, CLI presenter, and upgrade-preservation checks. Do we have a high-confidence way to reproduce the issue? Current-main source establishes the two-attempt limit and absent transfer callbacks; inspected contributor captures demonstrate the two-interruption failure and candidate recovery without a new reviewer-run reproduction. Is this the best way to solve the issue? The implementation is a focused extension of the existing retry and presentation owners; the bounded numeric parser supplies the missing transport adapter without introducing another downloader or persistent state. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 1fcf6e7df5f6. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +116, Tests +134, Docs +2, Other +27. Total +279 across 13 files. Added test files: 0. 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 (3 earlier review cycles)
Reviewed October 26, 2026, 10:29 PM ET / October 27, 2026, 02:29 UTC (Revision 4). |
|
Addressed the process-mock type finding in Added a bounded real Git HTTP cancellation check for the download core associated with PR head The server stayed up until 1889 ms, beyond the original retry deadline (1385 ms). Native-attempt accounting, Git's own trace, and HTTP requests each recorded exactly one fetch. No child processes remained after scope settlement; the listener, sockets, and temporary repository were cleaned up. Source and imported module SHA256s were checked before and after execution; all three source Git blob IDs match the publication receipt verified against the current PR head. Scope: exact final download-core modules with import-only path rebasing, using the equivalent task presenter and task dependencies. This covers caller-scope cancellation during retry backoff; a complete latest-stable upgrade, Gateway-managed recovery, and cancellation during an active transfer remain unverified. The reported base-red/head-green transport evidence is the actual HTTP reproduction: the pinned upstream command owner fails after two interruptions; the candidate succeeds after the same two interruptions. It is not a claim that a complete latest-stable upgrade was exercised. That upgrade proof remains an explicit gap. The longer download retry schedule is the improvement proposed for maintainer review in this PR; no maintainer policy approval or merge authorization is being claimed. The author requested stronger weak-network recovery in addition to visible progress. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Updated the title and description to present this as an enhancement to the intentional single-retry policy, with the proposed fetch-only 1s/5s/15s schedule and its limits explicit. No additional production changes were needed after the latest review's zero code findings. Rechecked exact head The installed-CLI upgrade requirement remains open. Local source acquisition failed through Git (HTTP 408 / curl 28) and a stalled archive; the alternative bulk API acquisition also failed. A complete exact-head package was not produced, so no latest-stable upgrade or state-preservation success is claimed. CI's package and published-upgrade jobs were skipped. The supported next proof is the pinned The download-only retry policy still needs a maintainer decision before merge. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review Added real installed-CLI latest-stable upgrade proof and updated the PR body for exact head
The Git HTTP fault-injection captures still use the unchanged command-owner modules with import-only rebasing and an equivalent presenter; their scope is explicit. Maintainer acceptance of the proposed fetch-only retry schedule remains a product decision. |
|
🦞👀 Re-review progress:
|
|
Thanks @duyufansh2008 for the weak-network recovery work and the detailed reproduction. I have taken the retry improvement over in #189818, preserving your co-author credit from the PR commits. The rewrite uses the existing retry owner for bounded fetch and transactional-clone recovery, with cleanup, cancellation, deadline, authentication, and integrity safeguards. Numeric transfer progress is left out of that focused patch; the existing stage/activity notices remain. Closing this PR as superseded. The replacement is open for maintainer review and its CI is running. The separate clone report #189643 remains open pending the sanitized Git stderr already requested there. |
Closes #184442
What Problem This Solves
Git-update operators on weak networks need recovery beyond the existing single retry and live feedback while a transfer is running.
User Impact
Update fetches get up to four attempts, with retry waits of 1s, 5s, and 15s. The CLI shows Git-reported stage, object percentage, bytes, speed, and retry notices when available. Redirected transfer output is throttled to once every five seconds; JSON stdout stays machine-readable.
Explicit timeouts and cancellation still apply. Persistent outages still fail after the fourth attempt. Git reuses completed objects, but an interrupted pack restarts rather than resuming at a byte offset. Users need an updater containing this change to receive the improvement.
Why This Change Was Made
This is an enhancement to the intentionally documented single-retry policy. Only updater fetches select the longer schedule; discovery reads retain one retry. The existing retry owner continues to enforce permanent-error exclusions, remaining time, cancellation, cleanup status, and admission before each attempt.
Transfer feedback uses the existing CLI presenter. Only Git's numeric progress vocabulary reaches the display, and a failed renderer cannot abort a download. No configuration, dependency, or state-schema changes are required. Maintainer acceptance of the proposed download-only retry schedule remains an explicit product decision.
Evidence
Current head:
5b132163830b53926eb738651ab0ac85c1e134c9. Transport implementation unchanged from6ce0c31649d010d8dfb7a27672e81760f7bd5962.openclaw/ci-gate: CI run 40431449701.git fsck --strictpass. These captures exercise the production command-owner modules with import-only rebasing and an equivalent presenter; those modules are unchanged on current head.termination: "signal"andexitCode: null. Observation beyond the next scheduled attempt sees one Git fetch, one pack request, and no remaining children or sockets. Evidence and scope.[email protected], and invokes that installed CLI'sopenclaw update --tag <candidate.tgz> --yes --json --no-restart. All 22 update steps return zero. The complete inventory of 18,021 installed files matches the candidate, including its build commit. Configuration, sessions, cron state, SQLite integrity/content, migration archives, and Doctor idempotence pass. Gateway liveness/readiness andgateway status --require-rpcpass;sessions.list/chat.historyverify all 8 conversations before and after manual fixture restart with identical contents/order/hashes.The upgrade proof executes the supported native
bash scripts/e2e/upgrade-survivor-docker.shwithsqlite-volume, 8 volume sessions, 5 events per transcript, 8 cron jobs, Node 24.22.1, and live providers disabled. This bounded functional fixture includes metadata-only and already-missing-transcript cases. It is a standalone fork shell-harness run; skipped canonical package/published-upgrade jobs are not cited as proof.The earlier same-head run passed survival, first RPC readback, and idempotence, then hit the native 1200s total container timeout during restart (exit 124). The passing rerun uses the supported 2400s outer envelope. Per-command, startup, status, probe, and computed idempotence limits remain unchanged.
The survivor oracle follows completed migration moves through the existing strict archive reader: retired originals require observed pre-cleanup bytes matching producer disposal size/SHA-256. Protected
unreferenced-jsonloriginals remain required as retained files. Exact counts, identities, transcript content, and database assertions remain.Redacted output from the actual installed CLI upgrade and retained-state proof
Captured from the passing run above. Arguments, paths, raw logs, configuration, IPs, keys, phone numbers, non-public endpoints, and chat content are excluded. Equal before/after version numbers are intentional: the complete installed payload and build commit independently match the exact candidate.
{ "status": "ok", "mode": "npm", "reason": null, "before": { "version": "2026.10.7", "sha": null }, "after": { "version": "2026.10.7", "sha": null }, "steps": [ { "name": "database snapshot", "exitCode": 0, "termination": null }, { "name": "package-install", "exitCode": 0, "termination": "exit" }, { "name": "candidate-state-snapshot", "exitCode": 0, "termination": null }, { "name": "candidate-doctor", "exitCode": 0, "termination": null }, { "name": "candidate-doctor-lint", "exitCode": 0, "termination": "exit" }, { "name": "candidate-config", "exitCode": 0, "termination": null }, { "name": "candidate-plugins", "exitCode": 0, "termination": null }, { "name": "candidate-recovery", "exitCode": 0, "termination": null }, { "name": "candidate-gateway-startup", "exitCode": 0, "termination": null }, { "name": "package-swap", "exitCode": 0, "termination": null }, { "name": "openclaw doctor", "exitCode": 0, "termination": "exit" }, { "name": "update-driver-handoff", "exitCode": 0, "termination": null }, { "name": "post-plugin doctor", "exitCode": 0, "termination": null }, { "name": "post-plugin-doctor-warning-1", "exitCode": 0, "termination": null }, { "name": "post-plugin-doctor-warning-2", "exitCode": 0, "termination": null }, { "name": "post-plugin-doctor-warning-3", "exitCode": 0, "termination": null }, { "name": "post-plugin-doctor-warning-4", "exitCode": 0, "termination": null }, { "name": "post-plugin-doctor-warning-5", "exitCode": 0, "termination": null }, { "name": "post-plugin-doctor-warning-6", "exitCode": 0, "termination": null }, { "name": "managed-service-reconciliation", "exitCode": 0, "termination": null }, { "name": "post-plugin-doctor-lint", "exitCode": 0, "termination": "exit" }, { "name": "recovery-artifact-cleanup", "exitCode": 0, "termination": null } ] }Native postconditions from the same run:
Whitelisted package and RPC evidence from artifact
pr184452-installed-upgrade-5b132163-1(ZIP SHA-256 verified on download):{ "status": "passed", "sourceSha": "5b132163830b53926eb738651ab0ac85c1e134c9", "workflowSha": "ad526ba67625bef4477ee52a333c4c6d10e689dc", "baselineResolvedAt": "2026-10-27T01:53:47.015Z", "baselineVersion": "2026.10.7", "fixture": { "sessions": 8, "eventsPerSession": 5, "cronJobs": 8 }, "package": { "version": "2026.10.7", "commit": "5b132163830b53926eb738651ab0ac85c1e134c9", "tarballSha256": "20791d3e9472482dbe2f41c003095fb648f1389b1ec0c59f85333697e5c6acbd", "files": 18021, "inventorySha256": "e4c57e7cab5a5dd7e12824b720320fd02d870f69876a6657dfe3793f484f5f95", "installedMatchesCandidate": true }, "history": { "beforeAndAfterRestartMatch": true, "samples": [ { "index": 0, "agentId": "main", "messages": 4, "messagesSha256": "68ad4a15a628e33b6b25bf8dbc5e1af33712a72bef53bd9798829e7192bc4ff3" }, { "index": 1, "agentId": "ops", "messages": 4, "messagesSha256": "035376bd611266ff8574858648840c1e80cdb023de13e94226c664a1caaaad3f" }, { "index": 2, "agentId": "main", "messages": 4, "messagesSha256": "41d2cbfd3965900c747e69af32fb6b4a650ea192e3326d8b307a10ce8f456b86" }, { "index": 3, "agentId": "ops", "messages": 4, "messagesSha256": "dad1ac0d848b401ffc2ef33148cfb6d78dc03d3cc1511ecefbdc6f829eadc958" }, { "index": 4, "agentId": "main", "messages": 0, "messagesSha256": "4f53cda18c2baa0c0354bb5f9a3ecbe5ed12ab4d8e11ba873c2f11161202b945" }, { "index": 5, "agentId": "ops", "messages": 0, "messagesSha256": "4f53cda18c2baa0c0354bb5f9a3ecbe5ed12ab4d8e11ba873c2f11161202b945" }, { "index": 6, "agentId": "main", "messages": 4, "messagesSha256": "253240c4eb60d4bd74dcf12944b941730972b853324d502629243ecf4210d131" }, { "index": 7, "agentId": "ops", "messages": 4, "messagesSha256": "d3be7b1a6380988490e1f36b01ff59934ac89264406619c186259158b763f174" } ] }, "runtime": { "node": "24.22.1", "imageId": "sha256:a14a503d967525aedf6a5e93e8574da230d620f4f535148c4ec76e5d75182ddc" }, "gatewayChecks": [ "healthz/live", "readyz/ready", "gateway status --require-rpc", "sessions.list", "chat.history" ], "artifactZipSha256": "2b6a5bc3154430956eb5cdfe0204e93779dd531b94c8943e8f3028c158da58e5" }Before/after console captures from the controlled Git reproduction:
Implementation scope and focused test command
The existing retry owner and presenter retain their responsibilities. The additions are the bounded progress parser, callback path, and fetch-specific backoff selection. No second downloader or persistent retry state was added. Against the pinned base, thirteen files change: production +158/−42, unit tests +137/−3, docs +4/−2, and survivor checks +43/−16.
The 46-test local run used the cached checkout; the nine command-runner tests ran again after the typed-fixture correction. Current-head CI is linked above.