@@ -5464,12 +5464,6 @@ const makeOrchestrator = Effect.fn("orchestrationV2.Orchestrator.layer")(functio
54645464 dispatchMode . type === "start_immediately" ||
54655465 dispatchMode . type === "queue_after_active" ;
54665466 const shouldQueue = queueBehindRun !== undefined && startsOrQueuesRun ;
5467- // A queued pick reaches the thread only when its run starts; unpicked messages behind it follow it.
5468- const newestQueuedRun =
5469- shouldQueue && command . modelSelection === undefined && command . createdBy === "user"
5470- ? queuedRunsInDeliveryOrder ( projection ) . at ( - 1 )
5471- : undefined ;
5472- if ( newestQueuedRun ) modelSelection = queuedRunModelSelection ( projection , newestQueuedRun ) ;
54735467 // Client messages resume held queues; server continuations and scheduled tasks do not.
54745468 // Provider failure or usage limits re-hold the queue. Failed worktree setup keeps it held
54755469 // until a worktree exists, so queued messages cannot start in the project checkout.
@@ -5484,6 +5478,12 @@ const makeOrchestrator = Effect.fn("orchestrationV2.Orchestrator.layer")(functio
54845478 command . createdBy === "user" &&
54855479 ( command . creationSource === "web" || command . creationSource === "mobile" ) &&
54865480 command . scheduledTaskId === undefined ;
5481+ // A queued pick reaches the thread only when its run starts; unpicked messages behind it follow it.
5482+ const newestQueuedRun =
5483+ shouldQueue && sentByUserFromClient && command . modelSelection === undefined
5484+ ? queuedRunsInDeliveryOrder ( projection ) . at ( - 1 )
5485+ : undefined ;
5486+ if ( newestQueuedRun ) modelSelection = queuedRunModelSelection ( projection , newestQueuedRun ) ;
54875487 const heldRunsToRelease =
54885488 sentByUserFromClient && startsOrQueuesRun && ! worktreeSetupUnresolved
54895489 ? projection . runs . filter ( ( run ) => run . status === "queued" && run . queueHeld === true )
0 commit comments