@@ -51,6 +51,11 @@ const resolveOutboundAttachmentFromUrlMock = vi.fn();
5151const createReplyMediaContextRuntimeMock = vi . fn ( ) ;
5252const EXPECTED_STEER_QUEUE_IDENTITY =
5353 "channel-user:v1:6f3f31084a7a2a6ff17176c0c16682e64d9f21301f64ff7e5bf1173b54fadc33" ;
54+ const TEST_TOOL_AUTHORITY_FINGERPRINT = "test-tool-authority" ;
55+
56+ vi . mock ( "./reply-tool-authority.js" , ( ) => ( {
57+ resolveFollowupRunToolAuthorityFingerprint : ( ) => "test-tool-authority" ,
58+ } ) ) ;
5459
5560vi . mock ( "../../agents/model-fallback-runner.js" , ( ) => ( {
5661 runWithModelFallback : ( params : {
@@ -292,10 +297,14 @@ const { runReplyAgent } = await import("./agent-runner.js");
292297function createReplyOperation ( ) : ReplyOperation {
293298 return {
294299 result : undefined ,
300+ toolAuthorityFingerprint : TEST_TOOL_AUTHORITY_FINGERPRINT ,
301+ abortSignal : new AbortController ( ) . signal ,
295302 startedAtMs : Date . now ( ) ,
296303 lastActivityAtMs : Date . now ( ) ,
297304 recordActivity : vi . fn ( ) ,
298305 setPhase : vi . fn ( ) ,
306+ bindToolAuthorityFingerprint : vi . fn ( ) ,
307+ bindToolAuthorityRoute : vi . fn ( ) ,
299308 freezeAbort : vi . fn ( ) ,
300309 fail : vi . fn ( ) ,
301310 complete : vi . fn ( ) ,
@@ -486,6 +495,7 @@ describe("runReplyAgent media path normalization", () => {
486495 queueIdentity : EXPECTED_STEER_QUEUE_IDENTITY ,
487496 onQueueAccepted : parkedSteerAcceptedMock ,
488497 taskSuggestionDeliveryMode : "gateway" ,
498+ toolAuthorityFingerprint : TEST_TOOL_AUTHORITY_FINGERPRINT ,
489499 } ,
490500 ) ;
491501 expect ( enqueueFollowupRunMock ) . not . toHaveBeenCalled ( ) ;
@@ -534,6 +544,7 @@ describe("runReplyAgent media path normalization", () => {
534544 images,
535545 media : followupRun . media ,
536546 taskSuggestionDeliveryMode : undefined ,
547+ toolAuthorityFingerprint : TEST_TOOL_AUTHORITY_FINGERPRINT ,
537548 } ,
538549 ) ;
539550 expect ( enqueueFollowupRunMock ) . not . toHaveBeenCalled ( ) ;
@@ -580,6 +591,7 @@ describe("runReplyAgent media path normalization", () => {
580591 resetTriggered : false ,
581592 } ) ;
582593 operation . setPhase ( "running" ) ;
594+ operation . bindToolAuthorityFingerprint ( TEST_TOOL_AUTHORITY_FINGERPRINT ) ;
583595 expect ( operation . acceptedSteeredInboundAudio ) . toBe ( false ) ;
584596 queueEmbeddedAgentMessageWithOutcomeAsyncMock . mockImplementation ( async ( sessionId : string ) => ( {
585597 queued : true ,
@@ -615,6 +627,7 @@ describe("runReplyAgent media path normalization", () => {
615627 queueIdentity : EXPECTED_STEER_QUEUE_IDENTITY ,
616628 onQueueAccepted : parkedSteerAcceptedMock ,
617629 taskSuggestionDeliveryMode : undefined ,
630+ toolAuthorityFingerprint : TEST_TOOL_AUTHORITY_FINGERPRINT ,
618631 } ,
619632 ) ;
620633 expect ( enqueueFollowupRunMock ) . not . toHaveBeenCalled ( ) ;
0 commit comments