Repository navigation
fix: reduce installed plugin startup work in 10.1 - #168017
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. What this changesThe branch reduces repeated reads of copied plugin files during startup while preserving content verification and rejection of failed captures. Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Partial Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored backport remains useful for the release branch even though main already contains the optimization. No actionable introduced defect was found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherOpenClaw captures installed plugin files before loading their modules. Content receipts verify those copies and support startup, later imports, and recovery. flowchart TD
A[Installed plugin files] --> B[Copy and hash destination]
B --> C[Reuse copied content facts]
C --> D[Verify destination and receipt]
D --> E[Load captured modules]
B --> F[Record failed captures]
F --> G[Reject lookup and recovery]
Technical reviewBest possible solution: Carry the existing receipt-owner optimization into the release branch while keeping the broader Windows stall investigation separate. Do we have a high-confidence way to reproduce the issue? Yes for the narrow redundant-read problem: the base hashes the copied descriptor, rereads it during file registration, and reads it again during receipt finalization. The added artifact-boundary regression reports failing before and passing after. Is this the best way to solve the issue? Yes: reuse the copy owner's hash and retain one fresh pathname/content check in the existing receipt owner, rather than weakening admission or creating another cache. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 6c352c1fc685. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +17, Tests +21. Total +38 across 3 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 9, 2026, 7:26 PM ET / 23:26 UTC. |
Related: #167406. Partial backport of #164680 (main commit
85696bac6d45f4ad200dad40d0a14c4b6dd3fb8d), with upstream human credit to @steipete.What Problem This Solves
Installed plugins add synchronous file work to Gateway startup on Windows. The 10.1 branch already has descriptor hashing from the main fix but omitted its receipt-owner reuse, leaving ordinary copied files read three times during cold receipt admission.
User Impact
Removes one full read and guarded reopen per ordinary copied plugin file during cold receipt admission. Existing source digests, mutation rejection, and failed lazy-capture tracking remain intact. This does not claim to resolve the entire Windows MSIX startup report; installed Windows package verification is tracked separately.
Why This Change Was Made
Restore the missing reviewed main receipt logic and its early failure-tracking registration. Reuse the owned copy hash, then reopen and verify copied content once at receipt admission, including warm and lazy paths.
Evidence
A real artifact-boundary regression reads 196,611 bytes from a 65,537-byte copied file before the fix and 131,074 after it; the test enforces an upper budget of two payload passes without a production seam. Original red: 28.54 s Vitest / 37.48 s wrapper. Final streaming file: 14 tests passed, 23.22 s wall time / 29.30 s wrapper, about 1.3 s test time; new regression 0.106 s. Hosted CI seconds for the new case are unmeasured; the 0.106 s figure is local.
The artifact, streaming, and module-conditions suites passed 133 tests (94.17 s Vitest / 109.69 s wrapper). Cold/warm/lazy substitution, native admission, bounded reads, source mutation, and stable legacy digest coverage remain passing. Fresh independent review found no P0–P2 findings. Complete required changed checks passed: production and all 27 test type graphs, lint, formatting, plugin boundaries, source/dependency/storage/import/authentication guards, and unused-export scans. Exact-head CI 38003953889 and its
openclaw/ci-gatepassed foraddd38d30d99ac24741a2ffef904dadc4e65bf82; all applicable PR checks completed without failures. Canonicalpnpm buildpassed in 21m 15.1s, including Control UI assets and built plugin control-plane/Doctor closure checks. Canonical Parallels packaging and tarball guards passed for2026.10.1-beta.3ataddd38d30d99ac24741a2ffef904dadc4e65bf82, with matching Codex and DeepSeek companion packages. This source tree equals the landed release commitfaeddad2cbedd3ac37f74438c1ab6da41b992db9. The core tarball SHA-256 is4c35da73f2ecf3bfcffbd1757f72493c8ba2e1ae97d5da145e2eafb14ef4bac0. Installed Windows ARM64 verification passed on Node 24.19.0 in a 16 GB Parallels VM. The installeddist/build-info.jsoncommit was independently verified asaddd38d30d99ac24741a2ffef904dadc4e65bf82; the core was updated while preserving the existing official beta.3 Codex plugin state. The actual installed CLI Gateway loaded Codex, reported zero plugin-load errors, and reached health at 423.012 s, ready at 430.283 s, and a healthy event loop (degraded: false) at 436.533 s. The matched Gateway PID shut down cleanly after SIGTERM in 2.038 s; the observer exited 0, the PID was gone, and isolated ports were free. This is functional installed-package proof, not a controlled speed comparison or Windows x64 MSIX verification. The broader minutes-long startup remains unresolved; #167406 stays open.