


























11// Tests reply payload helper behavior and delivery metadata.
2-import { describe, expect, it } from "vitest";
2+import { describe, expect, it, vi } from "vitest";
33import { resetPluginRuntimeStateForTest, setActivePluginRegistry } from "../../plugins/runtime.js";
44import { createOutboundTestPlugin, createTestRegistry } from "../../test-utils/channel-plugins.js";
55import { getReplyPayloadMetadata, setReplyPayloadMetadata } from "../reply-payload.js";
@@ -26,6 +26,17 @@ function targetsMatchTelegramReplySuppression(params: {
2626);
2727}
282829+vi.mock("../../channels/plugins/bundled.js", () => ({
30+getBundledChannelPlugin: (channel: string) =>
31+channel === "telegram"
32+ ? {
33+outbound: {
34+targetsMatchForReplySuppression: targetsMatchTelegramReplySuppression,
35+},
36+}
37+ : undefined,
38+}));
39+2940describe("filterMessagingToolMediaDuplicates", () => {
3041it("strips mediaUrl when it matches sentMediaUrls", () => {
3142const result = filterMessagingToolMediaDuplicates({
@@ -251,7 +262,7 @@ describe("shouldDedupeMessagingToolRepliesForRoute", () => {
251262).toBe(true);
252263});
253264254-it("uses generic route matching when the active plugin registry omits telegram", () => {
265+it("matches telegram replies even when the active plugin registry omits telegram", () => {
255266resetPluginRuntimeStateForTest();
256267setActivePluginRegistry(createTestRegistry([]));
257268@@ -263,7 +274,7 @@ describe("shouldDedupeMessagingToolRepliesForRoute", () => {
263274{ tool: "message", provider: "telegram", to: "-100123", threadId: "77" },
264275],
265276}),
266-).toBe(false);
277+).toBe(true);
267278});
268279});
269280此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。