Repository navigation
fix: stop downloading completed workspace content batches again - #197251
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. |
|
Codex review: needs maintainer review before merge. What this changesThis PR avoids downloading completed Git content batches again while preserving missing-object hydration. Example: A second preparation replays a captured batch of 85 objects after another preparation completes it.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review The prior wrapper-inventory blocker is fixed, and no actionable defect remains in the reviewed patch; exact-head CI is still running. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherManaged worktree preparation, snapshot retirement, and GitHub publication supply missing object IDs to Git hydration, which fills the shared object store before checkout or snapshot processing. flowchart TD
A[Workspace preparation] --> C[Missing object inventory]
B[GitHub publication] --> C
C --> D[Existing isolated transport]
D --> E[Native Git noop negotiation]
E --> F[Shared object store]
F --> G[Checkout or snapshot]
Technical reviewBest possible solution: Retain command-local noop negotiation through the existing isolated transport, source admission, and publication authentication owners. Do we have a high-confidence way to reproduce the issue? Current-main source forces refetch of captured missing-object lists, and the supplied native Git campaign demonstrates repeated transfer; no target code was executed during this read-only review. Is this the best way to solve the issue? The patch removes forced replay without adding a cache, shares existing transport preparation, and preserves the missing-content invariant that motivated the original refetch behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 83fd655f3fac. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +27, Tests +13, Docs 0, Other +4. Total +44 across 8 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 (1 earlier review cycle)
Reviewed November 11, 2026, 10:12 AM ET / 15:12 UTC (Revision 2). |
|
Addressed the before-merge item on
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…claw#197251) * fix: skip completed workspace content downloads * test: observe hydration writer admission at its queue * fix: include hydration transport in PR runtime inventory
Prevent large shared clones from exporting every Git config entry into isolated hydration process environments. Preserve selected transport policy in a private temporary config file with fixed environment overrides and existing cleanup ownership. Regression provenance: #195505 introduced the environment transport; #197251 routed content hydration through it. Real 20k-config Gateway and native review-init regressions fail E2BIG before the fix and pass on the final head. Synthetic 62k-path proof reduces fetch environment bytes from 1,827,626 to 10,954; all five candidate hydrations succeed. Codex autoreview and final-head ClawSweeper: no actionable findings. Native CI: 17 passed, two platform skips; large-config case 20.022s. All applicable type/lint/docs/security checks pass. The sole CI red is inherited test-line debt 25, reproduced on exact main parent c7962d6 and introduced by #197543 (3b13df5); this PR's 44 test lines have 44 allocation. Explicitly authorized maintainer bootstrap fallback: SHA-pinned synchronous REST squash via protected gh, because the main-anchored native bootstrap is broken by this bug. No native review/prepare success receipt is claimed. Real shared-clone review-init verification follows official-main publication.
…97593) Prevent large shared clones from exporting every Git config entry into isolated hydration process environments. Preserve selected transport policy in a private temporary config file with fixed environment overrides and existing cleanup ownership. Regression provenance: openclaw#195505 introduced the environment transport; openclaw#197251 routed content hydration through it. Real 20k-config Gateway and native review-init regressions fail E2BIG before the fix and pass on the final head. Synthetic 62k-path proof reduces fetch environment bytes from 1,827,626 to 10,954; all five candidate hydrations succeed. Codex autoreview and final-head ClawSweeper: no actionable findings. Native CI: 17 passed, two platform skips; large-config case 20.022s. All applicable type/lint/docs/security checks pass. The sole CI red is inherited test-line debt 25, reproduced on exact main parent dc5e7b7 and introduced by openclaw#197543 (97741b2); this PR's 44 test lines have 44 allocation. Explicitly authorized maintainer bootstrap fallback: SHA-pinned synchronous REST squash via protected gh, because the main-anchored native bootstrap is broken by this bug. No native review/prepare success receipt is claimed. Real shared-clone review-init verification follows official-main publication.
What Problem This Solves
Fixes repeated downloads when another workspace preparation has already completed a captured batch of missing Git objects. Related: #197229, #197081, #196854.
User Impact
Completed hydration batches no longer download the same objects again. Missing promised blobs and trees still hydrate, including two-round treeless checkout preparation. Mixed batches can still retransmit their already-present members; this is not complete per-object deduplication.
Why This Change Was Made
Replace forced refetch with command-local no-op negotiation, matching Git's native promisor transport. Commit acquisition still negotiates normally. Merely deleting refetch restores unrelated session-ref scans, so hydration borrows the existing ref-isolated transport and configuration projection. It keeps source-repository writer admission and live cancellation/revocation checks. Publication retains a durable promisor URL before borrowing the object store. The worktree and publication paths preserve their distinct authentication and execution boundaries.
There is no new persistent cache, clone, schema or OpenClaw configuration option. Runtime growth is 27 lines, plus two packaging-inventory entries: sharing existing transport preparation and preserving source admission costs more than the flag substitution. Publication itself shrinks by two lines. The existing Linux abandoned-pack cleanup is unchanged: mtime older than 24 hours, exclusive file lease, unchanged inode/size/timestamps, bounded removal. Age is not a substitute for proving that no fetch holds the file open.
Evidence
The writer-admission regression now observes the actual queue admission, rather than an earlier Git-directory lookup. The existing native capacity fixture now replays its captured missing-OID list; both cases fail on the unchanged parent by sending repeated wants. Current-source proof includes publication blob and treeless hydration, preservation of unrelated-ref scan avoidance, source writer admission/cancellation/revocation, and a real snapshot retirement through its HEAD caller. Cumulative focused proof covers 125 unique cases. Two intermediate candidates failed the unrelated-ref and admission regressions; both causes were fixed, with affected cases rerun. The original assertions remain intact.
Independent native Git 2.56 proof: two missing blobs transfer 134 bytes in either mode; a satisfied replay transfers 134 bytes with refetch and zero with noop. A missing tree transfers 111 bytes, followed by the same 134-byte blob batch. A mixed present/missing batch still transfers both blobs. All cold cases transfer zero commits. Fetch flags alone cannot establish whether an incident's received pack repeats history: the stdin OIDs and pack object types are required.
Performance acceptance was recorded before running the existing committed owner workload: reuse the synthetic 62,000-path / approximately 1.14 GB logical / 600,000 historical-blob / 13,000-ref / 1,503-pack fixture; five serial counterbalanced A/B pairs and five A/A controls per 85- and 58,523-object batch. Each sample hydrates and repeats the same captured list. Require initial content completion and identical required objects, zero replay transfer, reduced replay cost and no unexplained >20% regression. Use
scripts/perf/worktree-hydration-refetch-measure.pywith the parent's savedobject-hydration.ts; raw wall, native CPU/RSS and Node allocation receipts are emitted. Local Apple Git 2.54, Node 26.12.1, file transport; no production network, Linux/btrfs or large session-DB latency claim. The Git owner does not read the session database.Across initial hydration plus replay, transferred objects fall 170→85 (small) and 117,046→58,523 (large). Native CPU falls 47% and 42%; all replays transfer zero objects. The large first hydration is 5.8% slower and pair JS CPU/V8 allocation rise 16.4%/17.2%, reflecting extra transport preparation; peak native RSS halves. This is a bounded tradeoff for eliminating duplicate transfer and unrelated-ref scans, not a universal latency improvement. Five samples per arm make p95 the maximum. A/A wall drift stays below2.4%. This is a shared-host measurement; early small samples overlap local verification work. Apple Git Trace2 provides object counts but no pack-byte event, so the script's absent-byte-event zeros are not interpreted as zero transfer. Independent wire capture proves the satisfied-replay result.
Codex autoreview is scoped-clean through P2. The changed runtime modules have no Control UI imports. Final line-cap, targeted regression, type, lint, format and exact scoped 13-line test-budget checks pass.
pnpm check:changedwas run and is not claimed green: it caught an owned line-cap violation, fixed and rechecked; its other failure is the dead-export scan. The exact parent f5d0c19 reproduces the identical 57 production / 33 full-tree / 1 script findings. Newly identified main regression: unused ACCEPTED_REFRESH_STATUSES, introduced by #197189 / 6a5ac74; all continuing findings retain the earlier lane's causal attribution. The first exact-head CI run43040573035 failed because the extracted PR tooling inventory omitted two newly imported runtime modules. This PR-caused packaging error was reproduced locally and corrected in the existing inventory; all 23 closure checks and 16 provisioning cases pass locally. The final macOS-only multi-sibling case exceeded its default 120-second budget (245 seconds observed); that case passed all assertions when replayed alone with a diagnostic 600-second budget (503.663 seconds, 516.51 seconds overall). The original timeout is retained as a local proof limitation; no default-budget pass is claimed. No failed PR CI has been relabeled inherited.