Skip to content

Commit 41257a5

Browse files
committed
fix(plugins): rename bundled allowlist discovery policy
1 parent 76e0bcd commit 41257a5

20 files changed

Lines changed: 114 additions & 63 deletions
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ddea4f1ae40a4099baa9f216cdae69ac35a5e93aa254903227ce168e2fd5b8db config-baseline.json
2-
b6b71095384ad98410bbfd520eebac43e244aeb47761c74325ff133be6ccd858 config-baseline.core.json
1+
14558f9777b400fe4a1ef163a44e90ac0c59b56920ceb24b99675647d19d73a8 config-baseline.json
2+
0c46cd7aeae83eb3afddd19209bf3520cecccc265903b2fe001ce458bc592ea5 config-baseline.core.json
33
cd7c0c7fb1435bc7e59099e9ac334462d5ad444016e9ab4512aae63a238f78dc config-baseline.channel.json
44
9832b30a696930a3da7efccf38073137571e1b66cae84e54d747b733fdafcc54 config-baseline.plugin.json

‎docs/gateway/configuration-reference.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ See [MCP](/cli/mcp#openclaw-as-an-mcp-client-registry) and
166166
plugins: {
167167
enabled: true,
168168
allow: ["voice-call"],
169-
bundledMode: "compat",
169+
bundledDiscovery: "compat",
170170
deny: [],
171171
load: {
172172
paths: ["~/Projects/oss/voice-call-plugin"],
@@ -188,8 +188,8 @@ See [MCP](/cli/mcp#openclaw-as-an-mcp-client-registry) and
188188
- Discovery accepts native OpenClaw plugins plus compatible Codex bundles and Claude bundles, including manifestless Claude default-layout bundles.
189189
- **Config changes require a gateway restart.**
190190
- `allow`: optional allowlist (only listed plugins load). `deny` wins.
191-
- `bundledMode`: defaults to `"compat"` for legacy bundled provider activation.
192-
Use `"respect-allow"` when a non-empty `plugins.allow` should also gate
191+
- `bundledDiscovery`: defaults to `"compat"` for legacy bundled provider activation.
192+
Use `"allowlist"` when a non-empty `plugins.allow` should also gate
193193
bundled provider plugins, including web-search runtime providers.
194194
- `plugins.entries.<id>.apiKey`: plugin-level API key convenience field (when supported by the plugin).
195195
- `plugins.entries.<id>.env`: plugin-scoped env var map.

‎docs/gateway/doctor.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,9 @@ That stages grounded durable candidates into the short-term dreaming store while
169169
Doctor also warns when `plugins.allow` is non-empty and tool policy uses
170170
wildcard or plugin-owned tool entries. `tools.allow: ["*"]` only matches tools
171171
from plugins that actually load; it does not bypass the exclusive plugin
172-
allowlist.
172+
allowlist. If bundled provider discovery is still in legacy compatibility
173+
mode, doctor also points to the stricter `plugins.bundledDiscovery:
174+
"allowlist"` setting.
173175

174176
</Accordion>
175177
<Accordion title="2. Legacy config key migrations">

‎docs/tools/plugin.md‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -260,24 +260,24 @@ Looking for third-party plugins? See [Community Plugins](/plugins/community).
260260
}
261261
```
262262

263-
| Field | Description |
264-
| ---------------- | --------------------------------------------------------- |
265-
| `enabled` | Master toggle (default: `true`) |
266-
| `allow` | Plugin allowlist (optional) |
267-
| `bundledMode` | Bundled plugin allowlist mode (`compat` by default) |
268-
| `deny` | Plugin denylist (optional; deny wins) |
269-
| `load.paths` | Extra plugin files/directories |
270-
| `slots` | Exclusive slot selectors (e.g. `memory`, `contextEngine`) |
271-
| `entries.\<id\>` | Per-plugin toggles + config |
263+
| Field | Description |
264+
| ------------------ | --------------------------------------------------------- |
265+
| `enabled` | Master toggle (default: `true`) |
266+
| `allow` | Plugin allowlist (optional) |
267+
| `bundledDiscovery` | Bundled plugin discovery mode (`compat` by default) |
268+
| `deny` | Plugin denylist (optional; deny wins) |
269+
| `load.paths` | Extra plugin files/directories |
270+
| `slots` | Exclusive slot selectors (e.g. `memory`, `contextEngine`) |
271+
| `entries.\<id\>` | Per-plugin toggles + config |
272272

273273
`plugins.allow` is exclusive. When it is non-empty, only listed plugins can load
274274
or expose tools, even if `tools.allow` contains `"*"` or a specific plugin-owned
275275
tool name. If a tool allowlist references plugin tools, add the owning plugin ids
276276
to `plugins.allow` or remove `plugins.allow`; `openclaw doctor` warns about this
277277
shape.
278278

279-
`plugins.bundledMode` defaults to `"compat"` so older configs keep legacy
280-
bundled provider behavior. Set it to `"respect-allow"` when a restrictive
279+
`plugins.bundledDiscovery` defaults to `"compat"` so older configs keep legacy
280+
bundled provider behavior. Set it to `"allowlist"` when a restrictive
281281
`plugins.allow` inventory should also block omitted bundled provider plugins,
282282
including runtime web-search provider discovery. An empty `plugins.allow` is
283283
still treated as unset/open.

‎src/agents/models-config.providers.plugin-allowlist-compat.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,13 @@ describe("implicit provider plugin allowlist compatibility", () => {
8484
).toEqual(["kilocode", "moonshot", "openrouter"]);
8585
});
8686

87-
it("respects allowlist for bundled plugins when bundledMode is respect-allow", () => {
87+
it("respects allowlist for bundled plugins when bundledDiscovery is allowlist", () => {
8888
const config = withBundledPluginEnablementCompat({
8989
config: withBundledPluginAllowlistCompat({
9090
config: {
9191
plugins: {
9292
allow: ["openrouter"],
93-
bundledMode: "respect-allow",
93+
bundledDiscovery: "allowlist",
9494
},
9595
},
9696
pluginIds: ["kilocode", "moonshot"],

‎src/commands/doctor-config-flow.ts‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,15 @@ export async function loadAndMaybeMigrateDoctorConfig(params: {
161161
}));
162162
}
163163

164-
const { collectPluginToolAllowlistWarnings } =
164+
const { collectBundledProviderAllowlistPolicyWarnings, collectPluginToolAllowlistWarnings } =
165165
await import("./doctor/shared/plugin-tool-allowlist-warnings.js");
166-
const pluginToolAllowlistWarnings = collectPluginToolAllowlistWarnings({
167-
cfg: candidate,
168-
env: process.env,
169-
});
166+
const pluginToolAllowlistWarnings = [
167+
...collectPluginToolAllowlistWarnings({
168+
cfg: candidate,
169+
env: process.env,
170+
}),
171+
...collectBundledProviderAllowlistPolicyWarnings({ cfg: candidate }),
172+
];
170173
if (pluginToolAllowlistWarnings.length > 0) {
171174
note(sanitizeDoctorNote(pluginToolAllowlistWarnings.join("\n")), "Doctor warnings");
172175
}

‎src/commands/doctor/shared/plugin-tool-allowlist-warnings.test.ts‎

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { describe, expect, it } from "vitest";
22
import type { PluginManifestRegistry } from "../../../plugins/manifest-registry.js";
3-
import { collectPluginToolAllowlistWarnings } from "./plugin-tool-allowlist-warnings.js";
3+
import {
4+
collectBundledProviderAllowlistPolicyWarnings,
5+
collectPluginToolAllowlistWarnings,
6+
} from "./plugin-tool-allowlist-warnings.js";
47

58
const manifestRegistry: PluginManifestRegistry = {
69
diagnostics: [],
@@ -109,4 +112,29 @@ describe("collectPluginToolAllowlistWarnings", () => {
109112

110113
expect(warnings).toEqual([]);
111114
});
115+
116+
it("warns when restrictive plugins.allow leaves bundled provider discovery in compat mode", () => {
117+
const warnings = collectBundledProviderAllowlistPolicyWarnings({
118+
cfg: {
119+
plugins: { allow: ["telegram"] },
120+
},
121+
});
122+
123+
expect(warnings).toEqual([
124+
expect.stringContaining('set plugins.bundledDiscovery to "allowlist"'),
125+
]);
126+
});
127+
128+
it("does not warn when bundled provider discovery follows the allowlist", () => {
129+
const warnings = collectBundledProviderAllowlistPolicyWarnings({
130+
cfg: {
131+
plugins: {
132+
allow: ["telegram"],
133+
bundledDiscovery: "allowlist",
134+
},
135+
},
136+
});
137+
138+
expect(warnings).toEqual([]);
139+
});
112140
});

‎src/commands/doctor/shared/plugin-tool-allowlist-warnings.ts‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,3 +193,21 @@ export function collectPluginToolAllowlistWarnings(params: {
193193

194194
return warnings;
195195
}
196+
197+
export function collectBundledProviderAllowlistPolicyWarnings(params: {
198+
cfg: OpenClawConfig;
199+
}): string[] {
200+
if (params.cfg.plugins?.enabled === false) {
201+
return [];
202+
}
203+
const allow = params.cfg.plugins?.allow;
204+
if (!Array.isArray(allow) || allow.length === 0) {
205+
return [];
206+
}
207+
if (params.cfg.plugins?.bundledDiscovery === "allowlist") {
208+
return [];
209+
}
210+
return [
211+
'- plugins.allow is restrictive, but bundled provider discovery is still in legacy compatibility mode. Bundled provider plugins can still appear in runtime provider inventories; set plugins.bundledDiscovery to "allowlist" after confirming omitted bundled providers are intentionally blocked.',
212+
];
213+
}

‎src/config/schema.base.generated.ts‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24186,12 +24186,12 @@ export const GENERATED_BASE_CONFIG_SCHEMA: BaseConfigSchemaResponse = {
2418624186
description:
2418724187
"Per-plugin settings keyed by plugin ID including enablement and plugin-specific runtime configuration payloads. Use this for scoped plugin tuning without changing global loader policy.",
2418824188
},
24189-
bundledMode: {
24189+
bundledDiscovery: {
2419024190
type: "string",
24191-
enum: ["compat", "respect-allow"],
24192-
title: "Bundled Plugin Mode",
24191+
enum: ["compat", "allowlist"],
24192+
title: "Bundled Plugin Discovery",
2419324193
description:
24194-
'Controls whether bundled plugins bypass plugins.allow on runtime discovery paths. "compat" (default) preserves legacy behavior where bundled provider plugins are force-loaded on every chat turn. "respect-allow" gates bundled plugins by the allowlist the same way third-party plugins are gated.',
24194+
'Controls bundled plugin runtime discovery when plugins.allow is configured. "compat" (default) preserves legacy behavior where bundled provider plugins can be force-loaded on every chat turn. "allowlist" gates bundled provider plugins by plugins.allow like third-party plugins.',
2419524195
},
2419624196
},
2419724197
additionalProperties: false,
@@ -28872,9 +28872,9 @@ export const GENERATED_BASE_CONFIG_SCHEMA: BaseConfigSchemaResponse = {
2887228872
help: "Optional allowlist of plugin IDs; when set, only listed plugins are eligible to load. Configured bundled chat channels can still activate their bundled plugin when the channel is explicitly enabled in config. Use this to enforce approved extension inventories in controlled environments.",
2887328873
tags: ["access"],
2887428874
},
28875-
"plugins.bundledMode": {
28876-
label: "Bundled Plugin Mode",
28877-
help: 'Controls whether bundled plugins bypass plugins.allow on runtime discovery paths. "compat" (default) preserves legacy behavior where bundled provider plugins are force-loaded on every chat turn. "respect-allow" gates bundled plugins by the allowlist the same way third-party plugins are gated.',
28875+
"plugins.bundledDiscovery": {
28876+
label: "Bundled Plugin Discovery",
28877+
help: 'Controls bundled plugin runtime discovery when plugins.allow is configured. "compat" (default) preserves legacy behavior where bundled provider plugins can be force-loaded on every chat turn. "allowlist" gates bundled provider plugins by plugins.allow like third-party plugins.',
2887828878
tags: ["advanced"],
2887928879
},
2888028880
"plugins.deny": {

‎src/config/schema.help.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1212,8 +1212,8 @@ export const FIELD_HELP: Record<string, string> = {
12121212
'Select the active memory plugin by id, or "none" to disable memory plugins.',
12131213
"plugins.slots.contextEngine":
12141214
"Selects the active context engine plugin by id so one plugin provides context orchestration behavior.",
1215-
"plugins.bundledMode":
1216-
'Controls whether bundled plugins bypass plugins.allow on runtime discovery paths. "compat" (default) preserves legacy behavior where bundled provider plugins are force-loaded on every chat turn. "respect-allow" gates bundled plugins by the allowlist the same way third-party plugins are gated.',
1215+
"plugins.bundledDiscovery":
1216+
'Controls bundled plugin runtime discovery when plugins.allow is configured. "compat" (default) preserves legacy behavior where bundled provider plugins can be force-loaded on every chat turn. "allowlist" gates bundled provider plugins by plugins.allow like third-party plugins.',
12171217
"plugins.entries":
12181218
"Per-plugin settings keyed by plugin ID including enablement and plugin-specific runtime configuration payloads. Use this for scoped plugin tuning without changing global loader policy.",
12191219
"plugins.entries.*.enabled":

0 commit comments

Comments
 (0)