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
2026-01-06 12:12:11 -08:00
committed by Peter Steinberger
parent 9d50ebad7d
commit 2d67ec5bfa
4 changed files with 79 additions and 7 deletions

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,