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

@@ -147,6 +147,21 @@ describe("config plugin validation", () => {
expect(res.ok).toBe(true);
});
it("accepts channels.modelByChannel", async () => {
const home = await createCaseHome();
const res = validateInHome(home, {
agents: { list: [{ id: "pi" }] },
channels: {
modelByChannel: {
openai: {
whatsapp: "openai/gpt-5.2",
},
},
},
});
expect(res.ok).toBe(true);
});
it("accepts plugin heartbeat targets", async () => {
const home = await createCaseHome();
const pluginDir = path.join(home, "bluebubbles-plugin");

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: {