Auto-reply: preserve explicit deliver routes for internal webchat turns

This commit is contained in:
Vincent Koc
2026-03-06 00:39:46 -05:00
parent 732d1e5d55
commit 4353207e34

View File

@@ -217,7 +217,8 @@ export async function dispatchReplyFromConfig(params: {
const currentSurface = providerChannel ?? surfaceChannel;
const isInternalWebchatTurn =
currentSurface === INTERNAL_MESSAGE_CHANNEL &&
(surfaceChannel === INTERNAL_MESSAGE_CHANNEL || !surfaceChannel);
(surfaceChannel === INTERNAL_MESSAGE_CHANNEL || !surfaceChannel) &&
ctx.ExplicitDeliverRoute !== true;
const shouldRouteToOriginating = Boolean(
!isInternalWebchatTurn &&
isRoutableChannel(originatingChannel) &&