




























@@ -754,6 +754,12 @@ export async function dispatchReplyFromConfig(
754754 suppressHookUserDelivery,
755755 suppressHookReplyLifecycle,
756756} = sourceReplyPolicy;
757+const attachSourceReplyDeliveryMode = (
758+result: DispatchFromConfigResult,
759+): DispatchFromConfigResult =>
760+sourceReplyDeliveryMode === "message_tool_only"
761+ ? { ...result, sourceReplyDeliveryMode }
762+ : result;
757763758764let pluginFallbackReason:
759765| "plugin-bound-fallback-missing-plugin"
@@ -797,7 +803,10 @@ export async function dispatchReplyFromConfig(
797803markIdle("plugin_binding_dispatch");
798804recordProcessed("completed", { reason: "plugin-bound-handled" });
799805commitInboundDedupeIfClaimed();
800-return { queuedFinal: false, counts: dispatcher.getQueuedCounts() };
806+return attachSourceReplyDeliveryMode({
807+queuedFinal: false,
808+counts: dispatcher.getQueuedCounts(),
809+});
801810}
802811case "missing_plugin":
803812case "no_handler": {
@@ -824,7 +833,10 @@ export async function dispatchReplyFromConfig(
824833markIdle("plugin_binding_declined");
825834recordProcessed("completed", { reason: "plugin-bound-declined" });
826835commitInboundDedupeIfClaimed();
827-return { queuedFinal: false, counts: dispatcher.getQueuedCounts() };
836+return attachSourceReplyDeliveryMode({
837+queuedFinal: false,
838+counts: dispatcher.getQueuedCounts(),
839+});
828840}
829841case "error": {
830842logVerbose(
@@ -837,7 +849,10 @@ export async function dispatchReplyFromConfig(
837849markIdle("plugin_binding_error");
838850recordProcessed("completed", { reason: "plugin-bound-error" });
839851commitInboundDedupeIfClaimed();
840-return { queuedFinal: false, counts: dispatcher.getQueuedCounts() };
852+return attachSourceReplyDeliveryMode({
853+queuedFinal: false,
854+counts: dispatcher.getQueuedCounts(),
855+});
841856}
842857}
843858}
@@ -910,7 +925,7 @@ export async function dispatchReplyFromConfig(
910925recordProcessed("completed", { reason: "fast_abort" });
911926markIdle("message_completed");
912927commitInboundDedupeIfClaimed();
913-return { queuedFinal, counts };
928+return attachSourceReplyDeliveryMode({ queuedFinal, counts });
914929}
915930916931const isSlackNonDirectSurface =
@@ -989,7 +1004,7 @@ export async function dispatchReplyFromConfig(
9891004recordProcessed("completed", { reason: "before_dispatch_handled" });
9901005markIdle("message_completed");
9911006commitInboundDedupeIfClaimed();
992-return { queuedFinal, counts };
1007+return attachSourceReplyDeliveryMode({ queuedFinal, counts });
9931008}
9941009}
9951010@@ -1023,10 +1038,10 @@ export async function dispatchReplyFromConfig(
10231038);
10241039if (replyDispatchResult?.handled) {
10251040commitInboundDedupeIfClaimed();
1026-return {
1041+return attachSourceReplyDeliveryMode({
10271042queuedFinal: replyDispatchResult.queuedFinal,
10281043counts: replyDispatchResult.counts,
1029-};
1044+});
10301045}
10311046}
10321047@@ -1443,10 +1458,10 @@ export async function dispatchReplyFromConfig(
14431458},
14441459);
14451460if (tailDispatchResult?.handled) {
1446-return {
1461+return attachSourceReplyDeliveryMode({
14471462queuedFinal: tailDispatchResult.queuedFinal,
14481463counts: tailDispatchResult.counts,
1449-};
1464+});
14501465}
14511466}
14521467}
@@ -1535,7 +1550,7 @@ export async function dispatchReplyFromConfig(
15351550pluginFallbackReason ? { reason: pluginFallbackReason } : undefined,
15361551);
15371552markIdle("message_completed");
1538-return { queuedFinal, counts };
1553+return attachSourceReplyDeliveryMode({ queuedFinal, counts });
15391554} catch (err) {
15401555if (inboundDedupeClaim.status === "claimed") {
15411556if (inboundDedupeReplayUnsafe) {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。