@@ -113,15 +113,6 @@ const claudeAdapter = {
113113 planSelectionTransition : ( ) => Effect . succeed ( { type : "apply_on_next_turn" as const } ) ,
114114 openSession : ( ) => Effect . die ( "provider execution is disabled in launch tests" ) ,
115115} as ProviderAdapter . ProviderAdapterV2 [ "Service" ] ;
116- // A second account of the same provider, configured as its own instance.
117- const otherCodexModelSelection = {
118- instanceId : ProviderInstanceId . make ( "codex_work" ) ,
119- model : modelSelection . model ,
120- } as const ;
121- const otherCodexAdapter = {
122- ...adapter ,
123- instanceId : otherCodexModelSelection . instanceId ,
124- } as ProviderAdapter . ProviderAdapterV2 [ "Service" ] ;
125116
126117interface HarnessOptions {
127118 readonly closeTerminal ?: TerminalManager . TerminalManager [ "Service" ] [ "close" ] ;
@@ -396,18 +387,8 @@ it.effect.each(
396387 } ,
397388) ;
398389
399- it . effect . each ( [
400- { switchedTo : "another provider" , selection : claudeModelSelection } ,
401- { switchedTo : "another account of the same provider" , selection : otherCodexModelSelection } ,
402- ] ) ( "runs a thread-bound automation on $switchedTo the thread uses now" , ( { selection } ) => {
403- const harness = makeHarness ( {
404- adapters : [ adapter , claudeAdapter , otherCodexAdapter ] ,
405- serverSettings : {
406- providerInstances : {
407- [ otherCodexModelSelection . instanceId ] : { driver : adapter . driver , config : { } } ,
408- } ,
409- } ,
410- } ) ;
390+ it . effect ( "runs a thread-bound automation on the provider the thread uses now" , ( ) => {
391+ const harness = makeHarness ( { adapters : [ adapter , claudeAdapter ] } ) ;
411392 const layerScheduledTasks = ScheduledTasks . layer . pipe (
412393 Layer . provide (
413394 Layer . mergeAll (
@@ -425,7 +406,6 @@ it.effect.each([
425406 const launched = yield * launches . launch (
426407 launchInput ( { command : "command:switched" , thread : "thread:switched" } ) ,
427408 ) ;
428- // The task is created while the thread is on Codex...
429409 const { task } = yield * tasks . upsert ( {
430410 id : ScheduledTaskId . make ( "scheduled-task:switched" ) ,
431411 title : "Hourly check" ,
@@ -441,21 +421,20 @@ it.effect.each([
441421 createdBy : "agent" ,
442422 creationSource : "mcp" ,
443423 } ) ;
444- // ...and the user then switches the thread away from that instance.
445424 yield * threads . dispatch ( {
446425 type : "thread.model-selection.set" ,
447426 commandId : CommandId . make ( "command:switch-selection" ) ,
448427 threadId : launched . threadId ,
449- modelSelection : selection ,
428+ modelSelection : claudeModelSelection ,
450429 } ) ;
451430
452431 const result = yield * tasks . runNow ( { id : task . id } ) ;
453432 assert . equal ( result . task . lastRunStatus , "succeeded" ) ;
454433 const projection = yield * threads . getThreadProjection ( launched . threadId ) ;
455434 const message = projection . messages . find ( ( item ) => item . scheduledTaskId === task . id ) ;
456435 const run = projection . runs . find ( ( item ) => item . id === message ?. runId ) ;
457- assert . deepStrictEqual ( run ?. modelSelection , selection ) ;
458- assert . deepStrictEqual ( projection . thread . modelSelection , selection ) ;
436+ assert . deepStrictEqual ( run ?. modelSelection , claudeModelSelection ) ;
437+ assert . deepStrictEqual ( projection . thread . modelSelection , claudeModelSelection ) ;
459438 } ) . pipe ( Effect . provide ( Layer . mergeAll ( harness . layer , layerScheduledTasks ) ) ) ;
460439} ) ;
461440
0 commit comments