fix(plugins): gate runtime provider discovery by plugins.allow#76085
fix(plugins): gate runtime provider discovery by plugins.allow#76085dougbtv wants to merge 2 commits intoopenclaw:mainfrom
Conversation
|
Codex review: needs changes before merge. Summary Reproducibility: yes. A high-confidence source-level reproduction exists on current main: configure a restrictive Next step before merge Security Review findings
Review detailsBest possible solution: Land the default-preserving Do we have a high-confidence way to reproduce the issue? Yes. A high-confidence source-level reproduction exists on current main: configure a restrictive Is this the best way to solve the issue? Yes as a direction, but not yet as a shippable patch. The opt-in mode is the narrow maintainable fix because it preserves legacy defaults while using existing activation seams; it needs docs/changelog coverage before merge. Full review comments:
Overall correctness: patch is incorrect Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 0b09cfb8cd24. |
…llowlist When plugins.bundledMode is set to "respect-allow", runtime provider discovery paths honor plugins.allow for bundled plugins instead of force-loading all providers. Default "compat" preserves existing behavior. Closes openclaw#75575
Addresses review feedback: adds bundledMode to the strict plugins zod object so the config option passes validation, and adds schema.help documentation for the field.
d106fc7 to
c45ec3d
Compare
|
Thanks for the thorough review. Addressed both P2 findings: P2: Register bundledMode in config validation — Fixed in c45ec3d. Added P2: Gate web provider runtime paths — Already covered by the existing patch. The web provider paths ( Also rebased onto latest |
martingarramon
left a comment
There was a problem hiding this comment.
Solid layered fix — the 4 enforcement sites (providers.ts:265,322, activation-context.ts:84, bundled-compat.ts:9,46) are consistent on the bundledMode === "respect-allow" check, default "compat" keeps existing behavior intact. ✓
Two non-blocking questions:
-
Empty-allow +
respect-allowasymmetry.activation-context.ts:80-83gatesrespectAllowonoriginalAllow.length > 0, so{ bundledMode: "respect-allow", allow: [] }falls through and adds every discovered plugin ID to the allow set. Butbundled-compat.ts:9-12short-circuits unconditionally onrespect-allow. The two files disagree on what "empty allow + respect-allow" means —activation-contextreads as "allow everything",bundled-compatreads as "inject nothing". Intentional? If so, a one-line note locks the contract; if not, alignment tightens the boundary. -
Long-term default plan. PR body calls
"compat"legacy behavior. Does the migration eventually flip the default to"respect-allow", or is opt-in permanent? Affects downstream docs framing — the gap stays open for any user who never reads about the new flag.
CI failures on current head match the SIGTERM-class infra noise hitting other PRs today; re-trigger before merge.
|
Checked the two CI failures ( |
|
Thanks for the thorough review @martingarramon — both great questions. 1. Empty-allow + respect-allow asymmetry. Intentional — the two files answer different questions. 2. Long-term default plan. |
|
Yes, please add the contract note — locks the asymmetry as deliberate so future "fix" PRs don't try to symmetrize it. The operational-control framing also answers my second question — agreed CI infra distinction noted; the changed-code paths going green is what I was after. |
|
Closing this as superseded by #77194. #77194 carries the same core fix for #75575, plus the missing public docs/generated config surface, doctor migration/warning coverage, web provider public-artifact fallback coverage, and current CI is green on that head. The remaining review work should stay on #77194 rather than split across two PRs. Current blockers there are narrow:
Thanks @dougbtv for the original report and implementation work; the follow-up PR keeps that path moving with the broader docs/doctor/schema coverage. |
Summary
plugins.bundledMode: "respect-allow"config option that makes runtime provider plugin discovery honorplugins.allowfor bundled plugins"compat"preserves existing force-load-all behavior for backwards compatibilityRoot cause:
isProviderPluginEligibleForSetupDiscovery()short-circuits totruefor allorigin: "bundled"plugins without checking the allowlist. ThenwithActivatedPluginIds()unconditionally adds every discovered plugin ID toconfig.plugins.allow, blowing open any user-set allowlist. Together these cause all ~12 bundled provider plugins to load on every first message regardless of the user'splugins.allowsetting.Fix layers:
providers.ts— threadshouldFilterBundledByAllowlistinto discovery eligibility, derived frombundledMode === "respect-allow"activation-context.ts— don't add plugin IDs to allow set that aren't already in the user's allowlist whenrespect-allowbundled-compat.ts— skip compat allowlist/enablement injection whenrespect-allowtypes.plugins.ts— addbundledModefield toPluginsConfigTest plan
models-config.providers.plugin-allowlist-compat.test.tspasses (3/3) — compat behavior preservedrespect-allowmode returns only allowed plugins fromresolveEnabledProviderPluginIdsrespect-allowfilters bundled plugins inresolveDiscoveredProviderPluginIdspnpm build— no new errors in changed filesoxfmtCloses #75575
🤖 Generated with Claude Code