Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): a follow-up delegated task waits for the subagents its child starts #34958

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

Showing 5 changed files with 16 additions and 9 deletions (loading 4).

x
0 of 5 viewed, 5 left
16 additions and 9 deletionsapps/server/src/mcp/OrchestratorMcpService.tsModified
View file
@@ -101,7 +101,12 @@
ProjectionRecordField,
ProjectionRecordFilter,
} from "../orchestration-v2/ProjectionStore.ts";
-import { delegatedTaskResultRun, runOutcome } from "../orchestration-v2/RestartBackgroundNote.ts";
+import {
+ delegatedTaskAwaitsSubagents,
+ delegatedTaskResultRun,
+ delegatedTaskRuns,
+ runOutcome,
+} from "../orchestration-v2/RestartBackgroundNote.ts";
import * as ThreadManagementService from "../orchestration-v2/ThreadManagementService.ts";
import * as ThreadLaunchService from "../orchestration-v2/ThreadLaunchService.ts";
import * as GitVcsDriver from "../vcs/GitVcsDriver.ts";
@@ -1625,16 +1630,18 @@
const childRun = delegatedTaskRun(childControls, task);
const terminalRun = latestTerminalResultRun(childControls, childRun);
const progress = delegatedTaskProgress(childControls);
+ const followupRuns =
+ childRun?.delegatedTaskId === task.id ? delegatedTaskRuns(childControls, task.id) : undefined;
const taskResultRun =
- childRun?.delegatedTaskId === task.id
- ? delegatedTaskResultRun(childControls.runs, task.id)
- : progress.resultRun;
+ followupRuns === undefined ? progress.resultRun : delegatedTaskResultRun(followupRuns);
const taskWorkState =
- childRun?.delegatedTaskId === task.id
- ? isTerminalTaskStatus(taskStatusForRun(taskResultRun))
- ? "result_available"