Repository navigation
fix(update): reduce slow prevalidation for large plugin trees - #166317
Conversation
|
Codex review: needs maintainer review before merge. Reviewed October 7, 2026, 3:14 AM ET / 07:14 UTC (Revision 3). ClawSweeper reviewWhat this changesThe PR speeds private update validation by carrying installed bundled-plugin selections into the candidate, reporting completed filesystem work, and copying large plugin inventories through four workers. Merge readiness✅ Ready for maintainer review This PR remains useful: current main lacks the optimizations, and the exact-head published-updater evidence resolves the previous compatibility-proof blocker. No actionable introduced defect was found. Priority: P2 Review scores
Verification
How this fits togetherThe updater rehearses a staged OpenClaw package against private copies of existing state and configured plugins before activation. Snapshot preparation feeds plugin checks, Doctor, and candidate startup while preserving the serving installation. flowchart TD
A[Installed updater and existing state] --> B[Capture bundled plugin selection]
B --> C[Inventory private candidate state]
C --> D[Guarded four-worker copies]
D --> E[Progress watchdog]
D --> F[Plugin checks and Doctor]
F --> G[Candidate startup and readiness]
G --> H[Cleanup and validation result]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +266, Tests +462. Total +728 across 19 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep one guarded snapshot owner that reports actual completed work and preserves released-updater compatibility while accelerating large plugin trees. Do we have a high-confidence way to reproduce the issue? Yes, source inspection identifies candidate-side bundled-selection rediscovery and synchronous guarded copying on large inventories; the body supplies a measured before/after rehearsal. This review did not execute a reproduction. Is this the best way to solve the issue? Yes, the patch extends the existing snapshot, watchdog, and worker owners while preserving copy safeguards and legacy output behavior rather than adding a competing update path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 6acf06b1299f. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
🦞👀 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. |
6fdf4f3 to
9c985fa
Compare
|
Merged via squash.
|
…aw#166317) * fix(update): reduce slow prevalidation for large plugin trees * test(update): settle snapshot workers before cleanup probes
What Problem This Solves
Fixes prolonged update prevalidation when configured plugin paths refer to the installed bundled plugins or large dependency trees.
User Impact
Updates can prepare and validate their private candidate state substantially faster without skipping database snapshots, integrity checks, plugin checks, or test startup. In one local, production-shaped rehearsal, complete prevalidation including cleanup fell from 12m49s to 5m42s (55% less time).
The full improvement requires both the updated installed driver and candidate worker. Older driver/worker combinations remain compatible but can retain the previous copying and progress-probe overhead. This does not change configuration, schemas, or live-state activation behavior.
Why This Change Was Made
Evidence
Rebased-head verification (2026-10-07)
The candidate was rebased onto
eb1b48c58b61dec3cc273587d44e4f9a7eaa29f9as9c985fa8888558925e31f98a8dfe1514d9d38ce4. The only conflict was additive diagnostics tests; both main's signal-error cases and this PR's progress cases were retained.2026.9.8updater (published buildfc23bc864e45) ranupdate --yes --no-restart --tag <candidate.tgz> --jsonin an isolated installation with synthetic state: exit 0, statusok, 503.442 s wall time.0444file, and a relative symlink from its actual private-canary root. The canary was removed afterward. Explicit installed bundledllm-taskand the custom plugin loaded before and after; post-ready health reported no plugin errors. The running candidate's WebSocket hello attested the exact rebased build, and a regular synthetic chat's ID and complete message array were preserved.check-changedpassed: formatting, core/core-test type checks, lint, dead exports, and applicable guards. Full package build took 4m06.7s; canonical tarball integrity passed. Independent review found no P0/P1 findings.719bc969dc833a5da9e666eb88357d70cdba27dd56f45260426cd1f08f9fa5c4.6fdf4f3a7fe5, including copied-plugin bytes, restart/readiness, regular history and incognito behavior. That is prior-head evidence, not rebased-head CI.Limits and disclosed warnings: native service management was intentionally skipped through the normal account-home fence; this verifies native package update/copy/startup with owned foreground Gateways, not LaunchAgent activation. No serving installation or operator state was changed. The first native attempt stopped at Doctor because the long test TMPDIR exceeded Darwin's Unix-socket path bound and the write fence rejected the shared-/tmp fallback. The retry used a 90-byte socket path in a short private temp root with all fences retained and no product patch. The passing run still logged a 5-second shared-state CLI cleanup warning and a sandbox process-inspection warning; a premature pre-ready health probe timed out, then all post-ready runtime checks passed. These warnings are not presented as fixed defects.
Hosted CI fixture correction
The first rebased-head hosted run exposed two existing probe-uncertainty fixture failures. Both were reproduced locally before repair: the missing dummy worker exited before the new reported-progress quiet period could reach its probe.
Follow-up
5f33ee23ca18047ab2bcdb0b7f459b55a0e66e67changes onlysrc/infra/update-candidate-state.budget.test.ts. It holds admitted worker work until the probe runs under a controlled clock, then settles it. Existing rejection and retained-scratch assertions remain; no test cases were skipped or removed. The changed fixture is not shipped in the verified package.28 related tests passed in 21.03 s, plus the infra test typecheck, scoped lint, formatting and applicable line/assertion/timeout guards. Independent review found no P0/P1 findings. Production sources are unchanged from the native-tested
9c985fa88885build; the native proof remains explicitly bound to that build. The earlier hosted failure is retained as a failure, not relabeled green; the updated head has its own required CI.Original performance and author validation
A same-configuration private rehearsal exercised database snapshots, Doctor, lint/config/plugin/recovery checks, candidate startup/readiness, and cleanup. All seven phases succeeded; the serving gateway processes and source configuration remained unchanged.
These are single-host measurements, not a whole production-upgrade benchmark or a universal timing guarantee. The earlier four-worker copy component alone improved an identical frozen inventory by 18.8%; the larger result above includes the provenance and progress fixes.
pnpm tsgo:core, andpnpm tsgo:core:testpassed.OPENCLAW_UPDATE_IN_PROGRESS=1 pnpm build, passed in 63.66 s.Focused test commands
View the OpenClaw team session