Repository navigation
perf(secrets): skip plugin metadata for entries without config values - #206285
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 skips plugin metadata discovery for entries without config fields and preserves discovery on a later config refresh. Example: An entry contains
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored draft removes source-confirmed unnecessary discovery, and review found no definite introduced correctness defect. Reviewed head: Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe secrets runtime takes canonical config, environment values, auth stores, and plugin contracts and produces resolved in-memory snapshots for CLI preflight and Gateway activation. flowchart TD
A[Config and environment] --> B[Secrets preparation]
B --> C[Plugin config value check]
C --> D[Plugin metadata when needed]
D --> E[Secret assignment collection]
B --> E
E --> F[Resolved runtime snapshot]
F --> G[Config refresh]
Technical reviewBest possible solution: Keep the shared config-value predicate and preserve the distinction between an unobserved inventory and an observed empty inventory. Do we have a high-confidence way to reproduce the issue? Source confirms that a policy-only plugin entry triggers unnecessary metadata discovery when a core SecretRef requires full preparation; no product execution was performed during this read-only review. Is this the best way to solve the issue? The change removes work at the existing preparation and collection owners without adding a competing registry, and retains explicit empty-inventory semantics for known stale plugins. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 3ffd7660334a. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +5, Tests +50. Total +55 across 7 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. 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 November 26, 2026, 8:59 PM ET / November 27, 2026, 01:59 UTC. |
|
|
Merged via squash auto-merge.
|
…openclaw#206285) * test(secrets): cover metadata discovery for plugin config values * perf(secrets): skip plugin metadata for entries without config values
…#206285) * test(secrets): cover metadata discovery for plugin config values * perf(secrets): skip plugin metadata for entries without config values (cherry picked from commit 5f0743a) Companion audit: #200185 separates passive credential lookup; no dependency on entry-config scan or origin inventory lifecycle. Co-authored-by: RomneyDa <[email protected]>
Problem
Preparing SecretRefs loads plugin manifests for entries that only set activation policy. The CLI can do this during command preflight and local resolution even though those entries have no configuration fields for a plugin contract to match.
User Impact
Local commands and secret preparation can skip this discovery when no plugin config contains a value. Plugins with config values keep their existing activation, stale-entry and warning behavior.
Why This Change Was Made
The collector and snapshot preparation use the same check for plugin config fields before requesting metadata. Channel, web-tool and exec-provider requests keep their own discovery conditions. Refresh records whether an origin inventory was observed, so a later config change can discover a newly configured plugin and resolve its credentials.
Evidence
On the frozen base with only the new tests applied, three cases failed. Policy-only entries, an empty config and the initial snapshot each triggered one metadata lookup. On the candidate all three triggered zero lookups. A later refresh that added a plugin credential discovered its owner and resolved the SecretRef.
Five focused suites passed all 20 tests, including bundled plugin manifests, disabled and stale entries, external-channel discovery, and snapshot cleanup. The production diff spans five files (+22/−17). There are no config or defaults changes. Device latency remains unmeasured.
An isolated run against the built JavaScript and normal CLI offline state owner prepared two snapshots with a core env SecretRef. An enable-only entry and an empty plugin config both produced zero manifest-helper imports and no recorded plugin inventory. Refresh added Tavily's
webSearch.apiKey, loaded the real bundled manifest, and resolved the synthetic credential. The normal package build and integrity check passed.The draft Bun Gateway config-patch job failed during native-worker teardown. The exact test passed on the frozen Linux base and in a focused Bun replay on the signed head. The draft dependency check matched the base’s three Knip findings. A separate npm install budget measured 47,950 entries against 47,500. An earlier source build also exceeded that budget. The exact base-to-head entry-count change is unmeasured.