Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): held queued wakes no longer keep delegated tasks running #17028

Mergedjuliusmarmingemerged 1 commit intomain fromrefs/pull/17028/headmerged by juliusmarminge View on GitHub

Showing 9 changed files with 17 additions and 1 deletion (loading 6).

x
0 of 9 viewed, 9 left
1 addition and 1 deletionapps/server/src/mcp/toolkits/orchestrator/tools.tsModified
View file
@@ -76,7 +76,7 @@
​
const TaskStatusTool = Tool.make("task_status", {
description:
- "Needs an agent running inside a T3 thread. Read a T3-owned delegated task created by this parent thread. childRunId identifies the original delegated run. workState distinguishes working, waiting_for_children, and result_available; a completed turn with live nested work is not a completed task. summary is the final task result, including provider errors on failure, and remains stable after publication. hasPendingChildRuns reports later queued or executing turns in the backing child thread, even after the task is terminal; it does not reopen the task, and task_cancel stops those turns too. latestTerminal* provides later non-monitor turn results. Reading a terminal result acknowledges its automatic parent delivery.",
+ "Needs an agent running inside a T3 thread. Read a T3-owned delegated task created by this parent thread. childRunId identifies the original delegated run. workState distinguishes working, waiting_for_children, and result_available; a completed turn with live nested work is not a completed task. summary is the final task result, including provider errors on failure, and remains stable after publication. hasPendingChildRuns reports later queued or executing turns in the backing child thread, even after the task is terminal; it does not reopen the task, and task_cancel stops those turns too. Turns held in a stopped queue wait for the user and do not count. latestTerminal* provides later non-monitor turn results. Reading a terminal result acknowledges its automatic parent delivery.",
parameters: OrchestratorMcpTaskStatusInput,
success: OrchestratorMcpDelegateTaskResult,
failure: OrchestratorMcpFailure,
2 additions and 0 deletionsapps/server/src/mcp/OrchestratorMcpService.tsModified
View file
@@ -372,9 +372,11 @@
childProjection: Pick<OrchestrationV2ThreadProjection, "runs">,
delegatedRun: OrchestrationV2Run | undefined,
): boolean {
+ // Held queued runs wait for the user to resume the child; task_cancel holds them.
return childProjection.runs.some(
(run) =>
!ThreadManagementService.isTerminalRunStatus(run.status) &&
+ !(run.status === "queued" && run.queueHeld === true) &&
(delegatedRun === undefined || run.ordinal > delegatedRun.ordinal),
14 additions and 0 deletionsapps/server/src/mcp/OrchestratorMcpToolkit.integration.test.tsModified
View file
@@ -1873,6 +1873,20 @@