Skip to content

fix(update): shorten plugin rehearsal copying - #157199

Merged
steipete merged 2 commits into
mainfrom
codex/update-parallel-plugin-copies
Sep 24, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/update-parallel-plugin-copies

Conversation

@steipete

@steipete steipete commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Updates spend unnecessary time copying plugin dependency trees one file at a time during rehearsal preparation.

User Impact

Plugin rehearsal preparation can copy up to four independent files concurrently. Source checks, create-only publication, private link validation, and file permissions remain enforced. A failure stops new work and waits for admitted copies before returning to caller cleanup. No configuration or dependency change is required.

The change applies to the installed updater's preparation and to candidate-side missing-dependency repair under existing rehearsal markers. An older installed updater retains its initial copying behavior until upgraded.

Why This Change Was Made

The file phase uses the existing bounded concurrency runner with stop-and-drain behavior. Directory preparation stays ahead of copying; symbolic links, relocation, verification, and final permissions stay behind its completion barrier. The unused copy-only progress callback is removed; inventory progress remains active. Per-file parent-directory creation still supports partial repair plans.

CI also exposed a scheduling defect while validating this change: eligible changed paths can consume every core compiler graph, but their presence suppressed all hosted stripes. The second commit keeps GitHub/hybrid core type checks in their five existing stripes while retaining Blacksmith targeting. Coverage, runner labels, compiler concurrency, deadlines, and the existing worst-case admission bound stay unchanged.

Evidence

Isolated Blacksmith Testbox benchmark: Linux x64, 4 vCPUs, Node 24.19.0; a pnpm-style dependency tree with 5,010 files (22,581,690 bytes), 167 directories, and three dependency links. Two warmups were excluded, followed by three alternating baseline/candidate pairs. Baseline 6e008165e1e8; candidate 6a1473519e07.

Median Baseline Candidate Reduction
Copy time 2.318 s 1.639 s 29.3%
Copy CPU 2.570 s 1.935 s 24.7%
Inventory + copy 2.413 s 1.732 s 28.2%

Every paired copy comparison improved (21.7%, 22.3%, and 30.3%). Full content hashes, modes, independent inodes, source fingerprints, dependency links, and runtime imports passed in every trial. These measurements cover plugin preparation, not whole-update latency. The collector initially matched a fixture directory with an overly broad glob; collection alone was repaired without rerunning measurements. All downloaded evidence checksums passed and the Testbox was stopped.

  • 54 focused and sibling checks passed across portable copies, source changes, publication conflicts, dependency topology, scale, and candidate repair.
  • The new regression uses real fs-safe copies. An unsafe early-rejection negative control fails because only one of four active copies settled before the outer error; the safe implementation drains every admitted copy, stops queued work, and never publishes links after failure.
  • Changed test file: pnpm test src/infra/update-candidate-plugin-tree.test.ts --maxWorkers=1 passed all seven tests in 3.27 s command wall. Hosted CI job 107598457905 passed all seven cases: 117 ms summed case execution, including 18 ms for the new drain regression. These are test execution times; CI did not report per-file import/setup wall time. The containing group took 130.36 s and the complete multi-group job took 923 s.
  • Independent Codex review found no actionable P0–P2 issues. Changed-file checks passed, including core and 26 core-test type graphs, lint, formatting, ratchets, dead exports, and storage/import/auth guards.
  • Published 2026.9.6 driver upgrade cell: passed against exact candidate 6a1473519e07, using the installed updater and the base scenario. Native outcome was success; automatic migration, preserved state/configuration, plugin convergence, Doctor, and post-upgrade Gateway probes passed. The test starts the candidate Gateway manually; it does not prove managed-service restart or forced rollback. Baseline startup emitted a 91 s / 90 s advisory; candidate startup took 70 s. The existing Doctor inspection-budget warning deferred inspection until after activation; the subsequent Doctor and survival checks passed.
  • Initial exact-head CI attempt 1 was deferred by the release-priority window. In attempt 2, all Node test jobs passed; the architecture runner received a shutdown signal, and test types reached the 20-minute deadline after all 25 selected core graphs passed, during the extensions tail. No code diagnostic was reported. The changed-path planner had centralized nearly the whole compiler graph and suppressed hosted stripes.
  • Native CI fallback confirmed that the full hosted layout schedules the core stripes, but also exposed the unrelated Windows failure documented below. It was canceled after the CI-owner repair was pushed and fresh final-head CI attached, to avoid duplicate work.
  • CI-owner regression: four hosted cases fail before the fix and all six profile/input cases pass afterward. The complete planning file passed 397 tests in 202.63 s command wall with the sibling suite running concurrently; 324 guard/evidence tests passed with 12 existing skips. The six cases passed again in the integrated checkout in 13.86 s command wall. On final-head hosted CI (job 107636814140), the complete planning file passed all 397 tests in 173.343 s; the six changed cases totaled 2.993 s, including 1.913 s for the four added cases. Root test types, lint, formatting, workflow sanity, docs index, line-cap guard, and fresh independent Codex review passed.
  • Final-head CI passed, including the required aggregate gate, for 2cc3d292f992dba6c4fa1ccf30621e715ce8725e. Compared with the benchmarked and upgrade-tested 6a1473519e07, this commit changes only the workflow, CI documentation, and its planning test. Product source, build/dependency inputs, and updater behavior are byte-identical, so the completed performance and published-driver proofs are retained.

