mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-01 22:50:20 +00:00
fix: sync built-in channel enablement across config paths
This commit is contained in:
@@ -32,12 +32,12 @@ describe("enablePluginInConfig", () => {
|
||||
expect(result.reason).toBe("blocked by denylist");
|
||||
});
|
||||
|
||||
it("writes built-in channels to channels.<id>.enabled instead of plugins.entries", () => {
|
||||
it("writes built-in channels to channels.<id>.enabled and plugins.entries", () => {
|
||||
const cfg: OpenClawConfig = {};
|
||||
const result = enablePluginInConfig(cfg, "telegram");
|
||||
expect(result.enabled).toBe(true);
|
||||
expect(result.config.channels?.telegram?.enabled).toBe(true);
|
||||
expect(result.config.plugins?.entries?.telegram).toBeUndefined();
|
||||
expect(result.config.plugins?.entries?.telegram?.enabled).toBe(true);
|
||||
});
|
||||
|
||||
it("adds built-in channel id to allowlist when allowlist is configured", () => {
|
||||
@@ -51,4 +51,25 @@ describe("enablePluginInConfig", () => {
|
||||
expect(result.config.channels?.telegram?.enabled).toBe(true);
|
||||
expect(result.config.plugins?.allow).toEqual(["memory-core", "telegram"]);
|
||||
});
|
||||
|
||||
it("re-enables built-in channels after explicit plugin-level disable", () => {
|
||||
const cfg: OpenClawConfig = {
|
||||
channels: {
|
||||
telegram: {
|
||||
enabled: true,
|
||||
},
|
||||
},
|
||||
plugins: {
|
||||
entries: {
|
||||
telegram: {
|
||||
enabled: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
const result = enablePluginInConfig(cfg, "telegram");
|
||||
expect(result.enabled).toBe(true);
|
||||
expect(result.config.channels?.telegram?.enabled).toBe(true);
|
||||
expect(result.config.plugins?.entries?.telegram?.enabled).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user