Repository navigation
improve(config): reuse plugin metadata during auto-enable - #206289
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: passed. What this changesThis PR passes the registry resolved during plugin detection into materialization instead of selecting the same metadata again. Example: Apply configuration with model fixture/model, plugins.allow containing existing, and no supplied registry.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR removes verified duplicate metadata resolution with a focused change, and no discrete correctness or security defect was found. Reviewed head: Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherPlugin auto-enable consumes configuration, environment, and plugin metadata for CLI, Gateway, and Doctor callers, returning effective configuration and activation reasons. flowchart TD
A[CLI Gateway or Doctor] --> B[Apply auto enable]
B --> C[Detect candidates]
C --> D[Resolve plugin registry]
C --> E[Candidates and resolved registry]
E --> F[Materialize activation policy]
F --> G[Effective config and reasons]
Technical reviewBest possible solution: Carry the detection owner's resolved registry through the synchronous apply while retaining standalone helpers and existing cache lifetimes. Do we have a high-confidence way to reproduce the issue? Current-main source establishes duplicate registry resolution when detection produces candidates and the caller supplies no registry; the supplied synthetic replay reports loader and current-snapshot selections falling from two to one. Is this the best way to solve the issue? The change removes redundant work at the existing owner without adding cache state, changing plugin policy, or carrying metadata across an await. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5b6cc381e1d0. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +13, Tests +25. Total +38 across 3 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 November 26, 2026, 9:32 PM ET / November 27, 2026, 02:32 UTC. |
|
Merged via squash.
|
* commit '7df6cb759f9e604921536a700e2f527c5516e7de': (185 commits) docs: clarify what telemetry OpenClaw sends and how to opt out refactor(ui): remove retired stream-follow test seams (#206316) fix: distinguish missing command results from unknown outcomes (#206313) fix(build): reuse stamps after identical pnpm installs (#206282) chore(ci): inventory Gateway model catalog worker lifecycles (#206251) fix: keep failed image inspections inside chat activity (#206283) fix: clarify sent-message labels and chat activity icons (#206048) fix(cron): use the service's free memory for extra automation runs (#206322) test(android): reuse the shared TLS fixture (#206280) fix(ui): restore New Session recovery during startup (#206319) test(macos): align new Gateway URL expectations (#206281) feat: let doctor --fix tell when its startup repairs have nothing to do (#206246) fix(android): pause idle gateway discovery without blocking consumers (#196209) fix(ci): prepare the Android SDK for scheduled CodeQL scans (#203843) fix(memory): read delegated cgroup pressure from the mapped leaf (#206308) improve(config): reuse plugin metadata during auto-enable (#206289) improve: copy only the selected model for agent completions (#206287) fix(pr): refresh tooling before preparing reviewed incoming PRs (#206236) fix: keep Gateway ready while plugins drain after updates (#206299) fix(crabbox): keep unused prepared mirrors reusable (#206267) ...
What Problem This Solves
When configuration processing decides which plugins to enable, an apply call without a supplied registry resolves the same plugin metadata during both detection and materialization. Even a matching current snapshot is selected twice; the cold fallback can invoke the metadata loader twice.
User Impact
Configuration processing avoids the second metadata selection within each synchronous apply. Plugin enablement policy, explicit registries, standalone Doctor helpers, and metadata replacement between calls keep their existing behavior. No configuration changes or migration are required. Startup latency has not been measured.
Why This Change Was Made
Detection already owns the resolved registry, so it now carries that fact into materialization. The public detection helper still returns only candidates. This adds no cache and leaves async setup's post-await resolution and the existing bounded result caches unchanged.
Evidence
55510e4. All 77 auto-enable tests passed on Bun/Vitest: core 41, materialize 4, providers 14, channels 12, capture 6. This includes the cold-loader regression and current-snapshot replacement/count regression. Production/test types, source contracts and guards also pass. The subsequent normal ready-PR CI run completed successfully at the same head.git diff --checkpass. Independent source review and autoreview found no actionable P0–P2 findings for the complete staged change against2ab7b31(snapshote6fd0ad6). Autoreview used the configured Codex route; local ClawSweeper was unavailable because its runner checkout was not clean. Hosted intake acknowledged an existing cross-route review request after readiness; no hosted review result is claimed.The earlier draft CI dependency check reported three pre-existing Knip symbols:
readUpdateDatabaseEngineConfig,formatUpdateSnapshotCapacity, andDoctorContributionPending. The candidate job and the frozen main baseline job report the same names and classifications; the baseline checkout is2ab7b31. Their source and dependency inputs are unchanged by this PR. That draft-run failure remains recorded; the subsequent normal ready-PR run is green.The loader and snapshot counts above measure one synchronous
applyPluginAutoEnablecall. The complete CLI entry point was not instrumented. The change therefore establishes the work removed per apply while whole-command counts and latency remain open.