The full fallback exposed an unrelated Windows failure in schtasks-state-probe.windows.test.ts (job 107622316506): a real PowerShell/Task Scheduler query took 5,021 ms against its unchanged 5,000 ms budget and correctly returned unknown. The same probe implementation is present on current main; the log does not distinguish startup from COM latency. An isolated original-row reproduction dispatch returned HTTP 500, with no matching run found after reconciliation. No rerun success, source fix, timeout increase, or weakened assertion is claimed.

@clawsweeper

clawsweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete marked this pull request as ready for review September 24, 2026 10:07
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 24, 2026
@clawsweeper

clawsweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 24, 2026, 8:34 AM ET / 12:34 UTC (Revision 5).

ClawSweeper review

What this changes

Update rehearsal copies up to four plugin files concurrently, while CI keeps hosted core typechecks in five stripes; the branch also updates tests and documentation.

Merge readiness

✅ Ready for maintainer review

Keep open: current main still has the serial-copy bottleneck. Earlier merged performance work addressed disk syncing and path indexing, leaving this measured improvement distinct. I found no actionable defect in the introduced patch.

Priority: P2
Reviewed head: 2cc3d292f992dba6c4fa1ccf30621e715ce8725e

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The focused implementation and regression coverage are sound, with strong upgrade and performance evidence and no identified blocking defect.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (linked_artifact): The changed updater copy phase was benchmarked on a real 5,010-file tree and exercised by a successful published 2026.9.6-to-candidate update with reported plugin convergence and post-upgrade checks. The final commit leaves product behavior byte-identical and its CI run passed all five hosted core typecheck stripes. Detailed upgrade logs were blocked by the review proxy, so scenario details rely on the PR body and linked artifact metadata. No stored-data format changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): The changed updater copy phase was benchmarked on a real 5,010-file tree and exercised by a successful published 2026.9.6-to-candidate update with reported plugin convergence and post-upgrade checks. The final commit leaves product behavior byte-identical and its CI run passed all five hosted core typecheck stripes. Detailed upgrade logs were blocked by the review proxy, so scenario details rely on the PR body and linked artifact metadata. No stored-data format changes.
Evidence reviewed 9 items Current main retains serial copying: The current-main copier awaits each file copy inside one loop; the earlier disk-sync optimization did not parallelize this phase.
Introduced copy barrier: The PR uses the existing four-worker runner, retains create-only copy and source checks, and handles copy errors before symlink publication.
Worker settlement contract: The shared runner's stop mode skips new work after an error and resolves after admitted workers settle.
Findings None None.
Security None None.

How this fits together

During an update, OpenClaw inventories installed plugins and copies their dependencies into a private candidate snapshot before publishing links and verifying the result. The CI planner uses changed paths and runner profiles to schedule compiler checks for proposed changes.

flowchart LR
A[Installed plugins] --> B[Inventory and source checks]
B --> C[Prepare private directories]
C --> D[Copy up to four files]
D --> E{All copies succeeded?}
E -- Yes --> F[Publish links and verify snapshot]
E -- No --> G[Drain active copies and clean up]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +8, Tests +92, Docs +2, Config +1. Total +103 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 1 32 24 +8
Tests 2 126 34 +92
Docs 3 5 3 +2
Config 1 6 5 +1
Generated 0 0 0 0
Other 0 0 0 0
Total 7 169 66 +103

Review metrics

Metric Value Why it matters
Measured rehearsal copy time 2.318 s → 1.639 s median; 29.3% lower The reported paired benchmark measures the changed copy phase on a 5,010-file dependency tree.
Implementation and test growth production net +8 lines; tests net +92 lines Production reuses the existing worker runner; the added tests cover copy settlement and CI profile scheduling.

