fix(routing): only route to originating channel when cross-provider

When OriginatingChannel matches Surface (same provider), use normal
dispatcher. Only route via routeReply() when they differ, ensuring
cross-provider messages (e.g., Telegram queued while Slack active)
get routed back to their origin.
This commit is contained in:
Josh Lehman authored and Peter Steinberger committed 2026-01-07 04:51:33 +00:00
1 parent 9d50ebad7d
commit 2d67ec5bfa
4 files changed
+79 -7

No files matched your search

+1
View File
@@ -823,6 +823,7 @@ export async function monitorSlackProvider(opts: MonitorSlackOpts = {}) {
SenderName: senderName,
SenderId: message.user,
Provider: "slack" as const,
Surface: "slack" as const,
MessageSid: message.ts,
ReplyToId: message.thread_ts ?? message.ts,
Timestamp: message.ts ? Math.round(Number(message.ts) * 1000) : undefined,