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. What this changesThe branch repairs missing Git ref-tip objects during managed fetches and conservatively reclaims abandoned origin-tracking locks. Example: The user starts a worktree from origin/main in a clone with missing commit-graph tips.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR retains useful recovery work absent from current main. Both prior findings are addressed, and the current review found no additional blocking defect. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherManaged worktrees give agent sessions isolated repository checkouts. Their Git and project-refresh owners fetch repository objects and publish remote-tracking refs before checkout preparation. flowchart TD
A[Worktree or project refresh] --> B[Owned Git operation]
B --> C{Missing ref-tip failure?}
C -->|No| D[Return normal result]
C -->|Yes| E[Inventory refs and protect local work]
E --> F[Repair eligible locks and missing objects]
F --> G[Retry fetch and publish protected refs]
Technical reviewBest possible solution: Keep bounded recovery in the shared Git owner while preserving isolated project transport, local refs, and current checkout authority. Do we have a high-confidence way to reproduce the issue? Yes: the real-Git fixture removes ref-tip objects after writing a commit graph and exercises worktree selection, project refresh, and pinned-commit fetch. The supplied runs report failures before repair; this read-only review did not execute them. Is this the best way to solve the issue? Yes: persistent missing objects require repair rather than another transport retry, and the patch keeps recovery within existing Git and checkout owners. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against bf8dfb376939. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +500, Tests +475, Docs +19, Other +2. Total +996 across 8 files. Added test files: 2. View PR surface stats
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 October 8, 2026, 7:28 PM ET / 23:28 UTC (Revision 2). |
Recover broken shared-clone fetches in the existing Git owner with bounded physical-tip hydration and safe origin tracking-ref pruning. Preserve local refs, worktree HEADs, caller authority, and uncertain native-process outcomes; retain unsafe-to-reclaim locks with visible diagnostics.
Admit the current default-branch fetch refspec and carry protected ref facts into project publication. Use non-dereferencing publication writes, cover both production flows, and keep Linux-native lock tests on Linux.
d7a77db to
f265b73
Compare
|
Addressed both findings in f265b73 after rebasing onto current main. Recovery now admits the default-branch owner's canonical refspec without accepting arbitrary option values as remote authority. The repair owner's protected-ref facts survive staged project fetch and final publication, and publication uses command-wide no-dereference. The prior implementation failed all four integration regressions; the corrected candidate passed all 19 recovery cases, eight Linux lock cases, 93 current Git/project siblings, both wrapper closure suites, and the complete changed-file gate on AWS lease @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
…#167473) * fix(worktrees): heal fetches with missing commit-graph tips Recover broken shared-clone fetches in the existing Git owner with bounded physical-tip hydration and safe origin tracking-ref pruning. Preserve local refs, worktree HEADs, caller authority, and uncertain native-process outcomes; retain unsafe-to-reclaim locks with visible diagnostics. * fix(worktrees): retain recovery protections through publication Admit the current default-branch fetch refspec and carry protected ref facts into project publication. Use non-dereferencing publication writes, cover both production flows, and keep Linux-native lock tests on Linux.
What Problem This Solves
Fixes shared project clones that repeatedly fail to fetch because their commit graph still contains ref tips whose objects are missing. This can leave worktree creation using stale cached refs or prevent project refresh entirely.
User Impact
Worktree origin fetches and managed-project refreshes attempt one bounded repair. Recovery preserves local branches, tags, and worktree HEADs, respects dry-run and explicit no-prune requests, and records an actionable warning when it cannot finish. No OpenClaw configuration or state migration is required.
Why This Change Was Made
The existing Git owner inventories physical tips without lazy fetching or replacement lookup, prunes only safe obsolete origin tracking refs, and fetches missing objects by ID without ref updates, configured pruning, or automatic maintenance. Admission accepts the current default-branch owner's canonical origin refspec without mistaking option values for remote authority. Caller authority and isolated, URL-pinned project transport remain in force.
The repair owner carries protected-ref facts through project refresh's final publication. Both pruning and publication use command-wide no-dereference, so replacing a tracking ref with a local-branch alias cannot delete the local branch. Existing symbolic dependencies and linked-worktree HEADs retain their tracking targets.
Empty native Git locks have no PID. Reclamation uses the existing cross-process file-lock owner and requires an unchanged empty lock on a supported local Linux filesystem whose inode predates the current boot by at least one hour. Same-boot and otherwise uncertain locks remain for operator inspection. The native lock tests run only on Linux, matching this contract.
Production LOC: +500, plus two wrapper inventory entries. Growth implements the previously absent recovery contract, bounded inspection, safe publication, and positive stale-owner proof. There is no persistent health cache or new configuration. Healthy fetches do not perform recovery inventories.
Evidence
Heavy validation ran on AWS Crabbox after the configured Blacksmith Testbox lease stayed queued. No local test suites, builds, or typechecks ran on the development Mac.
cbx_62440e921102: all three entry-point regressions failed before the fix. The candidate recovered the exact native exit-128 failure; 745 worktree/project/Git sibling tests passed, with 34 platform-specific skips. Export-name and CI test-plan guards passed.cbx_ddbe1ea36620andcbx_9f86f101d8caruns proved lock ownership, replacement handling, pruning configuration, dry-run forms, wrapper closure, and all 27 core-test typecheck graphs. Main's unrelated unused-export defect was incorporated by rebasing onto d76f6ec, not copying it. A deliberately weakened no-dereference variant deleted a synthetic local branch and failed the race test as intended.cbx_3c2313a41161, public base 6ae2aee, candidate tree26e251012baf: the prior implementation failed all four new checks, then the corrected candidate passed 19 recovery tests, eight Linux lock tests, 93 current Git/project siblings, and all 20 wrapper closure assertions. Recovery took 95–130 ms. The recovery file took 4.455 s test time / 27.39 s wall time; the lock file took 0.114 s test time / 3.78 s wall time, usingpnpm test <file> --maxWorkers=1.Hosted CI run 37859157197 passed on
f265b7392960in 630 seconds overall. Its recovery file passed 19 cases in 4.422 seconds and its Linux lock file passed eight cases in 0.094 seconds. Fresh ClawSweeper review has no findings.Independent review is scoped-clean through P2. The complete changed-file gate passed, including core types, all 27 core-test typecheck graphs, lint, export scanning, runtime import cycles, and the state/schema guards. Measurements use small local Git fixtures; production-network latency remains unmeasured. No live Gateway or production clone was modified.