Repository navigation
fix: avoid full-history downloads from Git revision expressions - #196784
Conversation
|
🦞👀 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 candidate |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesPrepare missing objects for Git rev-parse content expressions while preserving native revision, option, and path handling. Example: Python invokes git rev-parse with an origin-only commit and file.txt in a shared blobless clone.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR addresses a current Git-wrapper omission, and the earlier findings are resolved; no new actionable defect was found, while exact-head CI remains unsettled. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Gateway installs a PATH-based Git wrapper used by agent shell commands and inherited subprocesses; it prepares missing revision roots before forwarding the original arguments to native Git. flowchart TD
A[Agent exec command] --> B[Shell or Python subprocess]
B --> C[Git PATH wrapper]
C --> D[Offline native Git qualification]
D --> E[Existing negotiated fetch owner]
D --> F[Original native Git command]
E --> F
Technical reviewBest possible solution: Extend the existing wrapper with native Git qualification and ordered root acquisition, retaining the documented optional-default and newline limits. Do we have a high-confidence way to reproduce the issue? Current main omits ordinary rev-parse preparation, and the supplied native Git comparison reports unnegotiated history transfer for missing content expressions; no target code was executed during this review. Is this the best way to solve the issue? The patch uses the existing fetch owner and delegates revision-versus-path acceptance to Git, addressing the earlier regressions without adding persistent state or configuration. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0c5c4754c33d. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +63, Tests +64, Docs 0, Other +2. Total +129 across 4 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 (4 earlier review cycles)
Reviewed November 10, 2026, 2:37 PM ET / 19:37 UTC (Revision 5). |
|
Addressed item 1 on
The repaired owner suite passes 2/2, including all original blob/tree, PATH, base-root, linked-worktree, and offline controls. Independent Codex review of the staged candidate is scoped-clean through P2. Runtime remains +5 net lines; tests are +44 with matching scoped allocation. The first head's CI was green; new-head CI and repeated local checks are running. Native Git retains selection of optional defaults. An active missing @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cbb95a8b2b
ℹ️ 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".
|
Addressed both review rounds on
Final owner suite: 2/2 passed. Independent Codex review of the final staged candidate: scoped-clean through P2. Production remains +5 net lines. The body records the unchanged active-missing-default limitation and exact-parent attribution of unrelated dead exports. Prior-head green CI is not treated as final-head evidence. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Addressed all three review rounds on
Final owner suite: 2/2 passed. Independent Codex review of the final staged candidate: scoped-clean through P2. Linux synthetic present-tree/promised-blob reads add 1.596/2.749 ms median, exactly one extra Git process, no fetches, and unchanged peak RSS. The body includes CPU, A/A controls, fixture limits, necessary +63 production lines, and the documented native-handling limits. Prior-head CI is not used as final-head evidence. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
…claw#196784) * fix: negotiate missing Git revision expressions before reads * fix: preserve unused Git revision defaults * fix: preserve ID-only Git revision endpoints * fix: let Git identify revision path boundaries
What Problem This Solves
Follow-up to #196743: ordinary
git rev-parse <missing-commit>:pathand<missing-commit>^{tree}bypass revision preparation, allowing Git's noop promisor fetch to retransmit existing commit/tree history.User Impact
Explicit content expressions use the existing negotiated missing-object fetch before native Git runs. ID-only expansion, optional defaults, metadata queries, offline probes, and implicit path arguments preserve native behavior. No configuration or migration is required.
Why This Change Was Made
The command dispatcher omitted ordinary rev-parse. The wrapper now lets offline native Git qualify its positional expressions in one batch. Valid expressions need one extra Git process, including a path whose blob is deliberately absent. On a miss, expressions are handled in order: qualify, acquire only necessary traversal roots through the existing owner, then qualify again before considering later arguments. This preserves Git's implicit transition from revisions to paths, instead of reproducing that parser in the wrapper.
Python subprocesses already inherit the installed shim through the exported agent PATH. The shared base checkout already resolves the same common Git directory as linked worktrees. This PR proves those paths without adding installation or detection mechanisms.
Evidence
Each command-shape case uses a fresh explicitly unshallowed blobless clone with a registered linked worktree and an origin-only commit. Python cases run through the actual
createExecToolshell wrapper, a heredoc, andsubprocess.run(["git", ...]), with cwd at the base clone root.showandcat-file -p <sha>:pathalready negotiaterev-parse <sha>:pathrev-parse <sha>^{tree}cat-file -p <sha>:pathThe final owner suite passes 2/2. Native regressions also preserve unused defaults, ID-only two-dot endpoints and exclusions, mixed ID/content endpoints, three-dot traversal, implicit paths, invalid suffixes, empty arguments, and paths containing spaces. Before repair, the unused-default, two-dot, and implicit-path regressions each failed with an unnecessary rejected fetch. A missing-root/invalid-path case proves the wrapper stops before fetching a later unavailable object. Marker collision is covered.
Independent Codex review of the final staged candidate is scoped-clean through P2. Runtime delta is +63 net lines; regression delta +64, with an exact scoped allocation and shared fixture setup. Growth delegates argument acceptance to Git while preserving ordered acquisition; regular commands reuse their existing batched root checks and negotiated fetch. No persistent cache, new configuration, dependency, or UI import.
A separate network-disabled Linux fixture has 20,001 commits, 140,064 trees, and 62,000 metadata paths representing 1.116 GB of logical content. It is explicitly unshallowed, blobless, and shared with a linked worktree. No production data was used. Git 2.47.3, five counterbalanced 250-call batches per arm plus A2 controls:
HEAD^{tree}HEAD:pathwith promised blob absentBoth cases run one probe plus the original Git command, with zero fetches, unchanged packs, correct output, and the promised blob still absent. Added median cost is 1.596/2.749 ms; relative cost is +105%/+195%. A/A median drift is 0.290/0.088 ms, and tails are host-noisy; this is not a production btrfs latency claim. Minor faults rise about 195→392 and 190→388 per call. A separate Git-only allocator-interposition run measures cumulative requested allocation: tree 379→770 requests and 899,273→1,799,642 bytes; promised blob 313→719 requests and 218,515→1,169,478 bytes. Five counterbalanced 20-call batches plus A2 match exactly. The nine-entrypoint qualification probe passes (nine calls/549 bytes). This excludes shell allocations, mmap, and hidden libc paths; requested bytes are not live heap or RSS. The original million-object transfer proof from #196743 was reused, not repeated.
pnpm check:changedreports 33 production and 10 full-tree unused exports outside changed files. The canonical checker reproduces identical symbol sets on exact parent47b0ce478c8141b52ec4631b4ddbe3d8b018ff21(zero script findings). All other checks passed, including the final repetition. Five additional production/two full-tree entries originate in #196380 /37a3b162a0c58aaceb1634aaef726d0e178a529c; unchanged findings and source attribution are documented in #196743. These are reported main regressions, not passing checks or noise. Earlier heads' CI was green.Scope limit: optional
rev-parse --defaultvalues and invocations containing newline arguments retain native handling and can still lazy-fetch. This follow-up protects the requested explicit revision forms and does not claim universal Git argument coverage.Final-head CI run 42885010852, attempt 1, completed with one root failure: test-line ceiling in job 130071724878 (and aggregate 130077673436). CI tested merge
8b55bcb7f4425eeac0fdac47059e86ece31a27a4of maina693086999a4180f99a5b41555dcb70685b0312aand this head. The merged tree has 6,635,240 test lines / 6,635,112 ceiling: 128 over. Exact main reproduces 6,635,176 / 6,635,048: the same 128 over. This PR's +64 lines and +64 scoped allocation leave the inherited debt unchanged. All other selected CI jobs pass.The new main regression originates in #196346 /
b91520c16b620adf2222b6f9aa245d61b3e0d139: +138 counted test lines without a grant consumed 10 lines of available slack, leaving 128 debt. Earlier #196680 debt had already been cleared; it is not the cause of this failure. Landing uses the authorized inherited-failure exception with exact-head evidence, while retaining the failed CI result.ClawSweeper reviewed final head
fa0b3d4d91aff6676ff577ea81d3a2edc95bfb7awith zero open items and no actionable findings. All three prior items were addressed by number in the re-review response.