Repository navigation
fix: avoid oversized downloads during cold PR preparation - #188785
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 maintainer review before merge. What this changesThis PR fetches commit history without historical file blobs, then hydrates required files through the existing transport. Example: Prepare a fork PR whose pr.txt changes from obsolete PR contents to current PR contents.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR addresses a current cold-preparation defect with a focused shared-transport fix; no actionable correctness or security findings remain. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Gateway's GitHub publication transport receives authenticated repository and commit selections and supplies Git objects for workspace preparation, base integration, review, and publication. flowchart TD
A[GitHub action] --> B[Workspace or publication owner]
B --> C[Shared Git transport]
C --> D[Blobless commit and tree fetch]
D --> E[Explicit required file hydration]
E --> F[Prepared workspace and review base]
D --> G[Ancestry and workflow checks]
Technical reviewBest possible solution: Use the existing shared transport to fetch blobless history and explicitly hydrate only the tree versions each consumer requires. Do we have a high-confidence way to reproduce the issue? Current-main source shows the unrestricted cold fetch, and the linked report documents a deterministic real-Git obsolete-blob reproduction; no target code was executed during this review. Is this the best way to solve the issue? This is the smallest complete repair: change object selection at the existing transport owner while preserving explicit hydration, full ancestry, and populated reuse. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ef2feab6ddae. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +1, Tests +100, Other +2. Total +103 across 4 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel 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 30, 2026, 9:36 PM ET / October 31, 2026, 01:36 UTC (Revision 2). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Fixed: cold PR preparation preserves ancestry while avoiding unused historical file downloads. |
…88785) Fetch publication ancestry without unrelated historical blobs and hydrate requested trees explicitly. Fixes openclaw#188764.
Backport #188785 from ec52f22. Co-authored-by: Shakker <[email protected]> Co-authored-by: RomneyDa <[email protected]>
Allow initial guest PR preparation from the recorded project's published history while preserving unpublished work and original PR identity. (cherry picked from commit 2757947) Stable adaptation: preserve the existing linked-identity fixture; expand its options type and allocate exactly 89 regression LF instead of 84. Production and documentation patches are unchanged from the source. Companions: #188785 is present-equivalent. Later #188784, #190223, #190576, #190542, #195413, #197229, #197243, #199717, #195787, #197510, #193664, #199851, #199864, #197656, #198851, #193873, #197594, #189006, #188904, #194025, #196200, #192283, #189010, #188816 and e0466ff are not prerequisites to this scoped repair; retain their separate intake dispositions. No later PR-number mentions. Proof: baseline 4 failed/20 passed through registered agent action; fixed 41/41 across preparation, refresh and base-action suites. Type-aware lint4, formatting5, docs MDX1419 and diff check pass. No live GitHub or full release qualification claim. Co-authored-by: RomneyDa <[email protected]>
Closes #188764.
What Problem This Solves
Cold preparation of an existing pull request downloads unrelated historical file versions before the workspace can use the PR's current files. On a large repository, this transfer can exhaust the fetch command's budget. A fork's separately fetched base can cause the same waste when it advances after the selected project snapshot.
User Impact
Preparing a PR in an empty workspace or an existing project retains its history and required current files while avoiding unused historical blobs. Ancestry-dependent review, integration and publication continue to work. Command deadlines, retries, credentials and workspace authority are unchanged.
Why This Change Was Made
The existing transport separates commit availability from current-file hydration. Every absent-commit fetch now requests blobless history, retaining commits and tree metadata for ancestry and workflow checks. Callers that need files continue through the existing explicit missing-object hydration. Keeping this selection in the shared owner also covers ancestry-only preparation callers without adding a new mode or downloading their unused tip contents.
The registered-action regression covers empty and selected-project sources with distinct fork/base URLs and an advanced base. It verifies that obsolete PR and base blobs stay absent while the required contents and history remain complete. The existing publication-history fixture now preserves the actual fetch arguments, and its normal publication case performs a native push from a cold metadata-only base with lazy fetching disabled. The 100 added test lines have an exact dedicated allocation; the shared baseline is unchanged.
Evidence
The unchanged production baseline reproduced the cold fetch timeout at 60.034 seconds with no completed pack. The original registered-action regression failed because an obsolete PR blob was downloaded. A separate registered-action probe exposed the same problem in the cold fork-base path before the completed correction.
The final tree passed changed-file formatting and lint, all selected production/test/consumer type checks, and 268 tests across 17 files. One existing opt-in real Podman test was skipped. The cases include non-shallow ancestry, exact current-tree completeness, distinct fork/base histories, populated reuse without fetching, merge-base hydration, retry/cancellation, and native publication without implicitly fetching the target base's file contents. The affected-test runs took 472.8 seconds in total across six native test invocations, including their existing setup and transformation work; this is not the added cases' isolated cost.
Retained large-repository owner proof completed the identical contents-hydration path in 19.502 seconds for history and 39.591 seconds for current blobs: 122,203 reachable commits, no shallow boundary, and zero missing current objects. Populated reuse took 47 ms without a fetch. These are scoped reproductions, not a general latency benchmark. The final correction preserves that path's arguments and hydration behavior; the metadata-only callers have the separate final-tree proof above.
A real Gateway running the qualified combined source
0d70033ab4b8994471689cafeff9fe7a3c7b8879, including this exact PR head3fc5b0d02425dcbdf8271bad55434e189c17bb56, also completed natural PR preparation in an existing guest conversation. A current maintainer prepared a foreign-authored fixture from the native empty source; the normal model/tool action returnedstatus: preparedandheadChanged: false. The guest's creator, sandbox requirement, original PR head and branch were preserved, and GitHub was unchanged.A read-only observer identified the actual receiver before the fetch and tracked the same physical Git common directory through completion, with lazy fetching disabled and no alternates. Before fetching, the requested head, base and all five controlled file versions were absent. When the head and base first arrived, all five blobs were still absent. After preparation, all 12 ancestry commits and all 10 current-tree blobs were present; the current file version was hydrated, while all four obsolete versions remained absent. No objects were deleted and no delay or synthetic caller was introduced. This is direct cold-path evidence, separate from the large-repository timing above.
The live recording has a gap during the asynchronous handoff; a continuation captures the settled result, and no request was replayed. The native completion and physical object observations establish the transfer behavior. No visual latency comparison is claimed for this small fixture.
The independent recheck and current-head automated re-review are clean, and exact-head hosted CI passed. On receiving main
ef2feab6ddae, the original registered-action regression still failed specifically at obsolete-blob absence, with the other 22 tests passing. The exact proposed merge then passed 64 tests across preparation, native publication and refresh/hydration suites using that target's locked dependencies. The earlier large-repository timings remain scoped to their original execution environment.