Repository navigation
fix: keep shallow sync finalization blob-filtered - #2854
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 SummaryThis 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 610370eb20
ℹ️ 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".
| ` + remoteGitOriginTransportFunctions() + ` | ||
| coherence_fetch() { | ||
| set -- --quiet --no-tags | ||
| set -- --quiet --filter=blob:none --no-tags |
There was a problem hiding this comment.
Keep sync working when Git fetch lacks filters
On a POSIX target running Git 2.18, this unconditional option makes every coherence fetch fail because that version's documented fetch options include --unshallow but not --filter. The shell converts this into exit 69, and gitOriginRuntimeFallbackResult does not classify the resulting unknown-option diagnostic, so an otherwise supported origin-based sync now aborts instead of falling back to plain-manifest sync. Please detect filter support or handle this diagnostic as a safe fallback without performing the problematic unfiltered history fetch.
Useful? React with 👍 / 👎.
| Finalization requests blob-filtered Git fetches, including when completing a | ||
| shallow repository left by workflow setup or a previous command. On origins | ||
| that support filtering, commit ancestry becomes available without downloading |
There was a problem hiding this comment.
Apply blob filtering to native Windows finalization
This statement is false for native Windows targets: syncWindowsNative still finalizes through windowsGitCoherence, whose fetch at internal/cli/sync_windows_target.go:264 has neither --filter=blob:none nor shallow-history completion. Consequently a native Windows workspace can still download all fetched blobs, and a shallow checkout does not gain the promised ancestry. Git documents that --filter=blob:none omits file contents until needed; mirror the filtering and shallow handling in the Windows finalizer, or scope the documented fix explicitly to POSIX/WSL targets.
Useful? React with 👍 / 👎.
|
Codex review: needs changes before merge. What this changesThis PR filters POSIX and WSL finalization fetches and clarifies recovery when a live remote child prevents workspace-owner release. Example: An incremental sync encounters a depth-2 checkout with substantial historical file contents.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 2 items remain Keep this PR open: it addresses excessive history downloads that remain on main, but needs a legacy-Git compatibility repair and narrower documentation. Priority: P2 Before merge
Findings
Agent review detailsHow this fits togetherThe Go CLI generates remote finalization scripts after workspace transfer; these fetch Git history, verify branch membership and tree identity, and publish sync completion under workspace ownership. flowchart LR
A[CLI run] --> B[Workspace owner]
B --> C[File transfer]
C --> D[Git finalization]
D --> E[Git origin]
D --> F[Verified workspace]
F --> G[User command]
Technical reviewBest possible solution: Keep filtered history completion, preserve plain-manifest recovery for incompatible Git clients, and document its POSIX/WSL scope. Do we have a high-confidence way to reproduce the issue? Main's unfiltered --unshallow fetch directly explains historical-blob downloads, and the author reports a controlled AWS reproduction; no target code was executed during this read-only review. Is this the best way to solve the issue? Filtering at the shared POSIX finalizer addresses the download mechanism while preserving full ancestry and ownership checks, provided incompatible clients retain safe recovery. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against e36baddc79ec. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
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 15, 2026, 4:44 AM ET / 08:44 UTC. |
Complete commit ancestry without eagerly fetching historical file blobs. Preserve owner fencing and fail-closed release semantics while distinguishing a witnessed live child from ambiguous transport state.
Factor the repeated hydration fetch invocation into one shell helper. Preserve every fallback and the existing 30000-byte witnessed-command limit.
8fa814f to
226941f
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 226941fee5
ℹ️ 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".
| if !opts.GitOverlay && !opts.PlainManifest && opts.HydrateGit && opts.BaseRef != "" { | ||
| refspec := "+refs/heads/" + opts.BaseRef + ":refs/remotes/origin/" + opts.BaseRef | ||
| script += `if exact_git_root && git remote get-url origin >/dev/null 2>&1; then | ||
| hydrate_fetch() { git fetch --quiet --filter=blob:none origin "$@"; } |
There was a problem hiding this comment.
Fall back when hydration Git lacks filtering
On a POSIX target running Git 2.18, a hydration-only sync (sync.gitSeed: false, so coherence is disabled while HydrateGit remains enabled) now sends every fetch attempt through this helper, and each fails on the unsupported --filter option. The trailing || true then reports a successful sync and records hydration metadata even though the repository was never unshallowed or updated; previously these fetches worked without filtering. The Git 2.18 fetch manual documents --unshallow but has no --filter option, so this path should detect filter support or retry hydration without it.
Useful? React with 👍 / 👎.
Finalization of an incremental sync can download full historical file contents after workflow setup or a command replaces Git metadata with a shallow checkout. Cancelling the local SSH client can leave that fetch alive remotely; owner release then correctly refuses the witnessed child, but previously described the known refusal as ambiguous state.
Keep both coherence and hydration fetches blob-filtered, including unshallow and fallback fetches. Full commit ancestry, advertised-branch membership, tree/index checks, claim fencing, and live-child takeover refusal remain intact. Distinguish a confirmed CHILD release refusal from transport ambiguity and explain waiting or stopping the lease before retrying on a fresh lease. There is no force path, protocol change, new configuration, or secret requirement.
This is separate from #2841, which addresses local object enumeration bounds before transfer.
Validation:
ok github.com/openclaw/crabbox/internal/cli 45.999s.go vet ./internal/cliand the candidate CLI build passed.610370eb(before the transport-size helper refactor) against reconstructed shallow metadata passed: finalize 64.111 seconds, workload exit 0, completed transaction markers, expected HEAD/index tree, full ancestry, matching file content, and zero remaining owner/child records.cbx_e08e185308abwas stopped and independently read back asreleased.8fa814fbb7e0c8297c26d2d896641b62db6217d7: https://github.com/openclaw/crabbox/actions/runs/38704375167. Other workflow checks remain pending at the latest read; no failures are reported on this head.The original reported leases were already released, so their process trees could not be recovered. The controlled shallow-history reproduction establishes the excessive-history-fetch mechanism rather than claiming a live capture of every original occurrence. Origins that ignore Git filtering may still download historical blobs.