Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): a held queue no longer strands later queued messages #18792

Closedleojkwan(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/18792/headopened View on GitHub

Showing 3 changed files with 160 additions and 10 deletions.

x
0 of 3 viewed, 3 left
9 additions and 4 deletionsapps/server/src/orchestration-v2/Orchestrator.tsModified
View file
@@ -606,10 +606,11 @@
​
+// Held runs wait for the user; runs queued behind a later run do not.
function nextQueuedRun(
projection: Pick<OrchestrationV2ThreadProjection, "runs" | "messages">,
): OrchestrationV2Run | undefined {
- return queuedRunsInDeliveryOrder(projection)[0];
+ return queuedRunsInDeliveryOrder(projection).find((run) => run.queueHeld !== true);
​
function latestStableRun(
@@ -1284,8 +1285,7 @@
projection.thread.archivedAt !== null ||
projection.thread.deletedAt !== null ||
- projection.runs.some(isBlockingRun) ||
- projection.runs.some((run) => run.status === "queued" && run.queueHeld === true)
+ projection.runs.some(isBlockingRun)
return;
@@ -5032,9 +5032,14 @@
rootNodeId,
activeAttemptId: attemptId,
status: "queued",
+ // A message joins a hold placed on messages waiting behind the same