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:
gavrielc
2026-04-09 13:36:45 +03:00
parent 57a6491c7e
commit d656b5ccc1
6 changed files with 23 additions and 8 deletions

View File

@@ -5,6 +5,7 @@
* → resolve/create session → write messages_in → wake container
*/
import { getMessagingGroupByPlatform, createMessagingGroup, getMessagingGroupAgents } from './db/messaging-groups.js';
import { triggerTyping } from './delivery.js';
import { log } from './log.js';
import { resolveSession, writeSessionMessage } from './session-manager.js';
import { wakeContainer } from './container-runner.js';
@@ -99,7 +100,10 @@ export async function routeInbound(event: InboundEvent): Promise<void> {
created,
});
// 5. Wake container
// 5. Show typing indicator while agent processes
triggerTyping(event.channelType, event.platformId, event.threadId);
// 6. Wake container
const freshSession = getSession(session.id);
if (freshSession) {
await wakeContainer(freshSession);