Repository navigation
improve(pr): reuse managed source clones for cold worktrees - #149585
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: blocked before merge. Reviewed September 16, 2026, 7:58 PM ET / 23:58 UTC (Revision 9). ClawSweeper reviewWhat this changesThe PR routes cold PR worktree creation through the existing filesystem-clone checkout owner while preserving native Git policy, branch ownership, and recovery state. Merge readiness⛔ Blocked before merge - 3 items remain This remains a useful, maintainer-sponsored implementation that current main and the latest release do not provide. No blocking code defect was established; the previous compatibility and performance qualification gaps remain. Priority: P2 Review scores
Verification
How this fits togetherThe native PR tooling creates isolated checkouts for review and landing. This adapter connects that tooling to OpenClaw’s managed source-template cache, while Git continues to own branches and indexes and native PR tooling retains cleanup responsibility. flowchart TD
A[PR review command] --> B[Operation lock and pinned seed]
B --> C[Allocation lease and disk checks]
C --> D{Native Git policy required?}
D -->|Yes| E[Ordinary Git checkout]
D -->|No| F[Managed template or Git fallback]
E --> G[Verify checkout identity]
F --> G
G --> H[Native PR review and recovery]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +39, Tests +539, Other +1413. Total +1991 across 13 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Reuse the managed checkout owner while retaining native PR custody, with documented state and reserve requirements and demonstrated compatibility for fresh and existing operator setups. Do we have a high-confidence way to reproduce the issue? Not applicable as a defect reproduction: this is an internal optimization, and source confirms that current main still performs ordinary cold Git checkout. Is this the best way to solve the issue? Yes, reusing the existing checkout owner is the maintainable direction; end-to-end compatibility and measured performance still need qualification. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 1b0243f7303e. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (8 earlier review cycles)
|
|
Merged via squash.
|
…#149585) * fix(worktrees): preserve caller-owned branches during allocation * fix(worktrees): preserve caller Git policy in capacity worker * improve(pr): reuse managed source clones for cold worktrees * fix(pr): complete provisioning closure and fixture setup * test(pr): preserve native ownership in provisioning fixtures * test(pr): allow bounded linked-wrapper cleanup verification * fix(pr): preserve aliased worktree parents during provisioning * fix(pr): include current memory path helper in wrapper closure
Let the verified anchor child complete and validate its package pins when an older parent hands it an incomplete dependency context. Preserve pinned real package directories and bootstrap older anchors against their own manifest. Extend the extracted-source guard to cover pinned bare imports, package export subpaths, and copied workspace aliases. Keep the inventory repair with #150399. Refs: #149585, #133913, #150312, #150399.
Let the verified anchor child complete and validate its package pins when an older parent hands it an incomplete dependency context. Preserve pinned real package directories and bootstrap older anchors against their own manifest. Extend the extracted-source guard to cover pinned bare imports, package export subpaths, and copied workspace aliases. Keep the inventory repair with #150399. Refs: #149585, #133913, #150312, #150399.
* fix(pr): give materialized wrappers their dependency context Let the verified anchor child complete and validate its package pins when an older parent hands it an incomplete dependency context. Preserve pinned real package directories and bootstrap older anchors against their own manifest. Extend the extracted-source guard to cover pinned bare imports, package export subpaths, and copied workspace aliases. Keep the inventory repair with #150399. Refs: #149585, #133913, #150312, #150399. * test(pr): resolve workspace aliases within the extracted root Bind the TypeScript resolution host to the selected closure root so alias lookups cannot fall back to the calling checkout during anchor validation. Refs: #150399, #150504.
…ier assertions - Add src/agents/model-provider-local.ts to scripts/pr-lib/wrapper-components.txt (sorted between model-extra-params.ts and model-ref-profile.ts). The file was imported by internal-runtime-context.ts in openclaw#149585 but not added to the anchored-copy inventory; fixture copies lacked the module, causing ERR_MODULE_NOT_FOUND in shards 23/25/36/40/42. - Sync wrapper-components.txt with current main (includes entries added since the branch's last merge). - Remove 'test-provider' from CLOUD_PROVIDER_ID_PREFIXES in internal-runtime-context.ts. The entry existed to keep two integration suites green after openclaw#140799 added the findIndex(carrier) > userIndex assertion, but 'test-provider' is a fixture name leaking into production and prefix-matches any user config named test-provider-*. - Update agent-runner-memory.private-transcript.test.ts:317 and agent-runner-required-maintenance.pending-input.test.ts:409 to assert toBeLessThan(userIndex): the test fixtures use openai-completions on http://127.0.0.1:<port>/v1, which isLocalProviderBaseUrl classifies as a local/self-hosted endpoint, so shouldRelocateRuntimeContextCarrierToTail returns false and the carrier stays in chronological position before the steering user. This matches the documented behaviour in attempt-session-boundary-carrier.test.ts ("does not relocate carrier to tail for custom provider with loopback baseUrl").
…w#150504) * fix(pr): give materialized wrappers their dependency context Let the verified anchor child complete and validate its package pins when an older parent hands it an incomplete dependency context. Preserve pinned real package directories and bootstrap older anchors against their own manifest. Extend the extracted-source guard to cover pinned bare imports, package export subpaths, and copied workspace aliases. Keep the inventory repair with openclaw#150399. Refs: openclaw#149585, openclaw#133913, openclaw#150312, openclaw#150399. * test(pr): resolve workspace aliases within the extracted root Bind the TypeScript resolution host to the selected closure root so alias lookups cannot fall back to the calling checkout during anchor validation. Refs: openclaw#150399, openclaw#150504.
Closes #149583
What Problem This Solves
Cold
scripts/prworktrees perform full Git checkouts even where OpenClaw already has a filesystem-clone source cache. The adapter also needs to preserve Git hooks, caller policy and native recovery ownership while using that cache.User Impact
PR source creation can reuse the managed source cache on supported filesystems. Repositories with hooks, filesystem monitors, conditional/per-worktree Git configuration or replaced command-count settings keep native Git behavior. Native PR paths, caller branches, private main checkpoints, operation locks, full-checkout checks and cleanup ownership remain unchanged.
Why This Change Was Made
The adapter calls the existing managed checkout owner under its renewable allocation lease. It preserves caller-owned seed branches and partial checkouts on failure. The trusted wrapper carries the runtime source and installed package dependencies needed by that path.
This branch is integrated with main after #149581 and #149587 landed; their generic/setup changes remain owned by those PRs. Current-source qualification found and repaired missing extracted plugin-manifest modules, missing fixture package links, and an overly broad policy check that treated the supervisor's preserved
GIT_CONFIG_PARAMETERSmaintenance settings as a reason to disable acceleration.Evidence
No full-corpus/profile proof is replayed. The Linux unsupported-filesystem cell cannot run on the local macOS host; hosted exact-head CI remains required. Original failed/interrupted qualification and the corrected successor evidence are retained separately.