Repository navigation
refactor(plugins): centralize admission preparation - #138768
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. Reviewed September 6, 2026, 5:25 AM ET / 09:25 UTC. ClawSweeper reviewWhat this changesCentralizes common plugin loading preparation for runtime and CLI inspection, removes an unused internal setup option, and expands coverage for preserved loading policies. Merge readiness✅ Ready for maintainer review Keep open: this maintainer-requested cleanup remains distinct from current main, and no introduced correctness or security defect was found. The prior migration concern does not apply to the process-local cache. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw's plugin loader combines discovered manifests with configuration to decide which plugins may load. Runtime and CLI loaders consume those decisions to produce capability registries, command metadata, and diagnostics. flowchart TD
A[Plugin manifests] --> C[Shared loading preparation]
B[Configuration and requested scope] --> C
C --> D[Scope and enablement decisions]
D --> E[Runtime loader]
D --> F[CLI metadata loader]
E --> G[Capabilities and diagnostics]
F --> H[Commands and diagnostics]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -65, Tests +249. Total +184 across 10 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep one shared preparation owner while preserving each loader's existing import, trust, validation, and registration policy. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a behavior-preserving refactor, not a reported user defect; no introduced failure was established by source review. Is this the best way to solve the issue? Yes: extracting the identical preparation logic removes competing maintenance points while leaving runtime and CLI registration policies with their existing owners. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d1c77cb7d892. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
b8a208e to
04ea328
Compare
Share scoped activation, enablement, registration planning and manifest-record preparation between runtime and CLI metadata loading while retaining their distinct entrypoint policies. Retire the private required-setup option left behind when read-only channel loading moved to per-manifest setupSource guards. Keep manifest-record construction private and cover build-version normalization through the preparation owner. Preserve activation reasons independently of enablement, scope-before-import behavior, setup trust boundaries, manifest trust and control UI metadata, and source-root channel policy during normalized config reuse. No public CLI, plugin SDK, configuration, dependency or persistence contract changes.
04ea328 to
1e15198
Compare
|
ClawSweeper status: applying reviewed decision. I am applying the reviewed decision for this pull request: refactor(plugins): centralize admission preparation This is item 1/1 in the current shard. Shard 1/1. This transient lease prevents a newer review from overlapping label, comment, or close mutations. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
|
Merged via squash.
|
Share scoped activation, enablement, registration planning and manifest-record preparation between runtime and CLI metadata loading while retaining their distinct entrypoint policies. Retire the private required-setup option left behind when read-only channel loading moved to per-manifest setupSource guards. Keep manifest-record construction private and cover build-version normalization through the preparation owner. Preserve activation reasons independently of enablement, scope-before-import behavior, setup trust boundaries, manifest trust and control UI metadata, and source-root channel policy during normalized config reuse. No public CLI, plugin SDK, configuration, dependency or persistence contract changes.
What Problem This Solves
Runtime plugin loading and CLI metadata loading separately prepared the same admission facts, leaving two places to keep activation, enablement, duplicate diagnostics and manifest details aligned. This continues the maintainer-requested cleanup already proposed in this PR, not a newly reproduced user defect or a new feature request.
Why This Change Was Made
Centralize scoped admission preparation in the shared loader while keeping runtime and CLI import/registration policy distinct. Remove the dormant private required-setup option now that read-only channel discovery owns direct setup loading. Preserve independent activation provenance and enablement, manifest trust and control UI metadata, capability catalog behavior, and source-root channel policy during normalized config reuse.
The refreshed candidate also preserves main's consolidated
recordPluginErrorowner: validation errors retain their existing classification, while load errors can carry SDK seam/version/build diagnostics. The two actual rebase conflicts were import blocks; obsolete validation helpers were not restored.Production code decreases by 65 lines (+122/-187); tests change by +293/-44 across four files. No configuration, dependency, persistence, public CLI or plugin SDK contract change is intended by this refactor.
User Impact
No intentional user-visible behavior change. Plugin loading and inspection retain their policy boundaries, with one shared owner for common preparation. No upgrade or operator action is required.
Current Candidate Evidence
Candidate
1e15198412e4cb25e473624c1a7a77e6270307efhas raw parent5650fe2abc1ae54143aad2e41735396ae1f55331and tree4bd3dd5fdd13c08879a354bb559d217a25bbc670. The normal frozen dependency installation completed against that parent graph. One normal six-file focused run passed 123 tests, including the four changed tests and current error-recording/SDK-diagnostic sibling cases. The normal configured Linux changed-file gate passed all 30 checks with source/receiver identity and lease cleanup verified.The normal full build on the clean signed candidate completed all 16 phases: 15 ran and CLI startup metadata was restored through its normal cache path and refreshed. Build information and both stamps identify
1e15198412e4.Three serial built CLI observations passed in a new isolated profile: snapshot inspection remained metadata-only, runtime inspection imported and registered memory-core without diagnostics, and memory help printed the current build and command tree. Snapshot and runtime schema, UI hints, contracts, trust and activation metadata matched. Registration is not execution: no Gateway, provider or memory operation was invoked. Real profile initialization was recorded and retained, rather than described as having no filesystem effects.
The resolved composition and the separate exact signed commit each received canonical P2 static review with no actionable findings in two partitioned passes. The exact-commit passes returned confidence 0.82 and 0.86, with aggregate scoped-clean confidence 0.82. The first pass explicitly limits its assessment to its supplied batch; this is not a claim that either pass saw the entire packet together. Reviewers treated the tests/builds as author evidence and did not independently execute project code.
Historical Evidence and Review Context
The earlier
04ea328f900candidate on the older base passed 200 nonoverlapping tests, a full build, three operator observations, changed checks, and precommit/exact-commit P2 reviews. Those executions remain historical; the current 123-test run is not presented as a replay of all 200. The originalb8a208ede254candidate's comparison/replay evidence also remains historical. The original loader timeout's cause remains unknown; recovered runs used different canonical cache routes.The earlier review's data-model compatibility item concerned the removed setup-option cache-key dimension in
loader-load-context.ts. Its owner is the process-localPluginLoaderCacheStateLRU and in-flight sets, not a persisted schema. The option had no remaining caller. Removing its constant default key component changes transient cache identities, not a database, stored record, migration or upgrade reader; no data migration is applicable.ClawSweeper's September 6 review of
04ea328f900withdrew the migration concern and reported no patch findings. Its remaining integration item is addressed by the pinned rebase composition, current validation and separate exact-commit review described above. The ready transition still requires a fresh positive GitHub mergeability check. Hosted exact-head CI and repo-native landing remain separate gates; neither is claimed complete by the local proof.