From a1553c96fd6fb9ddec7d4491c22187c20e0ef8a0 Mon Sep 17 00:00:00 2001 From: Alexander Chen Date: Fri, 5 Jun 2026 21:31:48 -0700 Subject: [PATCH] test(telegram): restore DM binding regression test alongside suppression test ClawSweeper review flagged that the new suppressReply test replaced the existing direct-message binding regression test instead of being added beside it. Restore the DM binding test to maintain coverage for the plugin command dispatch surface. --- extensions/telegram/src/bot-native-commands.test.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/extensions/telegram/src/bot-native-commands.test.ts b/extensions/telegram/src/bot-native-commands.test.ts index cbbd1f3e5b6c..695d528aa679 100644 --- a/extensions/telegram/src/bot-native-commands.test.ts +++ b/extensions/telegram/src/bot-native-commands.test.ts @@ -798,6 +798,19 @@ describe("registerTelegramNativeCommands", () => { expect(commandParams.messageThreadId).toBe(1); }); + it("forwards direct-message binding context to Telegram plugin commands", async () => { + const { handler } = registerPlugCommand(); + + await handler(createPrivateCommandContext({ chatId: 100, userId: 200 })); + + const commandParams = firstExecutePluginCommandParams(); + expect(commandParams.channel).toBe("telegram"); + expect(commandParams.accountId).toBe("default"); + expect(commandParams.from).toBe("telegram:100"); + expect(commandParams.to).toBe("telegram:100"); + expect(commandParams.messageThreadId).toBeUndefined(); + }); + it("suppresses the fallback reply when a plugin command returns suppressReply: true", async () => { const { handler } = registerPlugCommand({ result: { suppressReply: true },