@@ -750,58 +750,6 @@ describe("ProviderCommandReactor", () => {
750750 } ) ;
751751 } ) ;
752752
753- it ( "rejects a first turn when requested provider conflicts with the thread model" , async ( ) => {
754- const harness = await createHarness ( {
755- threadModelSelection : { provider : "codex" , model : "gpt-5-codex" } ,
756- } ) ;
757- const now = new Date ( ) . toISOString ( ) ;
758-
759- await Effect . runPromise (
760- harness . engine . dispatch ( {
761- type : "thread.turn.start" ,
762- commandId : CommandId . make ( "cmd-turn-start-provider-first" ) ,
763- threadId : ThreadId . make ( "thread-1" ) ,
764- message : {
765- messageId : asMessageId ( "user-message-provider-first" ) ,
766- role : "user" ,
767- text : "hello claude" ,
768- attachments : [ ] ,
769- } ,
770- modelSelection : {
771- provider : "claudeAgent" ,
772- model : "claude-opus-4-6" ,
773- } ,
774- interactionMode : DEFAULT_PROVIDER_INTERACTION_MODE ,
775- runtimeMode : "approval-required" ,
776- createdAt : now ,
777- } ) ,
778- ) ;
779-
780- await waitFor ( async ( ) => {
781- const readModel = await Effect . runPromise ( harness . engine . getReadModel ( ) ) ;
782- const thread = readModel . threads . find ( ( entry ) => entry . id === ThreadId . make ( "thread-1" ) ) ;
783- return (
784- thread ?. activities . some ( ( activity ) => activity . kind === "provider.turn.start.failed" ) ??
785- false
786- ) ;
787- } ) ;
788-
789- expect ( harness . startSession ) . not . toHaveBeenCalled ( ) ;
790- expect ( harness . sendTurn ) . not . toHaveBeenCalled ( ) ;
791-
792- const readModel = await Effect . runPromise ( harness . engine . getReadModel ( ) ) ;
793- const thread = readModel . threads . find ( ( entry ) => entry . id === ThreadId . make ( "thread-1" ) ) ;
794- expect ( thread ?. session ) . toBeNull ( ) ;
795- expect (
796- thread ?. activities . find ( ( activity ) => activity . kind === "provider.turn.start.failed" ) ,
797- ) . toMatchObject ( {
798- summary : "Provider turn start failed" ,
799- payload : {
800- detail : expect . stringContaining ( "cannot switch to 'claudeAgent'" ) ,
801- } ,
802- } ) ;
803- } ) ;
804-
805753 it ( "preserves the active session model when in-session model switching is unsupported" , async ( ) => {
806754 const harness = await createHarness ( { sessionModelSwitch : "unsupported" } ) ;
807755 const now = new Date ( ) . toISOString ( ) ;
@@ -1100,78 +1048,6 @@ describe("ProviderCommandReactor", () => {
11001048 } ) ;
11011049 } ) ;
11021050
1103- it ( "rejects provider changes after a thread is already bound to a session provider" , async ( ) => {
1104- const harness = await createHarness ( ) ;
1105- const now = new Date ( ) . toISOString ( ) ;
1106-
1107- await Effect . runPromise (
1108- harness . engine . dispatch ( {
1109- type : "thread.turn.start" ,
1110- commandId : CommandId . make ( "cmd-turn-start-provider-switch-1" ) ,
1111- threadId : ThreadId . make ( "thread-1" ) ,
1112- message : {
1113- messageId : asMessageId ( "user-message-provider-switch-1" ) ,
1114- role : "user" ,
1115- text : "first" ,
1116- attachments : [ ] ,
1117- } ,
1118- interactionMode : DEFAULT_PROVIDER_INTERACTION_MODE ,
1119- runtimeMode : "approval-required" ,
1120- createdAt : now ,
1121- } ) ,
1122- ) ;
1123-
1124- await waitFor ( ( ) => harness . startSession . mock . calls . length === 1 ) ;
1125- await waitFor ( ( ) => harness . sendTurn . mock . calls . length === 1 ) ;
1126-
1127- await Effect . runPromise (
1128- harness . engine . dispatch ( {
1129- type : "thread.turn.start" ,
1130- commandId : CommandId . make ( "cmd-turn-start-provider-switch-2" ) ,
1131- threadId : ThreadId . make ( "thread-1" ) ,
1132- message : {
1133- messageId : asMessageId ( "user-message-provider-switch-2" ) ,
1134- role : "user" ,
1135- text : "second" ,
1136- attachments : [ ] ,
1137- } ,
1138- modelSelection : {
1139- provider : "claudeAgent" ,
1140- model : "claude-opus-4-6" ,
1141- } ,
1142- interactionMode : DEFAULT_PROVIDER_INTERACTION_MODE ,
1143- runtimeMode : "approval-required" ,
1144- createdAt : now ,
1145- } ) ,
1146- ) ;
1147-
1148- await waitFor ( async ( ) => {
1149- const readModel = await Effect . runPromise ( harness . engine . getReadModel ( ) ) ;
1150- const thread = readModel . threads . find ( ( entry ) => entry . id === ThreadId . make ( "thread-1" ) ) ;
1151- return (
1152- thread ?. activities . some ( ( activity ) => activity . kind === "provider.turn.start.failed" ) ??
1153- false
1154- ) ;
1155- } ) ;
1156-
1157- expect ( harness . startSession . mock . calls . length ) . toBe ( 1 ) ;
1158- expect ( harness . sendTurn . mock . calls . length ) . toBe ( 1 ) ;
1159- expect ( harness . stopSession . mock . calls . length ) . toBe ( 0 ) ;
1160-
1161- const readModel = await Effect . runPromise ( harness . engine . getReadModel ( ) ) ;
1162- const thread = readModel . threads . find ( ( entry ) => entry . id === ThreadId . make ( "thread-1" ) ) ;
1163- expect ( thread ?. session ?. threadId ) . toBe ( "thread-1" ) ;
1164- expect ( thread ?. session ?. providerName ) . toBe ( "codex" ) ;
1165- expect ( thread ?. session ?. runtimeMode ) . toBe ( "approval-required" ) ;
1166- expect (
1167- thread ?. activities . find ( ( activity ) => activity . kind === "provider.turn.start.failed" ) ,
1168- ) . toMatchObject ( {
1169- payload : {
1170- detail : expect . stringContaining ( "cannot switch to 'claudeAgent'" ) ,
1171- } ,
1172- } ) ;
1173- } ) ;
1174-
11751051 it ( "does not stop the active session when restart fails before rebind" , async ( ) => {
11761052 const harness = await createHarness ( ) ;
11771053 const now = new Date ( ) . toISOString ( ) ;
0 commit comments