fix: cover channels.modelByChannel validation/auto-enable

This commit is contained in:
Peter Steinberger
2026-02-22 10:24:59 +01:00
parent d79f10297f
commit 6dad6a8cd0
2 changed files with 34 additions and 0 deletions

View File

@@ -16,6 +16,25 @@ describe("applyPluginAutoEnable", () => {
expect(result.changes.join("\n")).toContain("Slack configured, enabled automatically.");
});
it("ignores channels.modelByChannel for plugin auto-enable", () => {
const result = applyPluginAutoEnable({
config: {
channels: {
modelByChannel: {
openai: {
whatsapp: "openai/gpt-5.2",
},
},
},
},
env: {},
});
expect(result.config.plugins?.entries?.modelByChannel).toBeUndefined();
expect(result.config.plugins?.allow).toBeUndefined();
expect(result.changes).toEqual([]);
});
it("respects explicit disable", () => {
const result = applyPluginAutoEnable({
config: {