diff --git a/groups/global/CLAUDE.md b/groups/global/CLAUDE.md index 11988bc..b3c44c6 100644 --- a/groups/global/CLAUDE.md +++ b/groups/global/CLAUDE.md @@ -1,6 +1,6 @@ -# Andy +# Main -You are Andy, a personal assistant. You help with tasks, answer questions, and can schedule reminders. +You are Main, a personal assistant. You help with tasks, answer questions, and can schedule reminders. ## What You Can Do diff --git a/groups/main/CLAUDE.md b/groups/main/CLAUDE.md index de934f2..c8c0e9f 100644 --- a/groups/main/CLAUDE.md +++ b/groups/main/CLAUDE.md @@ -1,6 +1,6 @@ -# Andy +# Main -You are Andy, a personal assistant. You help with tasks, answer questions, and can schedule reminders. +You are Main, a personal assistant. You help with tasks, answer questions, and can schedule reminders. ## What You Can Do diff --git a/src/channels/chat-sdk-bridge.ts b/src/channels/chat-sdk-bridge.ts index e87e098..1d84b00 100644 --- a/src/channels/chat-sdk-bridge.ts +++ b/src/channels/chat-sdk-bridge.ts @@ -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; 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); }, diff --git a/src/channels/index.ts b/src/channels/index.ts index f01c35a..6efec66 100644 --- a/src/channels/index.ts +++ b/src/channels/index.ts @@ -8,7 +8,7 @@ import './discord.js'; // import './slack.js'; // telegram -// import './telegram.js'; +import './telegram.js'; // github // import './github.js'; diff --git a/src/delivery.ts b/src/delivery.ts index 35a41c2..12676f3 100644 --- a/src/delivery.ts +++ b/src/delivery.ts @@ -42,6 +42,15 @@ export function setDeliveryAdapter(adapter: ChannelDeliveryAdapter): void { deliveryAdapter = adapter; } +/** Show typing indicator on a channel. Called when a message is routed to the agent. */ +export async function triggerTyping(channelType: string, platformId: string, threadId: string | null): Promise { + try { + await deliveryAdapter?.setTyping?.(channelType, platformId, threadId); + } catch { + // Typing is best-effort — don't fail routing if it errors + } +} + /** Start the active container poll loop (~1s). */ export function startActiveDeliveryPoll(): void { if (activePolling) return; diff --git a/src/router.ts b/src/router.ts index e565d9f..658c117 100644 --- a/src/router.ts +++ b/src/router.ts @@ -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 { 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);