Repository navigation
Conversation
Prepare missing revision roots with negotiated blobless fetches before shared-clone content commands. Preserve offline probes and global options; stop rejected origin requests before any lazy full-history retry. Reuse shared-worktree detection and add native Git transfer regressions plus a rerunnable million-object fixture.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
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. |
|
@clawsweeper review Please review final head |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesThe agent Git wrapper negotiates acquisition of missing revision objects before content commands can trigger full-history lazy downloads. Example: Read a newly added commit in a shared blobless clone containing 126,357 existing commits.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR addresses a current performance bug that main still exposes; the final head has no concrete introduced defect identified in this review. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherGateway startup installs the existing POSIX Git wrapper on agent PATH; Git arguments enter it and reach native Git after offline probing or negotiated revision preparation. flowchart TD
A[Agent Git command] --> B[Existing PATH wrapper]
B --> C[Offline probe]
B --> D[Revision object inspection]
D --> E[Negotiated origin fetch]
D --> F[Native content command]
E --> F
F --> G[Content and exit status]
Technical reviewBest possible solution: Keep missing-revision acquisition in the existing wrapper while preserving offline probes, native blob hydration, and explicit owning-remote recovery. Do we have a high-confidence way to reproduce the issue? Current-main source exposes the unprepared content-read path, and the supplied native regression reports excessive transfer on the base; this read-only review executed no target code. Is this the best way to solve the issue? The patch removes redundant history transfer before native lazy fetching starts, reuses the existing repository-option owner, and adds no runtime cache, dependency, or competing acquisition layer; its new flags belong only to the benchmark tooling. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 41a8248c111f. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +93, Tests +138, Docs +1, Other +70. Total +302 across 5 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: 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 November 10, 2026, 11:47 AM ET / 16:47 UTC (Revision 2). |
Treat restore -S as a flag and skip revision preparation for diff --no-index. Native regressions prove that staged restores negotiate missing sources and hash-shaped filesystem paths do not trigger fetches.
|
@clawsweeper re-review The prior review reported zero findings/open items. Final head is now
The expanded native table, infra typecheck, formatting, and independent Codex P0–P2 delta review pass. The body and exact test allocation are current. Please review this final head; the earlier zero-item result is not being counted as final-head coverage. |
|
🦞👀 Re-review progress:
|
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
…6743) * fix: avoid full-history downloads during agent Git reads Prepare missing revision roots with negotiated blobless fetches before shared-clone content commands. Preserve offline probes and global options; stop rejected origin requests before any lazy full-history retry. Reuse shared-worktree detection and add native Git transfer regressions plus a rerunnable million-object fixture. * fix: preserve staged restore and path-only diff arguments Treat restore -S as a flag and skip revision preparation for diff --no-index. Native regressions prove that staged restores negotiate missing sources and hash-shaped filesystem paths do not trigger fetches.
What Problem This Solves
Fixes full-history downloads when an agent runs a Git content command naming a commit missing from a shared blobless clone, even when the clone already contains almost all of that history.
User Impact
Commands such as
git show <commit>:path, revision diffs, log, restore, checkout, and merge-base fetch missing commits with history negotiation before reading content. Existing offline probes remain offline. If origin cannot supply an object, the command stops with guidance to fetch from its owning remote rather than retrying through Git's expensive lazy-fetch path.The common present-commit path adds one offline batched object check and no network traffic. Measured Linux overhead is about 1.4 ms per command; macOS adds about 11.5 ms on the measured host. No configuration or migration is required. Absolute Git paths, aliases, and revisions supplied on stdin remain outside this preparation path.
Why This Change Was Made
Git's promisor fetch implementation forces noop negotiation, so repository configuration cannot make lazy fetches send local haves. Refreshing selected heads cannot cover arbitrary commit IDs. The existing agent Git shim now prepares revision roots at the command boundary, preserving Git's global options, normal content hydration, refs, and FETCH_HEAD. Unknown names and non-revision arguments remain Git's responsibility.
Runtime production growth is 93 lines for revision preparation and the missing-object fetch path. The existing global-option/query owner is reused; no cache, new dependency, or parallel fetch owner was introduced. The simplification pass removed unnecessary shell forks and duplicate shared-worktree detection. A scoped 138-line test allocation covers the real native-Git regression and argument/negative cases, including staged restore flags and path-only
diff --no-index.Evidence
Synthetic blobless clone with 126,357 commits and 884,499 trees: clone shallow, explicitly unshallow, create linked worktree, advance origin by one commit, then run the actual shim's
show <missing>:path. Five counterbalanced A/B and five A/A samples; final shell simplifications replayed candidate measurements against the unchanged graph.A/A wall drift: 3.2%. Linux present-command median/p95: 1.895/1.984 → 3.294/3.690 ms, CPU 1.5 → 3 ms, unchanged median RSS, zero fetched objects. Linux A/A drift −1.2%. macOS present median: 16.927 → 28.438 ms. CPU includes the local upload-pack server; RSS is not cumulative allocation, which was not measured. This native shell/Git path has no JavaScript allocation. Local file transport/APFS and Linux container controls do not claim production network/btrfs latency or simulate unrelated application databases.
Reproduce with
python3 scripts/perf/pr-worktree-fetch.py <new-proof-directory> --pairs 5 --aa-pairs 5 --baseline-shim <exported-base-shim> --candidate-shim <exported-candidate-shim>; the same committed workload has fixture-reuse and present-only modes.The native regression fails on base because
showretransfers existing history (17 objects versus a four-object bound). Owner suite: 2/2 tests passed, including the native command table (5.706s) and existing exec integration (8.551s); wrapper 54.74s including cold compilation. The final argument follow-up reran the expanded native table successfully (5.588s; wrapper43.31s); both new cases were red before their fixes. Final infra typecheck, scoped format/lint, and diff checks pass. Codex P0–P2 autoreview is scoped-clean for the complete candidate againstac7e941722ab32fcf019ef257fc52819fa71da07and the subsequent argument-only delta against940e263fb77ed78b3dfd35a284596e5bb94f00d6. Performance measurements above cover the latter head; the follow-up changes onlyrestore -Sanddiff --no-index, not the measuredshowpath. No Control UI imports of this owner were found.pnpm check:changedcompleted with a new test type error that was repaired and rechecked through the final infra typecheck, plus inherited Knip failures. The separate test-line ratchet also reproduces inherited debt. These are main regressions, not passing checks; this PR does not absorb their budget or hide their findings.Exact-parent inherited-failure attribution
On exact parent
ac7e941722ab32fcf019ef257fc52819fa71da07, the canonical deadcode checker reproduces the identical 28 production and eight full-tree unused-export findings. Inspected parent-relative source changes identify the unused exports or consumer cutovers:c7152f3bda8e5625945b7ae01d80ba593b8b14b56617cd000864f63e5cd0f6d38964fa991c0aff071f606eae7733d8f24c9926a7436c8b4a93bff59d099661d2b206bb0627ac2bcf1ae7bb6a729d85ebfe8daad4The exact parent has 6,629,308 test lines against ceiling 6,629,287: debt 21. #196680 /
3686da563c54738b11fac5c9a103ee8b3943b5e6added 28 lines without allocation, consuming seven lines of prior slack. Running the canonical ratchet on the exact parent against that introducing commit's parent reproduces exit 1, debt 21, delta +28. This PR allocates only its own 138 regression lines.Final-head CI 42858175123 reports the inherited ratchet debt at exact main parent
7f8a7f5094cda82c6eccd82fe618f68ba128229e: 6,632,310 test lines versus ceiling 6,632,292 (18 over), reproduced with the canonical checker on that exact parent. The tested merge adds this PR's balanced +138/+138, producing 6,632,448 versus 6,632,430. #196636 /b21829a4c85fand #196742 /543917c0d292remove one and two test lines respectively; the debt still originates in #196680. This is an unresolved main regression, not an increase caused by this PR.ClawSweeper reviewed final head
499cb1fd1e11be9ad02902b6b23b615c0bb8437dwith zero findings and zero open items. CodeQL Critical Quality passed its diagnosed API-rate-limit rerun. OpenGrep and CodeQL Security High encountered installation API rate limits during result upload; those infrastructure outcomes are tracked separately from the inherited test-line exception.