Skip to content
Source
Sign inSign up
pingdotgg/t3code

perf(server): busy threads stop decoding settled subagents and idle pollers skip work #27711

Mergedjuliusmarmingemerged 4 commits intomain fromrefs/pull/27711/headmerged by juliusmarminge View on GitHub

Showing 19 changed files with 54 additions and 13 deletions (loading 16).

x
0 of 19 viewed, 19 left
48 additions and 9 deletionsapps/server/src/mcp/OrchestratorMcpService.tsModified
View file
@@ -513,6 +513,21 @@
return approval;
​
+/** Every task `directAppOwnedChildTasks` can return, so callers load only those. */
+function directChildTaskIds(
+ target: Pick<OrchestrationV2ThreadProjection, "thread" | "runs">,
+ returnedRunIds: ReadonlySet<RunId | null>,
+): ReadonlyArray<NodeId> {
+ const ids = new Set<NodeId>();
+ if (target.thread.forkedFrom?.type === "node") ids.add(target.thread.forkedFrom.nodeId);
+ for (const run of target.runs) {
+ if (returnedRunIds.has(run.id) && run.delegatedTaskId !== undefined) {
+ ids.add(run.delegatedTaskId);
+ }
+ }
+ return [...ids];
+}
+​
function directAppOwnedChildTasks(
parent: Pick<OrchestrationV2ThreadProjection, "thread" | "subagents">,
target: Pick<OrchestrationV2ThreadProjection, "thread" | "runs">,
@@ -1016,7 +1031,6 @@
"runs",
"messages",
- "subagents",
"providerThreads",
"providerTurns",