Repository navigation
fix(worktrees): restore PR template acceleration - #164706
Conversation
The worker move in 7283a5c routed template commands through the full application runtime, which extracted PR wrappers intentionally omit. Provisioning therefore fell back to ordinary Git checkout instead of creating or reusing its filesystem template. Load the seven template handlers independently in the shared-state bootstrap worker and keep their existing admission, transaction, and settlement behavior. Ship only the template leaf in the wrapper inventory, and exercise its complete lifecycle without the application runtime. Validation: P2 review, check-changed, full test types, script types, architecture, source contracts, deadcode, build, boundary lint, 12,368 unit tests, and focused extracted-wrapper/worker tests pass. Full infra has one Doctor-maintenance failure under investigation; tooling remains in progress. The APFS scenario also exceeds its unchanged 120-second deadline on the producer's parent. Three repaired attempts passed the cold/warm clone assertions before hitting that existing deadline.
|
🦞👀 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 October 3, 2026, 10:27 PM ET / October 4, 2026, 02:27 UTC. ClawSweeper reviewWhat this changesThe branch restores faster PR worktree creation by loading existing filesystem-template operations directly in the shared-state worker and including their module in extracted wrappers. Merge readiness✅ Ready for maintainer review This PR remains necessary: pinned main still routes template commands through an application runtime excluded from extracted wrappers. The focused repair preserves existing guards, and no actionable introduced defect was found. Priority: P2 Review scores
Verification
How this fits togetherPR tooling creates isolated Git worktrees for review and landing. Its filesystem-template cache uses a SQLite worker to record template creation, reuse, and retirement before materializing those worktrees. flowchart TD
A[PR review request] --> B[Worktree provisioning]
B --> C[Shared-state worker]
C --> D[Template registry owner]
D --> E[SQLite template records]
E --> B
B --> F[Template clone or Git checkout]
F --> G[Isolated PR worktree]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +33, Tests +25, Other +1. Total +59 across 7 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep template commands with their existing leaf owner so extracted wrappers can reuse filesystem templates while preserving worker admission, cleanup custody, and native Git fallbacks. Do we have a high-confidence way to reproduce the issue? Yes, source establishes a focused reproduction path: execute a template operation from an extracted wrapper that lacks the application runtime. The PR reports the missing-module failure before the fix; this review did not execute it. Is this the best way to solve the issue? Yes, relocating the unchanged handlers to the bootstrap-accessible owner repairs the extraction boundary without bundling the full application runtime or duplicating template behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 1836ae214644. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
The worker move in 00ba533 routed template commands through the full application runtime, which extracted PR wrappers intentionally omit. Provisioning therefore fell back to ordinary Git checkout instead of creating or reusing its filesystem template. Load the seven template handlers independently in the shared-state bootstrap worker and keep their existing admission, transaction, and settlement behavior. Ship only the template leaf in the wrapper inventory, and exercise its complete lifecycle without the application runtime. Validation: P2 review, check-changed, full test types, script types, architecture, source contracts, deadcode, build, boundary lint, 12,368 unit tests, and focused extracted-wrapper/worker tests pass. Full infra has one Doctor-maintenance failure under investigation; tooling remains in progress. The APFS scenario also exceeds its unchanged 120-second deadline on the producer's parent. Three repaired attempts passed the cold/warm clone assertions before hitting that existing deadline.
What Problem This Solves
Fixes PR provisioning silently falling back to ordinary Git checkout instead of creating or reusing its filesystem template.
User Impact
Maintainer review and landing worktrees regain cold and warm template acceleration. Application behavior, database schemas, permissions, and provisioning deadlines are unchanged.
Why This Change Was Made
The worker move in #164517 routed template commands through the application runtime, which extracted PR wrappers intentionally omit. A portable extracted-wrapper reproduction fails with
ERR_MODULE_NOT_FOUND(openclaw-state-worker-runtime.js)before this change.The shared-state bootstrap now loads the existing template operations directly from their leaf owner. The wrapper includes that leaf while preserving the guard against loading the application runtime. Existing admission, transaction, and settlement behavior remains intact.
Evidence
check-changed, full test types, script types, architecture, source contracts, deadcode/Knip, build, boundary lint, and all 12,368 unit tests. Independent P2 review found no actionable issues.7b9615fc20fe) without this patch. Fourteen other broad-run failure groups pass in isolation on both baseline and candidate (87 tests each); those broad timing failures remain unclassified beyond that comparison. Both Ruby-dependent fixture files pass after installing the missing runner prerequisite (44 tests).b97d4c03f364.Remote proof capacity reached its limit, so this used the authorized ready-PR/auto-merge route. The broad local tooling run was stopped incomplete after preserving its results; natural PR CI supplied the remaining validation. No workflow was dispatched or rerun, and no assertion, timeout, skip, or import guard was weakened.