Skip to content

fix: reduce installed plugin startup work in 10.1 - #168017

Merged
RomneyDa merged 1 commit into
release/2026.10.1from
backport/10.1-plugin-copy-receipt
Oct 9, 2026
Merged

RomneyDa merged 1 commit into
release/2026.10.1from
backport/10.1-plugin-copy-receipt

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

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-gate passed for addd38d30d99ac24741a2ffef904dadc4e65bf82; all applicable PR checks completed without failures. Canonical pnpm build passed in 21m 15.1s, including Control UI assets and built plugin control-plane/Doctor closure checks. Canonical Parallels packaging and tarball guards passed for 2026.10.1-beta.3 at addd38d30d99ac24741a2ffef904dadc4e65bf82, with matching Codex and DeepSeek companion packages. This source tree equals the landed release commit faeddad2cbedd3ac37f74438c1ab6da41b992db9. The core tarball SHA-256 is 4c35da73f2ecf3bfcffbd1757f72493c8ba2e1ae97d5da145e2eafb14ef4bac0. Installed Windows ARM64 verification passed on Node 24.19.0 in a 16 GB Parallels VM. The installed dist/build-info.json commit was independently verified as addd38d30d99ac24741a2ffef904dadc4e65bf82; 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.

Backport the missing receipt and failed-capture tracking pieces of 85696ba (#164680). Preserve raw-byte source digests and copied-content admission while avoiding a redundant copied-file read.
@clawsweeper

clawsweeper Bot commented Oct 9, 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.

@RomneyDa
RomneyDa marked this pull request as ready for review October 9, 2026 23:20
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 Oct 9, 2026
@clawsweeper

clawsweeper Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

The branch reduces repeated reads of copied plugin files during startup while preserving content verification and rejection of failed captures.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, sound backport supported by meaningful artifact-boundary evidence, with installed release-branch behavior still unmeasured.
Proof confidence 🦐 gold shrimp (3/6) The MEMBER-authored PR is exempt from the external-contributor proof gate. Its reported real-file artifact harness exercises the changed capture and receipt owners, but does not establish release-branch Windows Gateway performance; receipt serialization remains compatible without migration.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Performance · Worth it: Yes · Fix scope: Partial
User problem: Installed plugins add avoidable synchronous file work while the Gateway starts.
Reason: This maintainer-authored backport removes measured redundant work at the existing owner without changing settings or weakening verification. It appropriately leaves the broader linked startup report open.

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
Reviewed head: addd38d30d99ac24741a2ffef904dadc4e65bf82

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: An installed release-branch Gateway startup comparison is not supplied; upstream Windows measurements cover the complete main fix.
Agent review details

How this fits together

OpenClaw 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]
Loading

Technical review

Best 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

  • src/plugins/plugin-generation-receipt.ts keeps the original intent (9faa93d: Reuse unchanged managed native admission while preserving independent ordinary-source verification and legacy raw-byte receipt values.)
  • src/plugins/plugin-generation-file-capture.ts keeps the original intent (9faa93d: The materializer owns file mutability and retains independently copied inspected files while native artifacts use their separate admission contract.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source +17, Tests +21. Total +38 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 24 7 +17
Tests 1 21 0 +21
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 45 7 +38

Review metrics

Metric Value Why it matters
Copied payload reads 3 passes → 2 passes The reported artifact-boundary comparison demonstrates removal of one full copied-file read while retaining admission.

Labels

Label changes:

  • add P2: This is a bounded startup improvement; it does not establish resolution of the broader severe Windows stall.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: This is a bounded startup improvement; it does not establish resolution of the broader severe Windows stall.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only; repair and merge need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

Reviewed October 9, 2026, 7:26 PM ET / 23:26 UTC.

@RomneyDa
RomneyDa merged commit faeddad into release/2026.10.1 Oct 9, 2026
196 checks passed
@RomneyDa
RomneyDa deleted the backport/10.1-plugin-copy-receipt branch October 9, 2026 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S 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