feat(v2/telegram): send pairing-success confirmation to paired chat

After a Telegram pair-code is successfully consumed, send a one-shot
"Pairing success! I'm spinning up the agent now, you'll get a message
from them shortly." reply to the same chat so the user knows the code
was accepted before the agent's own welcome DM arrives.

Best-effort: any sendMessage failure is logged but not rethrown, so a
Telegram outage can't undo a successful pairing or trigger the
interceptor's fail-open path.

Also includes a no-op prettier reformat in chat-sdk-bridge.ts that the
husky hook missed in the previous commit.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Koshkoshinsk
2026-04-15 07:59:17 +00:00
parent ed5dc5ea51
commit c483860cd9
2 changed files with 30 additions and 4 deletions

View File

@@ -124,9 +124,7 @@ export function createChatSdkBridge(config: ChatSdkBridgeConfig): ChannelAdapter
// Project chat-sdk's nested author into the flat sender fields the router
// expects (see src/router.ts extractAndUpsertUser). Native adapters already
// populate these directly; this brings chat-sdk adapters in line.
const author = serialized.author as
| { userId?: string; fullName?: string; userName?: string }
| undefined;
const author = serialized.author as { userId?: string; fullName?: string; userName?: string } | undefined;
if (author) {
const name = author.fullName ?? author.userName;
serialized.senderId = author.userId;