Skip to content

Commit 917bfe4

Browse files
committed
fix(queue): ignore disposed subagents when holding follow-ups
1 parent 28fb766 commit 917bfe4

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

‎apps/server/src/orchestration-v2/Orchestrator.ts‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1774,7 +1774,15 @@ const makeOrchestrator = Effect.fn("orchestrationV2.Orchestrator.layer")(functio
17741774
derivePendingBackgroundWork({
17751775
latestRun: latestExecutedRun(projection.runs),
17761776
providerThreads: projection.providerThreads,
1777-
turnItems,
1777+
turnItems: turnItems.filter(
1778+
(item) =>
1779+
item.type !== "subagent" ||
1780+
item.origin !== "app_owned" ||
1781+
projection.subagents.some(
1782+
(task) =>
1783+
task.id === item.subagentId && task.completionDelivery?.state !== "disposed",
1784+
),
1785+
),
17781786
activeProviderThreadId: projection.thread.activeProviderThreadId,
17791787
runs: projection.runs,
17801788
}),

0 commit comments

Comments
 (0)