Skip to content

Commit 4da7e33

Browse files
committed
test(channels): assert Discord and Telegram declare their stream-mode rule
The relay test stubs the plugin registry, so a missing declaration on the shipped channels would still pass. These assert the plugin bases themselves carry the rule and that an explicit mode still wins.
1 parent e191df5 commit 4da7e33

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

‎extensions/discord/src/shared.test.ts‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ afterEach(() => {
77
vi.unstubAllEnvs();
88
});
99

10+
describe("discord streaming adapter", () => {
11+
it("declares the channel's progress default for core mode resolution", () => {
12+
const plugin = createDiscordPluginBase({ setup: {} as never });
13+
const resolve = plugin.streaming?.resolvePreviewStreamMode;
14+
expect(resolve?.({})).toBe("progress");
15+
expect(resolve?.({ streaming: { mode: "off" } })).toBe("off");
16+
});
17+
});
18+
1019
describe("createDiscordPluginBase", () => {
1120
it("owns Discord native command name overrides", () => {
1221
const plugin = createDiscordPluginBase({ setup: {} as never });

‎extensions/telegram/src/shared.test.ts‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,17 @@ function resolveAccount(cfg: OpenClawConfig, accountId: string): ResolvedTelegra
2828
return telegramPluginBase.config.resolveAccount(cfg, accountId);
2929
}
3030

31+
describe("telegram streaming adapter", () => {
32+
it("declares the channel's progress default for core mode resolution", () => {
33+
// Core relays (ACP parent stream) ask the plugin for this instead of
34+
// assuming the core "partial" default; a missing declaration silently
35+
// downgrades those paths.
36+
const resolve = telegramPluginBase.streaming?.resolvePreviewStreamMode;
37+
expect(resolve?.({})).toBe("progress");
38+
expect(resolve?.({ streaming: { mode: "off" } })).toBe("off");
39+
});
40+
});
41+
3142
describe("createTelegramPluginBase config duplicate token guard", () => {
3243
it("wires the top-level models menu adapter into the production plugin", () => {
3344
const channelData = telegramPluginBase.commands?.buildModelsMenuChannelData?.({

0 commit comments

Comments
 (0)