





















@@ -1202,6 +1202,9 @@ export async function dispatchReplyFromConfig(
12021202 ctx,
12031203sessionKey: acpDispatchSessionKey,
12041204});
1205+// Inherited sessions_send routes carry thread ids only when the stored route
1206+// proves the thread came from an explicit target, not session normalization.
1207+const routeReplyThreadId = replyRoute.threadId ?? routeThreadId;
12051208const inboundAudio = isInboundAudioContext(ctx);
12061209const sessionTtsAuto = normalizeTtsAutoMode(sessionStoreEntry.entry?.ttsAuto);
12071210const workspaceDir = resolveAgentWorkspaceDir(cfg, sessionAgentId);
@@ -1400,10 +1403,12 @@ export async function dispatchReplyFromConfig(
14001403const normalizedProviderChannel = normalizeMessageChannel(ctx.Provider);
14011404const normalizedSurfaceChannel = normalizeMessageChannel(ctx.Surface);
14021405const normalizedCurrentSurface = normalizedProviderChannel ?? normalizedSurfaceChannel;
1406+const effectiveExplicitDeliverRoute =
1407+ctx.ExplicitDeliverRoute === true || replyRoute.inheritedExternalRoute === true;
14031408const isInternalWebchatTurn =
14041409normalizedCurrentSurface === INTERNAL_MESSAGE_CHANNEL &&
14051410(normalizedSurfaceChannel === INTERNAL_MESSAGE_CHANNEL || !normalizedSurfaceChannel) &&
1406-ctx.ExplicitDeliverRoute !== true;
1411+!effectiveExplicitDeliverRoute;
14071412const hasRouteReplyCandidate = Boolean(
14081413!suppressAcpChildUserDelivery &&
14091414!isInternalWebchatTurn &&
@@ -1420,7 +1425,7 @@ export async function dispatchReplyFromConfig(
14201425} = resolveReplyRoutingDecision({
14211426provider: ctx.Provider,
14221427surface: ctx.Surface,
1423-explicitDeliverRoute: ctx.ExplicitDeliverRoute,
1428+explicitDeliverRoute: effectiveExplicitDeliverRoute,
14241429originatingChannel: replyRoute.channel,
14251430originatingTo: replyRoute.to,
14261431suppressDirectUserDelivery: suppressAcpChildUserDelivery,
@@ -1489,7 +1494,7 @@ export async function dispatchReplyFromConfig(
14891494requesterSenderName: ctx.SenderName,
14901495requesterSenderUsername: ctx.SenderUsername,
14911496requesterSenderE164: ctx.SenderE164,
1492-threadId: routeThreadId,
1497+threadId: routeReplyThreadId,
14931498 cfg,
14941499abortSignal: options?.abortSignal,
14951500mirror: options?.mirror,
@@ -2161,6 +2166,8 @@ export async function dispatchReplyFromConfig(
21612166 shouldRouteToOriginating,
21622167originatingChannel: routeReplyChannel,
21632168originatingTo: routeReplyTo,
2169+originatingAccountId: replyRoute.accountId,
2170+originatingThreadId: routeReplyThreadId,
21642171 shouldSendToolSummaries,
21652172 sendPolicy,
21662173}),
@@ -2797,6 +2804,8 @@ export async function dispatchReplyFromConfig(
27972804 shouldRouteToOriginating,
27982805originatingChannel: routeReplyChannel,
27992806originatingTo: routeReplyTo,
2807+originatingAccountId: replyRoute.accountId,
2808+originatingThreadId: routeReplyThreadId,
28002809 shouldSendToolSummaries,
28012810 sendPolicy,
28022811isTailDispatch: true,
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。