mirror of
https://github.com/moltbot/moltbot.git
synced 2026-05-13 23:56:07 +00:00
43 lines
1.2 KiB
TypeScript
43 lines
1.2 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { collectRuntimeChannelCapabilities } from "./runtime-capabilities.js";
|
|
|
|
describe("collectRuntimeChannelCapabilities", () => {
|
|
it("adds thread-bound spawn capabilities when the channel account allows unified spawns", () => {
|
|
const capabilities = collectRuntimeChannelCapabilities({
|
|
channel: "discord",
|
|
accountId: "default",
|
|
cfg: {
|
|
channels: {
|
|
discord: {
|
|
threadBindings: {
|
|
spawnSessions: true,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
});
|
|
|
|
expect(capabilities).toContain("threadbound-subagent-spawn");
|
|
expect(capabilities).toContain("threadbound-acp-spawn");
|
|
});
|
|
|
|
it("omits thread-bound spawn capabilities when unified spawns are disabled", () => {
|
|
const capabilities = collectRuntimeChannelCapabilities({
|
|
channel: "discord",
|
|
accountId: "default",
|
|
cfg: {
|
|
channels: {
|
|
discord: {
|
|
threadBindings: {
|
|
spawnSessions: false,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
});
|
|
|
|
expect(capabilities ?? []).not.toContain("threadbound-subagent-spawn");
|
|
expect(capabilities ?? []).not.toContain("threadbound-acp-spawn");
|
|
});
|
|
});
|