Repository navigation
Conversation
Replace auto incremental repack with bounded promisor-aware native batches so full MIDX repair cannot suppress consolidation. Preserve kept packs, local objects, missing promises, and reflog history under the existing repository mutation and maintenance owners. Reclaim old temporary packs through isolated Linux file leases that detect open users across UIDs. Retained files do not starve later cleanup. Synthetic partial-clone connectivity improved 1.84x after two bounded passes (2,002 to 2 packs). Remote tests, build, and static guards passed; the unrelated ClientVoiceToolEffect dead-export failure reproduces on main.
|
🦞👀 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 changesThe branch consolidates small Git packs in bounded batches and removes abandoned temporary packs on Linux while retaining files still in use. Example: Ordinary maintenance runs on the reported synthetic partial clone
Review scores
ProductKind: Performance · Worth it: Yes Merge readiness✅ Ready for maintainer review This PR remains useful: current main retains the ineffective consolidation path, and the reviewed patch has no concrete blocking finding. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherManaged worktrees are separate working directories that share a Git repository’s object storage. Their maintenance owner repairs object lookup and reduces accumulated pack files without fetching missing objects or expiring conversation worktree history. flowchart TD
A[Worktree cleanup pass] --> B[Shared repository mutation queue]
B --> C[Repair pack lookup]
C --> D[Inspect temporary files]
D --> E[Lease available and file unchanged]
E --> F[Remove abandoned files or retain busy files]
C --> G[Select bounded homogeneous pack batches]
G --> H[Publish replacement and rebuild pack lookup]
Technical reviewBest possible solution: Keep bounded consolidation in the existing repository maintenance owner, using native Git publication and conservative Linux lease-based temporary-file cleanup. Do we have a high-confidence way to reproduce the issue? Not applicable as a functional bug report; the supplied native-Git benchmark establishes the performance problem and improvement, while current main confirms the old maintenance ordering. Is this the best way to solve the issue? Yes: replacing the suppressed automatic task within the existing owner avoids another scheduler, preserves local-only operation, and limits destructive cleanup to files with verified custody. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against cfe61f23f927. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +222, Tests +122, Docs +4. Total +348 across 5 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 Reviewed October 8, 2026, 5:04 PM ET / 21:04 UTC. |
openclaw#167453) Replace auto incremental repack with bounded promisor-aware native batches so full MIDX repair cannot suppress consolidation. Preserve kept packs, local objects, missing promises, and reflog history under the existing repository mutation and maintenance owners. Reclaim old temporary packs through isolated Linux file leases that detect open users across UIDs. Retained files do not starve later cleanup. Synthetic partial-clone connectivity improved 1.84x after two bounded passes (2,002 to 2 packs). Remote tests, build, and static guards passed; the unrelated ClientVoiceToolEffect dead-export failure reproduces on main.
What Problem This Solves
Shared partial clones accumulate packs and abandoned temporary packs until fetch connectivity checks become impractically slow and disk use grows without bound.
A read-only large-clone snapshot found 4,719 packs / 246.60 GiB, including 4,701 promisor packs, plus 198 temporary packs / 79.86 GiB. Of those temporary packs, 175 / 76.31 GiB were older than 24 hours. Root inspection found no open users at that instant. The filesystem is Btrfs with kernel file leases enabled; no production files were changed or leased.
User Impact
The next ordinary worktree maintenance pass consolidates eligible small packs and reclaims abandoned temporary packs on Linux. Kept packs, locally available objects, promised missing objects, and reflog history remain intact. No configuration or schema migration is required.
The first pass processes at most 1 GiB of source pack bytes across the two pack classes, plus replacement writes and MIDX metadata, rather than rewriting the observed 246.6 GiB repository. Temporary files are unlinked without reading their contents. Expect seconds to a few minutes for the small-pack tail, with a five-minute budget per packing batch plus existing metadata budgets; this is an estimate, not a production timing. Production effects and timings await a separate deployment.
Why This Change Was Made
Repairing the complete MIDX immediately before automatic incremental repack makes Git's trigger see zero unindexed packs. Replace that ineffective task with native streaming consolidation: separate promisor/ordinary groups, at least 16 eligible packs, at most 1,024 source packs and 512 MiB per group. Git publishes the replacement and expires redundant sources through a batch-only MIDX before rebuilding the complete index. Packing uses one thread per process, low CPU priority, and idle I/O priority where available. The existing repository mutation owner serializes fetch and MIDX repair around the operation.
An unprivileged
fusercensus can silently miss another user's open files. A disposable Linux helper instead acquires an exclusive kernel file lease and rechecks identity and timestamps before removing a temporary pack older than 24 hours. Busy files and unsupported lease operations are retained. Each pass removes at most 256 files; retained entries do not consume the removal budget. Other platforms retain temporary files.Production LOC is +222 net (254 added, 32 removed). Growth is required for the input-byte/count limits, promisor-safe publication on older Git, and cross-user cleanup custody. The old automatic incremental-repack path is removed; there is one consolidation path and no new maintenance scheduler or cache.
Evidence
A real filtered synthetic clone contained 36,001 local objects and one deliberately missing promised object. Nine warmed samples used the exact fetch connectivity command,
git rev-list --objects --stdin --exclude-promisor-objects --not --all, on Linux/Git 2.55.0:Overall connectivity improved 1.84×. The passes took 1.87 s and 2.04 s; pack bytes fell from 27.88 MiB to 18.12 MiB. Every pass preserved the complete local-object inventory and missing-object set, passed MIDX verification and connectivity fsck, and made zero fetch attempts. Maintenance RSS includes TypeScript harness startup: 384.3 MiB baseline versus 393.9/389.6 MiB for the two passes; pack data streams between native children.
Blacksmith Testbox proof:
tbx_01m4ef4gchahw1q2k3g2p5xhd4: benchmark; initial 11-test focused suite (37.81 s cold); both new regressions fail on the original owner; core types and all 27 dependent test graphs pass, including the follow-up for the review correction.tbx_01m4egetas7hktg5dt7at2a32n: full worktree/runtime siblings, 602 passed / 33 skipped, 54 files passed / 6 skipped, 796.11 s; export collisions and 20 closure tests pass;pnpm buildpasses in 305.5 s and emits the cleanup worker. The final new cases took 455 ms and 200 ms in the sibling run. Restoring the old cleanup budget makes the starvation regression fail; the candidate bytes were restored afterward.The changed gate has one pre-existing failure:
ClientVoiceToolEffectis an unused export in untouchedsrc/talk/client-voice-session-store.ts. Fully installed, unchanged main at8879e5ef4b98e7ff17b0ac04e7695f66f3e143b2reproduces the identical production/full-tree findings withnode --import ./scripts/tsx.mjs scripts/check-deadcode-exports.mts. This prepublication local failure is recorded as inherited; it is not reported as a passing scan.After the long-lived Testbox expired and AWS/Hetzner both refused new leases at the broker's fleet limit, the remaining checks ran on an isolated Linux rig with the staged patch pinned to the same base. Final formatting, line-cap, and all remaining static guards passed:
Final-source focused rig proof passed 11/11 tests in 54.51 s Vitest / 57.63 s wall time with
--maxWorkers=1. An initial rig replay exposed fixture discovery escaping into the outer checkout because the required TMPDIR is inside it; original HEAD reproduced that failure. SettingGIT_CEILING_DIRECTORIESto the same TMPDIR isolates the fixtures and restores the expected 30 cold / 0 warm Git-call counts without changing source. All five final source hashes match. The build also emitted a nonfatal UI startup-gzip audit warning (365.2 KiB versus 364.7 KiB); no unchanged-main attribution was performed for that warning. All new production behavior awaits deployment; no live clone mutation was used as proof.Final publication: CI run 37843346957 passed for the exact published head, and squash auto-merge completed at
69e38767e7fe6d57346ab507908a4aa65c51cd37with all required checks green. No admin exception was needed. The maintenance file’s 11 CI cases passed in 17.736 seconds of test time; the added cases took 0.528 and 0.162 seconds. The landed tree was verified against the reviewed head merged onto its actual main parent.