Skip to content

Commit 13a079b

Browse files
fix(telegram): expose thread create CLI remap
Exposes Telegram's thread-create CLI remap through the exported Telegram channel action adapter, preserving the existing plugin-owned mapping to topic-create before gateway dispatch.\n\nFixes #81581.\n\nProof: local focused format/lint/Vitest and dry-run; autoreview clean; Crabbox AWS run_07b98c939fce focused tests; Crabbox AWS run_1b7b35ce1de1 check:changed; exact-head GitHub CI green on 16f6afb.
1 parent e58310b commit 13a079b

2 files changed

Lines changed: 30 additions & 0 deletions

File tree

extensions/telegram/src/channel-actions.contract.test.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,26 @@ describe("telegram actions contract", () => {
3636

3737
expect(capabilities).toContain("richText");
3838
});
39+
40+
it("exposes Telegram thread create CLI remapping through the exported plugin", () => {
41+
const request = telegramPlugin.actions?.resolveCliActionRequest?.({
42+
action: "thread-create",
43+
args: {
44+
channel: "telegram",
45+
target: "-1003894873578",
46+
threadName: "Build Updates",
47+
message: "hello",
48+
},
49+
});
50+
51+
expect(request).toEqual({
52+
action: "topic-create",
53+
args: {
54+
channel: "telegram",
55+
target: "-1003894873578",
56+
name: "Build Updates",
57+
message: "hello",
58+
},
59+
});
60+
});
3961
});

extensions/telegram/src/channel.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,14 @@ const telegramMessageActions: ChannelMessageActionAdapter = {
277277
getOptionalTelegramRuntime()?.channel?.telegram?.messageActions?.describeMessageTool?.(ctx) ??
278278
telegramMessageActionsImpl.describeMessageTool?.(ctx) ??
279279
null,
280+
resolveCliActionRequest: (ctx) =>
281+
getOptionalTelegramRuntime()?.channel?.telegram?.messageActions?.resolveCliActionRequest?.(
282+
ctx,
283+
) ??
284+
telegramMessageActionsImpl.resolveCliActionRequest?.(ctx) ?? {
285+
action: ctx.action,
286+
args: ctx.args,
287+
},
280288
extractToolSend: (ctx) =>
281289
getOptionalTelegramRuntime()?.channel?.telegram?.messageActions?.extractToolSend?.(ctx) ??
282290
telegramMessageActionsImpl.extractToolSend?.(ctx) ??

0 commit comments

Comments
 (0)