Skip to content

fix: stop downloading completed workspace content batches again - #197251

Merged
steipete merged 3 commits into
mainfrom
fix/2410-hydration-present-objects
Nov 11, 2026
Merged

steipete merged 3 commits into
mainfrom
fix/2410-hydration-present-objects

Conversation

@steipete

@steipete steipete commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

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.py with the parent's saved object-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.

Shape / metric Before median / p95 After median / p95 A/A median drift
small / initial_ms 2903.597 / 3128.806 2558.656 / 3275.036 -1.42%
small / replay_ms 1302.865 / 2966.083 202.831 / 530.052 -0.65%
small / pair_ms 4122.542 / 6094.892 2770.069 / 3510.382 -2.37%
small / native_cpu_ms 4810.000 / 5600.000 2530.000 / 3630.000 -2.21%
small / js_cpu_ms 254.720 / 489.418 253.193 / 377.979 -0.36%
small / v8_allocated_mib 73.066 / 73.379 84.165 / 88.143 +4.25%
small / native_peak_rss_mib 65.234 / 67.547 48.984 / 65.500 -1.96%
large / initial_ms 7241.007 / 7659.550 7662.666 / 8146.798 -1.69%
large / replay_ms 3462.546 / 3507.214 2156.539 / 2189.795 -2.11%
large / pair_ms 10708.307 / 11166.766 9796.252 / 10336.597 -1.34%
large / native_cpu_ms 20010.000 / 21560.000 11610.000 / 12000.000 -3.10%
large / js_cpu_ms 183.649 / 192.487 213.772 / 220.816 +4.08%
large / v8_allocated_mib 93.177 / 96.674 109.172 / 115.863 +9.83%
large / native_peak_rss_mib 146.844 / 147.500 71.406 / 71.453 -0.59%

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:changed was 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.

@clawsweeper

clawsweeper Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T14:41:44.539620Z 1394085 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime agents Agent runtime and tooling size: S labels Nov 11, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 11, 2026
@clawsweeper

clawsweeper Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This 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.

  • Before: The replay downloads all 85 objects again.
  • After: The replay transfers zero objects.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The focused implementation and corrected packaging are supported by sufficient native Git owner proof with explicitly bounded environment coverage.
Proof confidence 🦐 gold shrimp (3/6) Sufficient (live_output): The PR supplies actual hydrateCommitObjects measurements using native Git and file transport, with completed replays transferring zero objects, plus native publication, treeless hydration, cancellation, revocation, and snapshot-caller coverage; reported macOS provisioning timeout coverage remains bounded.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Workspace preparation downloads content again after another preparation has already supplied the entire captured batch.
Reason: The maintainer-authored direction removes demonstrated duplicate work and explicitly accepts measured transport-preparation costs; mixed-batch per-object deduplication is outside the stated fix.

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
Reviewed head: c98c9c8a41ae254e5dc1251b11f268ece0a232a4

Before merge

None.

Findings

None.

Agent review details

How this fits together

Managed 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]
Loading

Technical review

Best 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

  • Explicit missing-object hydration changes intended behavior with a stated reason (fix(worktrees): avoid incomplete partial-clone fetches #150909: Forced refetch prevented shared commits from standing in for locally missing promised contents.)
  • Ref-isolated worktree transport keeps the original intent (43dae0b: Temporary Git metadata avoids unrelated session-ref scans while retaining shared storage, shallow boundaries, and source-ref publication.)
  • Authenticated transport configuration keeps the original intent (ff392db: Resolve conditional configuration in the original transport and preserve the selected identity and live execution guards.)
  • Publication promisor registration and filtered hydration keeps the original intent (9623635: Fetched content needs promisor markers and durable remote registration, including when missing trees reveal additional blobs.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 43dae0b adds src/agents/worktrees/base-fetch.ts:134 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 43dae0b46f1e; files: src/agents/worktrees/base-fetch.ts)
  • Patrick Erichsen: Raw commit ff392db adds src/agents/worktrees/base-fetch.ts:145 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: ff392dbeb06b; files: src/agents/worktrees/base-fetch.ts)
  • RoboClaw: Raw commit a583332 adds src/agents/worktrees/object-hydration.ts:42 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: a583332bd0a1; files: src/agents/worktrees/object-hydration.ts)

PR surface

Source +27, Tests +13, Docs 0, Other +4. Total +44 across 8 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 3 76 49 +27
Tests 2 30 17 +13
Docs 1 1 1 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 4 0 +4
Total 8 111 67 +44

Preflight source

Source 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

Metric Value Why it matters
Production versus test growth Production +27 lines; tests +13 lines Necessary growth reuses transport preparation and preserves source admission; tests extend existing native Git fixtures for distinct worktree and publication boundaries.

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.
  • remove merge-risk: 🚨 automation: Current PR review selected no merge-risk labels.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: Repeated hydration wastes network transfer and workspace preparation work within a bounded partial-clone subsystem.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-11-11T14:54:21.996Z sha 1394085 :: needs changes before merge. :: [P1] Include the new hydration dependencies in the wrapper inventory

Reviewed November 11, 2026, 10:12 AM ET / 15:12 UTC (Revision 2).

@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Nov 11, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Addressed the before-merge item on c98c9c8a41ae254e5dc1251b11f268ece0a232a4:

  1. Include the new hydration dependencies in the wrapper inventory (P1): added base-fetch.ts to the extracted runtime inventory and git-object-store-transport.ts. The original import-closure regression reproduced locally; all 23 closure checks and 16 provisioning cases now pass. The final macOS-only multi-sibling case exceeded its default time budget and is being replayed alone with a diagnostic 600-second budget; it is not being called a default-budget pass. Independent Codex review of the two inventory entries is clean through P2. Fresh exact-head CI is pending.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 11, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 11, 2026
@steipete
steipete merged commit 50513cd into main Nov 11, 2026
158 of 161 checks passed
@steipete
steipete deleted the fix/2410-hydration-present-objects branch November 11, 2026 15:23
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 12, 2026
…claw#197251)

* fix: skip completed workspace content downloads

* test: observe hydration writer admission at its queue

* fix: include hydration transport in PR runtime inventory
steipete added a commit that referenced this pull request Nov 12, 2026
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.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 13, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant