fix: Chat SDK bridge delivery and typing for non-Discord adapters
- Use platformId directly as thread ID in deliver() and setTyping() instead of calling encodeThreadId with Discord-shaped args — platformId is already in the adapter's encoded format (e.g. "telegram:6037840640") - Add triggerTyping() in delivery.ts, call from router on message route - Enable Telegram channel in barrel - Verified E2E: Telegram message in → agent → typing indicator → response Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -162,7 +162,9 @@ export function createChatSdkBridge(config: ChatSdkBridgeConfig): ChannelAdapter
|
||||
},
|
||||
|
||||
async deliver(platformId: string, threadId: string | null, message) {
|
||||
const tid = threadId ?? adapter.encodeThreadId({ guildId: '', channelId: platformId } as never);
|
||||
// platformId is already in the adapter's encoded format (e.g. "telegram:6037840640",
|
||||
// "discord:guildId:channelId") — use it directly as the thread ID
|
||||
const tid = threadId ?? platformId;
|
||||
const content = message.content as Record<string, unknown>;
|
||||
|
||||
if (content.operation === 'edit' && content.messageId) {
|
||||
@@ -210,7 +212,7 @@ export function createChatSdkBridge(config: ChatSdkBridgeConfig): ChannelAdapter
|
||||
},
|
||||
|
||||
async setTyping(platformId: string, threadId: string | null) {
|
||||
const tid = threadId ?? adapter.encodeThreadId({ guildId: '', channelId: platformId } as never);
|
||||
const tid = threadId ?? platformId;
|
||||
await adapter.startTyping(tid);
|
||||
},
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import './discord.js';
|
||||
// import './slack.js';
|
||||
|
||||
// telegram
|
||||
// import './telegram.js';
|
||||
import './telegram.js';
|
||||
|
||||
// github
|
||||
// import './github.js';
|
||||
|
||||
Reference in New Issue
Block a user