mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-03 11:31:40 +00:00
* feat: teach models to use collapsible details where supported * fix: accept nullable accountId in telegram rich-messages helper * docs: regenerate docs map for collapsible details heading * fix(ci): remove duplicate Codex prewarm test route
46 lines
1.4 KiB
TypeScript
46 lines
1.4 KiB
TypeScript
// Verifies runtime channel capabilities derived from channel account config.
|
|
import { describe, expect, it } from "vitest";
|
|
import { collectRuntimeChannelCapabilities } from "./runtime-capabilities.js";
|
|
|
|
describe("collectRuntimeChannelCapabilities", () => {
|
|
it("advertises markdown details for internal webchat", () => {
|
|
expect(collectRuntimeChannelCapabilities({ channel: "webchat" })).toEqual(["markdownDetails"]);
|
|
});
|
|
|
|
it("does not advertise markdown details for a plugin-less non-webchat channel", () => {
|
|
expect(collectRuntimeChannelCapabilities({ channel: "heartbeat" })).toBeUndefined();
|
|
});
|
|
|
|
it("adds thread-bound spawn capabilities when the channel account allows unified spawns", () => {
|
|
const capabilities = collectRuntimeChannelCapabilities({
|
|
channel: "discord",
|
|
accountId: "default",
|
|
cfg: {
|
|
session: {
|
|
threadBindings: {
|
|
spawnSessions: true,
|
|
},
|
|
},
|
|
},
|
|
});
|
|
|
|
expect(capabilities).toEqual(["threadbound-subagent-spawn", "threadbound-acp-spawn"]);
|
|
});
|
|
|
|
it("omits thread-bound spawn capabilities when unified spawns are disabled", () => {
|
|
const capabilities = collectRuntimeChannelCapabilities({
|
|
channel: "discord",
|
|
accountId: "default",
|
|
cfg: {
|
|
session: {
|
|
threadBindings: {
|
|
spawnSessions: false,
|
|
},
|
|
},
|
|
},
|
|
});
|
|
|
|
expect(capabilities).toBeUndefined();
|
|
});
|
|
});
|