@@ -15,8 +15,9 @@ import type { AnswerCallInput, HangupCallInput, NormalizedEvent } from "../types
1515import type { CallManagerContext } from "./context.js" ;
1616import { processEvent } from "./events.js" ;
1717import { speakInitialMessage } from "./outbound.js" ;
18- import { MAX_CALL_REPLAY_KEYS , MAX_MANAGER_REPLAY_KEYS } from "./replay-keys.js" ;
18+ import { MAX_CALL_REPLAY_KEYS } from "./replay-keys.js" ;
1919
20+ const MANAGER_REPLAY_KEY_LIMIT = 10_000 ;
2021const logSpy = vi . hoisted ( ( ) => {
2122 const logEntries : string [ ] = [ ] ;
2223 return {
@@ -775,7 +776,7 @@ describe("processEvent (functional)", () => {
775776 it ( "bounds committed replay keys in both manager and persisted call owners" , ( ) => {
776777 const now = Date . now ( ) ;
777778 const managerKeys = Array . from (
778- { length : MAX_MANAGER_REPLAY_KEYS } ,
779+ { length : MANAGER_REPLAY_KEY_LIMIT } ,
779780 ( _ , index ) => `manager-${ index } ` ,
780781 ) ;
781782 const callKeys = Array . from ( { length : MAX_CALL_REPLAY_KEYS } , ( _ , index ) => `call-${ index } ` ) ;
@@ -806,7 +807,7 @@ describe("processEvent (functional)", () => {
806807
807808 const call = ctx . activeCalls . get ( "call-bounded" ) ;
808809 expect ( result ) . toEqual ( { kind : "processed" } ) ;
809- expect ( ctx . processedEventIds . size ) . toBe ( MAX_MANAGER_REPLAY_KEYS ) ;
810+ expect ( ctx . processedEventIds . size ) . toBe ( MANAGER_REPLAY_KEY_LIMIT ) ;
810811 expect ( ctx . processedEventIds . has ( "manager-0" ) ) . toBe ( false ) ;
811812 expect ( ctx . processedEventIds . has ( "evt-bounded-new" ) ) . toBe ( true ) ;
812813 expect ( call ?. processedEventIds ) . toHaveLength ( MAX_CALL_REPLAY_KEYS ) ;
@@ -827,7 +828,7 @@ describe("processEvent (functional)", () => {
827828 it ( "bounds rejected provider calls while retaining hangup-once behavior" , ( ) => {
828829 const rejectedProviderCallIds = new Map < string , symbol > (
829830 Array . from (
830- { length : MAX_MANAGER_REPLAY_KEYS } ,
831+ { length : MANAGER_REPLAY_KEY_LIMIT } ,
831832 ( _ , index ) => [ `provider-${ index } ` , Symbol ( `provider-${ index } ` ) ] as const ,
832833 ) ,
833834 ) ;
@@ -851,7 +852,7 @@ describe("processEvent (functional)", () => {
851852 } ) ,
852853 ) ;
853854
854- expect ( ctx . rejectedProviderCallIds . size ) . toBe ( MAX_MANAGER_REPLAY_KEYS ) ;
855+ expect ( ctx . rejectedProviderCallIds . size ) . toBe ( MANAGER_REPLAY_KEY_LIMIT ) ;
855856 expect ( ctx . rejectedProviderCallIds . has ( "provider-0" ) ) . toBe ( false ) ;
856857 expect ( ctx . rejectedProviderCallIds . has ( "provider-new" ) ) . toBe ( true ) ;
857858 expect ( hangupCalls ) . toHaveLength ( 1 ) ;
0 commit comments