Repository navigation
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. Reviewed October 6, 2026, 8:34 PM ET / October 7, 2026, 00:34 UTC (Revision 3). ClawSweeper reviewWhat this changesBackground pull-request statistics check local Git blob availability before calculating counts, avoiding expensive missing-object scans while preserving older Git behavior. Merge readiness✅ Ready for maintainer review The PR remains useful: current main lacks the missing-blob admission check, and the supplied production-path evidence supports the optimization. No blocking correctness or security findings remain. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway reads checkout facts through its Git worker to populate session pull-request indicators in the Control UI. Those reads produce branch eligibility and approximate change counts, using the existing revision cache and refresh lifecycle. flowchart TD
A[Session PR indicators] --> B[Checkout facts cache]
B --> C[Git worker]
C --> D[Local blob availability]
D -->|Available or older Git| E[Native Git statistics]
D -->|Missing blobs| F[Unavailable statistics]
E --> G[Branch facts returned]
F --> G
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +50, Tests +46, Docs +2. Total +98 across 4 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep blob admission in the existing statistics owner, preserving native counts, older Git hydration, and the established refresh lifecycle. Do we have a high-confidence way to reproduce the issue? Yes: the inspected partial-clone regression exercises the real Git worker and detects implicit fetching before explicit hydration. The PR reports a failing-before/passing-after run; this reviewer did not execute it. Is this the best way to solve the issue? Yes: admission in the existing statistics owner avoids the expensive missing-object path while leaving native line counts, cache ownership, and older Git behavior intact. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0288eb1f3692. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
…inant-on-team-20260919
What Problem This Solves
Background PR statistics can repeatedly occupy a Git worker for 120 seconds when a partial clone is missing changed blobs. Git's failed-fetch path scans every promisor pack, even with lazy fetching disabled; a healthy multi-pack-index does not prevent it.
User Impact
On Git 2.45+, unavailable working-tree statistics return promptly without implicitly fetching missing blobs. Once the checkout materializes those blobs, the existing refresh path returns normal statistics. Ancestry checks and explicit diff/checkout operations retain their behavior. Older Git retains its native hydration behavior.
Why This Change Was Made
The existing statistics owner admits locally available blob inputs using a NUL-delimited raw diff and one batch object check before calling native shortstat. Git still owns rename, binary, conflict, and line-count semantics. The existing revision cache and five-minute fallback remain unchanged; no new configuration, schema, cache, or concurrency owner is introduced.
Production LOC is +50. This growth is required to avoid Git's expensive missing-object failure path while preserving native statistics and the Git versions shipped with documented Ubuntu/Debian installations. There is no superseded cache or scheduling machinery to retain or remove.
Evidence
Read-only diagnosis found repeated two-command PR-facts reads spending about 120 seconds inside Git with no queue wait. A sampled comparison needed eight unavailable blobs. Raw metadata plus local availability checks took 26 ms; disabling lazy fetching on shortstat alone still exceeded a 10-second diagnostic cap.
Blacksmith Testbox
tbx_01m499p4phk0556smaebp0ba2d(openclaw-check): synthetic project with 700 worktrees, 55 overlapping promisor packs, 1,543,080 packed entries; ten active worktrees and ten concurrent readers each. Cold-inclusive comparison: 6.197 s → 3.425 s (44.7%), with identical PR facts. Steady state: 3.392 s → 0.341 s (90.0% less worker-path wall time), with identical unavailable-statistics facts. Process RSS was 428.1 MiB → 416.3 MiB (not a subprocess peak). With all blobs present, identical complete statistics cost 0.368 s → 0.524 s, or about 16 ms extra per refreshed worktree; unchanged cache hits still spawn no Git.The regression uses a real partial clone, verifies no implicit fetch on supported Git, explicitly hydrates the missing blob, and then verifies the exact +1/-1, one-file statistics. The regression fails on the original code, which implicitly fetches the blob, and passes on the fix in 0.506 s.
node scripts/run-vitest.mjs src/infra/git-worker.lifecycle.test.ts src/gateway/control-ui-session-prs-branch.test.ts src/infra/git-read-cache.test.ts --maxWorkers=1: 88 tests pass, 107.59 s wrapper wall time. The existing 55-case real-repository branch suite took 94.75 s including worker preparation; the infrastructure group took 10.24 s. This suite owns native Git rename, binary, conflict, replacement-ref, and refresh semantics, which cannot be established by command mocks. Independent Codex review is scoped-clean through P2, with no accepted/actionable findings.node scripts/check-changed.mjs --staged: passed, including all 27 test type graphs, core types, dead-code scans, lint (zero warnings/errors), and repository guards. The final healthy-rig-plus-gate command took 26m53s. All heavy validation ran on the named Testbox at basecc7e664dfe34; its lease is stopped. The publication rebase onto two unrelated main fixes preserves the identical patch (verified with range-diff); GitHub CI covers the published head. No production deployment or repository repair was performed.Published-head CI
CI run 37521512105 at
b385b41da921: all selected code/test/type/lint/docs jobs passed. The six selected Node jobs took 44–233 seconds each (whole-job time including setup).CI remains blocked by the unchanged production lockfile's MCP client 2.0.0 and SDK 1.30.1, reported under GHSA-6qxp-vccf-f47h; the advisory fixes are client 2.2.0 and SDK 1.31.0. Current main has the same dependency versions, and this PR changes no manifest or lockfile. The fail-fast monitor separately hit GitHub HTTP 500 while attempting cancellation. An earlier labeler HTTP 500 was reconciled and its failed-job-only retry passed. No product failure was retried or hidden.
The dependency repair needs its own approved change; this performance PR stays scoped. No production deployment has been performed, so production savings remain unverified.