Repository navigation
fix(pr): avoid acceleration setup in native worktree entry - #150900
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. Reviewed September 17, 2026, 8:54 AM ET / 12:54 UTC. ClawSweeper reviewWhat this changesThe PR defers acceleration configuration loading until managed checkout allocation and separates shell worktree tests from allocator coverage while strengthening stale-branch assertions. Merge readiness✅ Ready for maintainer review This remains a useful, focused fix: inspected main still eagerly imports configuration on native provisioning paths. No actionable correctness or security defect was found, and the maintainer-authored PR is protected from cleanup closure. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s PR tooling provisions isolated Git worktrees for review, preparation, and merging. The provisioner checks operation ownership and repository policy, then selects native Git or managed source-cache allocation. flowchart TD
A[PR review or preparation] --> B[Worktree entry]
B --> C[Validate lock and allocation lease]
C --> D{Native Git required?}
D -->|Yes| E[Native Git checkout]
D -->|No| F[Load acceleration policy]
F --> G[Managed checkout]
E --> H[Verify checkout identity]
G --> H
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +30, Other +3. Total +33 across 3 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep native provisioning independent of unused configuration startup while retaining the shared allocator, existing acceleration preference, and live ownership checks. Do we have a high-confidence way to reproduce the issue? Yes for the unnecessary import: current main loads configuration before selecting native Git, and the added import guard targets that path. The host-dependent timeout was reported in the PR but was not independently reproduced during this read-only review. Is this the best way to solve the issue? Yes. Moving the existing import to its sole consumer is a narrow repair, and dedicated production-boundary coverage supports removing allocator startup from the separate shell tests. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against f87c65300767. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
…150900) Avoid spurious PR worktree-entry lock-shell timeouts caused by loading unused acceleration configuration on native Git paths. Load the existing acceleration policy only before managed allocation, then revalidate operation ownership after the dynamic import. Preserve native hooks, sparse checkout, Git registration and stale-branch reset behavior. Keep the shell fixture focused on the existing allocation seam while dedicated provisioner tests retain real allocator coverage. No timeout budgets or configuration options change. Validation: exact-head CI run 35223020951 passed for 212e079 with zero pending checks; the authorized Codex review and exact-head ClawSweeper review found no actionable defects.
What Problem This Solves
Fixes spurious 10-second lock-shell timeouts when PR worktree entry also runs the full shared allocator. The added allocator cost came from #149585; a timed-out child reports
status: nulleven when worktree creation is progressing normally.User Impact
Native-Git provisioning avoids loading acceleration configuration it does not use. The shell tests retain their existing deadline and real Git registration, stale-branch reset, sparse-checkout, and lock assertions. Dedicated provisioning tests continue to exercise the real allocator.
Why This Change Was Made
Load the existing
worktreeAcceleration !== falsepolicy immediately beforeaddManagedWorktree, and revalidate ownership after the dynamic import. Native hook and sparse-checkout paths do not consume that policy. The lock-test fixture overrides only the existing allocation function; its branch-reset cases now start from genuinely stale branch tips.Prepare and merge retain the same shared path:
prepare_initandmerge_runcallenter_worktree, whose cold path calls the provisioner. The managed branch still reads the policy before allocation.pr-worktree-provision.test.tscovers disabled acceleration, native hooks and authority loss, and real APFS cold/warm/sparse transitions.Evidence
pnpm check:changed: passed, including formatting, both typechecks, all export scans, and lint.origin/main, through P1: scoped-clean, no actionable findings.Known proof gaps
The loaded macOS host produced an earlier APFS integration timeout and a fresh-main fixture
git ETIMEDOUT. A back-to-back comparison used an independently installed, detachedorigin/mainworktree and then this committed patch, each with one worker and the unchanged 120-second budget:c801737ada1212e079b1ebMain also exceeded the budget, while the patch passed. This is recorded as host overload; no timeout or assertion was weakened. The temporary comparison worktree was removed. Hosted CI is the proof of record.