Repository navigation
fix: preserve partial-clone filtering across shared fetches - #196854
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 Summary: ✅ CompletedThis 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8995833fba
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Codex review: needs maintainer review before merge. What this changesPreserves filtered promisor packs during publication hydration, pinned-commit acquisition, and agent fetches in shared blobless clones. Example: An agent runs
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR addresses a current partial-clone defect through the existing fetch owners; both earlier findings are resolved, no actionable defect remains, and the exact-head CI gate passes. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherAgent exec, project preparation, and GitHub publication invoke native Git to acquire repository objects; their existing transport owners control filtering, remote registration, and content readiness. flowchart TD
A[Agent exec] --> B[Git PATH shim]
C[Project preparation] --> D[Project Git transport]
E[GitHub publication] --> F[Publication Git transport]
B --> G[Native Git]
D --> G
F --> G
G --> H[Shared promisor object store]
Technical reviewBest possible solution: Retain filtering in the existing fetch owners, with stable promisor transports and complete content hydration. Do we have a high-confidence way to reproduce the issue? The base source omits filtering for publication content hydration and pinned URL fetches, while shared secondary-remote fetches lack consistent promisor registration; native regressions and the author's before/after records cover these paths, but this read-only review ran no target code. Is this the best way to solve the issue? This is a complete repair using the existing shim and transport owners; the extracted project filter reader avoids duplicate policy, and the added test cases protect distinct native Git boundaries. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against a2879ad0a140. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +104, Tests +102, Docs +1, Other +2. Total +209 across 9 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. 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 (2 earlier review cycles)Reviewed November 10, 2026, 4:27 PM ET / 21:27 UTC (Revision 3). |
|
All three items from ClawSweeper’s earlier review, including the two hosted Codex findings, are addressed on
All 85 affected tests pass. Fresh full-candidate Codex review through P3 is clean; the subsequent test-only shadowed-variable rename also passed focused lint, formatting and an independent mechanical-change review. The corrected changed-file run's known baseline dead-export failures and exact-parent attribution remain disclosed in the PR body. The 102 added test lines have exactly 102 allocation; the separately reproduced 128-line baseline debt is unchanged. Updated CPU/allocation/A/A evidence is in the PR body. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…#196854) * fix: preserve partial-clone filtering across shared fetches * fix: hydrate promised content across worktrees and treeless clones * test: avoid shadowing publication hydration mode
What Problem This Solves
Fixes: shared blobless project clones accumulate ordinary packs when publication hydrates content, checkout preparation fetches a pinned commit by URL, or an agent fetches from a secondary repository. These packs make later partial-clone maintenance unnecessarily expensive.
Related: #196784. The separate scripts/pr fix landed in #193670.
User Impact
Managed partial clones retain promisor packs across these fetch paths. Agent fetches and pulls in shared blobless clones register Git's standard promisor/filter settings for configured and literal remotes, preserving later reads of peer-only blobs. An explicit
--no-filterfetch is refused there; standalone repositories and projections retain their existing choices. No new OpenClaw configuration is introduced.Why This Change Was Made
Literal URLs do not automatically inherit
origin's filter. Publication content hydration also selected--refetch --stdininstead of retaining--filter=blob:none. Both owners now retain filtering. Pinned-commit acquisition reuses the existing project filter reader after its present-commit fast return.The agent wrapper lets native Git select named remotes, groups and all/multiple fetches; Git rejects a top-level filter option for multi-remote fetches. Durable Git promisor registration is necessary for subsequent peer-only blob hydration. Relative fetch URLs are anchored using Git’s native transport cwd and URL-rewrite resolution, so other linked worktrees can use those promises; distinct additional URLs and push URLs are preserved. The existing config read supplies an invocation-local snapshot, so correctly configured remotes incur no config writes. One argument scan replaces the previous three scans.
Evidence
Native regression tests fail on the original owners with an ordinary pack missing its
.promisormarker. All 85 tests across the four affected files pass, including installed exec → native Git, remote groups,--all,--multiple, URL/path operands, upload-pack option values, pulls, subsequent peer-only content reads, and standalone behavior. Hosted review caught two additional regressions before landing: cross-worktree hydration through relative peers, and missing trees revealing previously unknown blobs. Both now have failing-before/passing-after native proof. Publication hydration needs at most two filtered batches when trees are absent; blob-only hydration retains identical Git argv and pack bytes.On a synthetic fixture with 13,006 refs and 1,054 packs, pinned-commit acquisition falls from 9 objects / 3,147,341 bytes to 6 commits-and-trees / 623 bytes. Median wall time falls 358→254 ms and native CPU 310→170 ms. The additional config command raises JS CPU 11.27→15.33 ms and sampled allocation 1.08→1.52 MB; already-present commits still use one offline command and no config read or fetch.
Publication hydration transfers the identical requested blobs and pack bytes before/after, now with the promisor marker. Five paired trials and A/A controls show no demonstrated speedup: median wall 392→408 ms, JS allocation +0.9%, with host-tail contention.
The corrected small local explicit-fetch fixture measures 6→9 Git processes and 46.78→47.97 ms child CPU; wall medians 69.77→103.98 ms, with A/A 68.69 ms. This is added fetch-policy overhead on macOS, not a production Linux latency claim. Subsequent correctly configured fetches make zero config writes. A separate qualified Linux Git allocator interposer reports 2,374→3,586 allocation requests and 5,248,735→5,530,696 cumulative requested bytes per explicit fetch; all five A/B/A2 samples match exactly, with A2 identical to A. These counts exclude shell/Python, mmap and hidden libc allocations and do not measure retained memory. The already-present content path still returns before fetch policy and remains two Git processes with no network or pack changes; its earlier path-specific A/B/A2 control was within noise.
The exact base-root
git diff --quiet <a> <b> -- <path>with two missing commits was separately verified through exec → Python baregit: 36 objects without the wrapper, 6 with it, all promisor; changed and unchanged paths retain native exit codes. The already-merged revision preparation needs no further diff change.Production growth is 104 lines; tests grow 102 lines with an exact scoped allocation. The growth covers shared native fetch selection, usable promisor registration, and one reused project filter reader; there is no new cache or transport staging layer. The separate
scripts/prauthoritative-fetch correction is merged in #193670.Fresh independent Codex autoreview through P3 is scoped-clean after both hosted-review corrections. The corrected
pnpm check:changedrun completed: types, formatting and the other guards pass. It caught a test-only no-shadow error, which was corrected and passed targeted lint/format checks. The remaining repository-wide dead-export scan fails on 33 production / 9 full-tree entries. The canonical checker reproduces identical entries on exact parent2a41138, with no module-resolution errors; the causal attribution reuses prior lane evidence, with the new diagnostics export identified below. The test-line guard reproduces the same 128-line deficit on exact parent2a41138ac9d467e12b33d8981cafe7d13ad6d019(6,635,428 lines / 6,635,300 ceiling); this PR adds exactly 102 lines and 102 allocation. That deficit was introduced by #196346 (b91520c), not this change. The newly detected unusedprojectLeaseDiagnosticFramesexport originates in2c4e34a72f490c710bc155319fcabf872f482b3eand is a main regression requiring separate repair. No live shared clone was modified for this proof, and the historical observed packs cannot be assigned to a particular caller from the available logs.