@@ -1132,6 +1132,48 @@ it.effect("keeps a held commentary draft before the steer when turn end flushes
11321132 ) ,
11331133) ;
11341134
1135+ it . effect ( "steers a promoted queued message with the selection it was queued with" , ( ) =>
1136+ Effect . scoped (
1137+ Effect . gen ( function * ( ) {
1138+ const { started, steered, layer, startFirstTurn } = yield * nextTurnSelectionHarness (
1139+ "promote-queued-selection" ,
1140+ ) ;
1141+ yield * Effect . gen ( function * ( ) {
1142+ const orchestrator = yield * Orchestrator . OrchestratorV2 ;
1143+ const worker = yield * EffectWorker . OrchestrationEffectWorkerV2 ;
1144+ const threadId = yield * startFirstTurn ;
1145+ yield * orchestrator . dispatch ( {
1146+ type : "message.dispatch" ,
1147+ commandId : CommandId . make ( "queued" ) ,
1148+ threadId,
1149+ messageId : MessageId . make ( "message:queued" ) ,
1150+ text : "queued" ,
1151+ attachments : [ ] ,
1152+ modelSelection : composerSelection ,
1153+ dispatchMode : { type : "queue_after_active" } ,
1154+ createdBy : "user" ,
1155+ creationSource : "web" ,
1156+ } ) ;
1157+ const queuedRun = ( yield * orchestrator . getThreadProjection ( threadId ) ) . runs . find (
1158+ ( run ) => run . status === "queued" ,
1159+ ) ! ;
1160+ yield * orchestrator . dispatch ( {
1161+ type : "queued-message.promote-to-steer" ,
1162+ commandId : CommandId . make ( "promote" ) ,
1163+ threadId,
1164+ queuedRunId : queuedRun . id ,
1165+ targetRunId : started [ 0 ] ! . runId ,
1166+ } ) ;
1167+ yield * worker . drain ( ) ;
1168+
1169+ const projection = yield * orchestrator . getThreadProjection ( threadId ) ;
1170+ assert . deepEqual ( steered , [ "queued" ] ) ;
1171+ assert . deepEqual ( projection . thread . modelSelection , composerSelection ) ;
1172+ } ) . pipe ( Effect . provide ( layer ) ) ;
1173+ } ) ,
1174+ ) ,
1175+ ) ;
1176+
11351177it . effect ( "keeps a queued message queued when promoted into a run that Stop reached" , ( ) =>
11361178 Effect . scoped (
11371179 Effect . gen ( function * ( ) {
0 commit comments