Technical review

Best possible solution:

Keep the bounded copy phase in the existing updater owner, with source checks and a drain barrier before link publication, and retain full hosted compiler stripes.

Do we have a high-confidence way to reproduce the issue?

Yes. Current main serializes file copies, and the PR records a paired benchmark of that phase on a large dependency tree; this read-only review did not execute it.

Is this the best way to solve the issue?

Yes. The patch reuses the existing bounded worker runner inside the current copier and retains the source checks and publication barrier.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against ead3b2ee776c.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a measured improvement to plugin-heavy updates with limited user impact.
  • merge-risk: 🚨 compatibility: The copier runs during installed updates and candidate repair, making upgrade behavior relevant; the linked published-driver cell supplies positive compatibility evidence.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): The changed updater copy phase was benchmarked on a real 5,010-file tree and exercised by a successful published 2026.9.6-to-candidate update with reported plugin convergence and post-upgrade checks. The final commit leaves product behavior byte-identical and its CI run passed all five hosted core typecheck stripes. Detailed upgrade logs were blocked by the review proxy, so scenario details rely on the PR body and linked artifact metadata. No stored-data format changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The changed updater copy phase was benchmarked on a real 5,010-file tree and exercised by a successful published 2026.9.6-to-candidate update with reported plugin convergence and post-upgrade checks. The final commit leaves product behavior byte-identical and its CI run passed all five hosted core typecheck stripes. Detailed upgrade logs were blocked by the review proxy, so scenario details rely on the PR body and linked artifact metadata. No stored-data format changes.

Evidence

What I checked:

  • Current main retains serial copying: The current-main copier awaits each file copy inside one loop; the earlier disk-sync optimization did not parallelize this phase. (src/infra/update-candidate-plugin-tree.ts:547, ead3b2ee776c)
  • Introduced copy barrier: The PR uses the existing four-worker runner, retains create-only copy and source checks, and handles copy errors before symlink publication. (src/infra/update-candidate-plugin-tree.ts:546, 2cc3d292f992)
  • Worker settlement contract: The shared runner's stop mode skips new work after an error and resolves after admitted workers settle. (src/utils/run-with-concurrency.ts:40, 2cc3d292f992)
  • Hosted CI scheduling: Changed-path targeting is limited to the Blacksmith profile, preserving hosted core stripes; the final-head CI run completed all five stripe jobs successfully. (.github/workflows/ci.yml:1609, 2cc3d292f992)
  • Production behavior unchanged by CI follow-up: The second commit changes no updater source, updater test, or updating documentation bytes from the benchmarked and upgrade-tested candidate. (src/infra/update-candidate-plugin-tree.ts:546, 2cc3d292f992)
  • Published-updater proof: The PR body reports a successful published 2026.9.6-to-candidate update with plugin convergence, Doctor, and Gateway checks. The linked run completed successfully and retains a published-upgrade-survivor artifact. The review proxy blocked detailed job-log download, so the scenario details were assessed from the PR body and artifact metadata. (6a1473519e07)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Jason (Json): Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Free Wortley: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (4 earlier review cycles)
  • reviewed 2026-09-24T10:22:56.261Z sha 6a14735 :: blocked before merge. :: none
  • reviewed 2026-09-24T10:52:26.499Z sha 6a14735 :: blocked before merge. :: none
  • reviewed 2026-09-24T11:49:16.810Z sha 6a14735 :: needs changes before merge. :: none
  • reviewed 2026-09-24T12:01:10.622Z sha 6a14735 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Sep 24, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

The published 2026.9.6 updater-to-candidate cell passed in run 35985430665 for unchanged head 6a14735. The PR body now records native updater success, state/configuration survival, plugin convergence, subsequent Doctor and Gateway checks, and the manual-restart/rollback limitations. The isolated 5,010-file benchmark remains 29.3% lower copy wall time with all correctness checks passing.

CI is pending the native exact-head fallback in run 35994423238. The earlier run had a runner shutdown and a central typecheck placement timeout; the fallback uses the existing distributed layout with unchanged coverage and limits.

@clawsweeper

clawsweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: M labels Sep 24, 2026
@steipete
steipete enabled auto-merge (squash) September 24, 2026 12:43
@steipete
steipete merged commit 9e00761 into main Sep 24, 2026
243 of 245 checks passed
@steipete
steipete deleted the codex/update-parallel-plugin-copies branch September 24, 2026 13:06
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash auto-merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant