mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-22 06:32:00 +00:00
fix(config): keep built-in channels out of plugin allowlists (#52964)
* fix(config): keep built-in channels out of plugin allowlists * docs(changelog): note doctor whatsapp allowlist fix * docs(changelog): move doctor whatsapp fix to top
This commit is contained in:
@@ -127,12 +127,12 @@ afterEach(() => {
|
||||
});
|
||||
|
||||
describe("applyPluginAutoEnable", () => {
|
||||
it("auto-enables built-in channels and appends to existing allowlist", () => {
|
||||
it("auto-enables built-in channels without appending to plugins.allow", () => {
|
||||
const result = applyWithSlackConfig({ plugins: { allow: ["telegram"] } });
|
||||
|
||||
expect(result.config.channels?.slack?.enabled).toBe(true);
|
||||
expect(result.config.plugins?.entries?.slack).toBeUndefined();
|
||||
expect(result.config.plugins?.allow).toEqual(["telegram", "slack"]);
|
||||
expect(result.config.plugins?.allow).toEqual(["telegram"]);
|
||||
expect(result.changes.join("\n")).toContain("Slack configured, enabled automatically.");
|
||||
});
|
||||
|
||||
@@ -179,6 +179,27 @@ describe("applyPluginAutoEnable", () => {
|
||||
expect(validated.ok).toBe(true);
|
||||
});
|
||||
|
||||
it("does not append built-in WhatsApp to plugins.allow during auto-enable", () => {
|
||||
const result = applyPluginAutoEnable({
|
||||
config: {
|
||||
channels: {
|
||||
whatsapp: {
|
||||
allowFrom: ["+15555550123"],
|
||||
},
|
||||
},
|
||||
plugins: {
|
||||
allow: ["telegram"],
|
||||
},
|
||||
},
|
||||
env: {},
|
||||
});
|
||||
|
||||
expect(result.config.channels?.whatsapp?.enabled).toBe(true);
|
||||
expect(result.config.plugins?.allow).toEqual(["telegram"]);
|
||||
const validated = validateConfigObject(result.config);
|
||||
expect(validated.ok).toBe(true);
|
||||
});
|
||||
|
||||
it("respects explicit disable", () => {
|
||||
const result = applyPluginAutoEnable({
|
||||
config: {
|
||||
|
||||
@@ -478,7 +478,7 @@ export function applyPluginAutoEnable(params: {
|
||||
continue;
|
||||
}
|
||||
next = registerPluginEntry(next, entry.pluginId);
|
||||
if (allowMissing || !builtInChannelId) {
|
||||
if (!builtInChannelId) {
|
||||
next = ensurePluginAllowlisted(next, entry.pluginId);
|
||||
}
|
||||
changes.push(formatAutoEnableChange(entry));
|
||||
|
||||
Reference in New Issue
Block a user