@@ -134,51 +134,33 @@ it.each(["preparing", "starting"] as const)(
134134) ;
135135
136136it . each ( [
137- [ "has not started" , [ ] , { type : "queue_after_active" } ] ,
138- [
139- "is pending" ,
140- [ { runAttemptId : activeAttemptId , status : "pending" } ] ,
141- { type : "queue_after_active" } ,
142- ] ,
143- [
144- "has completed" ,
145- [ { runAttemptId : activeAttemptId , status : "completed" } ] ,
146- { type : "steer_active" , targetRunId : activeRunId } ,
147- ] ,
137+ [ "has not started" , [ ] ] ,
138+ [ "is pending" , [ { runAttemptId : activeAttemptId , status : "pending" } ] ] ,
139+ [ "has completed" , [ { runAttemptId : activeAttemptId , status : "completed" } ] ] ,
148140 [
149141 "belongs to a previous attempt" ,
150142 [ { runAttemptId : RunAttemptId . make ( "previous-attempt" ) , status : "running" } ] ,
151- { type : "queue_after_active" } ,
152143 ] ,
153- ] as const ) (
154- "queues automatic delivery when the active run's provider turn %s" ,
155- ( _ , providerTurns , steer ) => {
156- const projection = {
157- ...dispatchProjection ( baseCapabilities ) ,
158- providerTurns,
159- } as unknown as OrchestrationV2ThreadProjection ;
144+ ] as const ) ( "queues follow-ups when the active run's provider turn %s" , ( _ , providerTurns ) => {
145+ const projection = {
146+ ...dispatchProjection ( baseCapabilities ) ,
147+ providerTurns,
148+ } as unknown as OrchestrationV2ThreadProjection ;
149+ for ( const intent of [ "auto" , "steer" ] as const ) {
160150 assert . deepEqual (
161- CommandPolicy . resolveMessageDispatchIntent ( projection , { type : "start_immediately" } , "auto" ) ,
151+ CommandPolicy . resolveMessageDispatchIntent ( projection , { type : "start_immediately" } , intent ) ,
162152 { type : "queue_after_active" } ,
163153 ) ;
164- assert . deepEqual (
165- CommandPolicy . resolveMessageDispatchIntent (
166- projection ,
167- { type : "start_immediately" } ,
168- "steer" ,
169- ) ,
170- steer ,
171- ) ;
172- assert . deepEqual (
173- CommandPolicy . resolveMessageDispatchIntent (
174- projection ,
175- { type : "start_immediately" } ,
176- "restart" ,
177- ) ,
178- { type : "restart_active" , targetRunId : activeRunId } ,
179- ) ;
180- } ,
181- ) ;
154+ }
155+ assert . deepEqual (
156+ CommandPolicy . resolveMessageDispatchIntent (
157+ projection ,
158+ { type : "start_immediately" } ,
159+ "restart" ,
160+ ) ,
161+ { type : "restart_active" , targetRunId : activeRunId } ,
162+ ) ;
163+ } ) ;
182164
183165it . each ( [ "/compact" , " /LOGOUT " ] ) ( "queues a steer sent while %s runs" , ( text ) => {
184166 const projection = dispatchProjection ( baseCapabilities ) ;
0 commit comments