Extensions: stabilize telegram registry contracts

This commit is contained in:
Gustavo Madeira Santana
2026-03-29 21:41:41 -04:00
parent e92440e9f4
commit f44174cf61
4 changed files with 23 additions and 21 deletions

View File

@@ -176,7 +176,6 @@ function expectClearedSessionBinding(params: {
).toBeNull();
}
const telegramDescribeMessageToolMock = vi.fn();
const discordDescribeMessageToolMock = vi.fn();
const sendMessageMatrixMock = vi.hoisted(() =>
vi.fn(async (to: string, _message: string, opts?: { threadId?: string }) => ({
@@ -185,16 +184,6 @@ const sendMessageMatrixMock = vi.hoisted(() =>
})),
);
setBundledChannelRuntime("telegram", {
channel: {
telegram: {
messageActions: {
describeMessageTool: telegramDescribeMessageToolMock,
},
},
},
} as never);
setBundledChannelRuntime("discord", {
channel: {
discord: {
@@ -394,17 +383,16 @@ export const actionContractRegistry: ActionsContractEntry[] = [
plugin: requireBundledChannelPlugin("telegram"),
cases: [
{
name: "forwards runtime-backed Telegram actions and capabilities",
cfg: {} as OpenClawConfig,
expectedActions: ["send", "poll", "react"],
name: "exposes configured Telegram actions and capabilities",
cfg: {
channels: {
telegram: {
botToken: "123:telegram-test-token",
},
},
} as OpenClawConfig,
expectedActions: ["send", "poll", "react", "delete", "edit", "topic-create", "topic-edit"],
expectedCapabilities: ["interactive", "buttons"],
beforeTest: () => {
telegramDescribeMessageToolMock.mockReset();
telegramDescribeMessageToolMock.mockReturnValue({
actions: ["send", "poll", "react"],
capabilities: ["interactive", "buttons"],
});
},
},
],
},