11// Tests reply payload helper behavior and delivery metadata.
2- import { describe , expect , it , vi } from "vitest" ;
2+ import { describe , expect , it } 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,17 +26,6 @@ function targetsMatchTelegramReplySuppression(params: {
2626 ) ;
2727}
2828
29- 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-
4029describe ( "filterMessagingToolMediaDuplicates" , ( ) => {
4130 it ( "strips mediaUrl when it matches sentMediaUrls" , ( ) => {
4231 const result = filterMessagingToolMediaDuplicates ( {
@@ -262,7 +251,7 @@ describe("shouldDedupeMessagingToolRepliesForRoute", () => {
262251 ) . toBe ( true ) ;
263252 } ) ;
264253
265- it ( "matches telegram replies even when the active plugin registry omits telegram" , ( ) => {
254+ it ( "uses generic route matching when the active plugin registry omits telegram" , ( ) => {
266255 resetPluginRuntimeStateForTest ( ) ;
267256 setActivePluginRegistry ( createTestRegistry ( [ ] ) ) ;
268257
@@ -274,7 +263,7 @@ describe("shouldDedupeMessagingToolRepliesForRoute", () => {
274263 { tool : "message" , provider : "telegram" , to : "-100123" , threadId : "77" } ,
275264 ] ,
276265 } ) ,
277- ) . toBe ( true ) ;
266+ ) . toBe ( false ) ;
278267 } ) ;
279268} ) ;
280269
0 commit comments