@@ -30,7 +30,7 @@ describe('migrateLegacyOptions', () => {
3030 const result = migrateLegacyOptions ( input ) ;
3131
3232 expect ( result . turnHandling ! . turnDetection ) . toBe ( 'vad' ) ;
33- expect ( 'turnDetection' in result ) . toBe ( false ) ;
33+ expect ( result . turnDetection ) . toBe ( 'vad' ) ;
3434 } ) ;
3535
3636 it ( 'should set interruption.mode to false when allowInterruptions is false' , ( ) => {
@@ -42,7 +42,7 @@ describe('migrateLegacyOptions', () => {
4242 const result = migrateLegacyOptions ( input ) ;
4343
4444 expect ( result . turnHandling ! . interruption ! . mode ) . toBe ( false ) ;
45- expect ( 'voiceOptions' in result ) . toBe ( false ) ;
45+ expect ( result . voiceOptions ?. allowInterruptions ) . toBe ( false ) ;
4646 } ) ;
4747
4848 it ( 'should not set interruption.mode when allowInterruptions is true' , ( ) => {
@@ -133,9 +133,9 @@ describe('migrateLegacyOptions', () => {
133133 expect ( result . turnHandling ! . preemptiveGeneration ) . toBe ( true ) ;
134134 expect ( result . turnHandling ! . userAwayTimeout ) . toBe ( 20.0 ) ;
135135
136- // Legacy options should be stripped
137- expect ( 'turnDetection' in result ) . toBe ( false ) ;
138- expect ( 'voiceOptions' in result ) . toBe ( false ) ;
136+ // Legacy options should still be available
137+ expect ( 'turnDetection' in result ) . toBeDefined ( ) ;
138+ expect ( 'voiceOptions' in result ) . toBeDefined ( ) ;
139139 } ) ;
140140
141141 it ( 'should preserve non-legacy options in the result' , ( ) => {
@@ -155,9 +155,9 @@ describe('migrateLegacyOptions', () => {
155155 expect ( result . maxToolSteps ) . toBe ( 5 ) ;
156156 expect ( result . connOptions ) . toEqual ( { maxUnrecoverableErrors : 10 } ) ;
157157
158- // Legacy options should be stripped and migrated
159- expect ( 'turnDetection' in result ) . toBe ( false ) ;
160- expect ( 'voiceOptions' in result ) . toBe ( false ) ;
158+ // Legacy options should still be available and mirror the new options
159+ expect ( result . turnDetection ) . toBe ( 'vad' ) ;
160+ expect ( result . voiceOptions ?. minEndpointingDelay ) . toBe ( 1.0 ) ;
161161 expect ( result . turnHandling ! . turnDetection ) . toBe ( 'vad' ) ;
162162 expect ( result . turnHandling ! . endpointing ! . minDelay ) . toBe ( 1.0 ) ;
163163 } ) ;
0 commit comments