Skip to content

Commit bdbfdc9

Browse files
fix(orchestrator): align delegated task status with v2
1 parent 71b5949 commit bdbfdc9

4 files changed

Lines changed: 10 additions & 10 deletions

File tree

‎apps/server/src/mcp/toolkits/orchestrator/tools.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const OrchestratorCapabilitiesTool = Tool.make("orchestrator_capabilities
4949

5050
export const DelegateTaskTool = Tool.make("delegate_task", {
5151
description:
52-
"Delegate one task to a T3-owned child agent/subagent of THIS thread and run it with only the supplied task prompt, without copying parent conversation history. Use this whenever the user asks for an agent, subagent, worker, delegated task, or parallel help—including cross-provider work. The childThreadId is backing storage, not an ordinary top-level thread. Provider, model, model options (see orchestrator_capabilities), runtime mode, and interaction mode inherit unless target overrides them. Prefer mode='async' for long work; mode='wait' blocks on the original delegated run until completion or timeout. An async child's completion wakes this thread with a continuation message naming the task (queued behind any turn in progress), so end the turn instead of polling or spawning watchers; use task_status only when the result is needed mid-turn.",
52+
"Delegate one task to a T3-owned child agent/subagent of THIS thread and run it with only the supplied task prompt, without copying parent conversation history. Use this whenever the user asks for an agent, subagent, worker, delegated task, or parallel help—including cross-provider work. The childThreadId is backing storage, not an ordinary top-level thread. Provider, model, model options (see orchestrator_capabilities), runtime mode, and interaction mode inherit unless target overrides them. Prefer mode='async' for long work; mode='wait' blocks until completion or timeout. An async child's completion wakes this thread with a continuation message naming the task (queued behind any turn in progress), so end the turn instead of polling or spawning watchers; use task_status only when the result is needed mid-turn.",
5353
parameters: OrchestratorMcpDelegateTaskInput,
5454
success: OrchestratorMcpDelegateTaskResult,
5555
failure: OrchestratorMcpFailure,
@@ -62,7 +62,7 @@ export const DelegateTaskTool = Tool.make("delegate_task", {
6262

6363
export const TaskStatusTool = Tool.make("task_status", {
6464
description:
65-
"Read a T3-owned delegated task created by this parent thread. The primary status, childRunId, summary, and resultContextTransferId stay tied to the original delegated run. hasPendingChildRuns reports whether later work is still queued or executing, while latestTerminal* exposes the newest terminal child run that began execution. Reading a terminal result acknowledges its automatic parent delivery.",
65+
"Read a T3-owned delegated task created by this parent thread. The primary status, childRunId, summary, and resultContextTransferId stay tied to the original delegated run. hasPendingChildRuns reports whether later work is still queued or executing, while latestTerminal* exposes the original run or the newest later terminal run that began execution. Reading a terminal result acknowledges its automatic parent delivery.",
6666
parameters: OrchestratorMcpTaskStatusInput,
6767
success: OrchestratorMcpDelegateTaskResult,
6868
failure: OrchestratorMcpFailure,

‎apps/server/src/orchestration-v2/testkit/fixtures/delegated_task_status/codex_transcript.ndjson‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{"type":"transcript_start","provider":"codex","protocol":"codex.app-server","version":"0.120.0","scenario":"delegated_task_status","metadata":{"source":"constructed-codex-app-server-replay-fixture","fileName":"codex_transcript.ndjson","normalization":"Provider-valid frames were composed into a deterministic multi-turn lifecycle; native IDs and timestamps were normalized.","description":"An active parent delegates a child, interrupts a running follow-up, and lets queued work complete."}}
2-
{"type":"expect_outbound","label":"initialize","frame":{"id":1,"method":"initialize","params":{"capabilities":{"experimentalApi":true},"clientInfo":{"name":"t3code_desktop","title":"T3 Code Desktop","version":"0.1.0"}}}}
2+
{"type":"expect_outbound","label":"initialize","frame":{"id":1,"method":"initialize","params":{"capabilities":{"experimentalApi":true,"optOutNotificationMethods":["turn/diff/updated"]},"clientInfo":{"name":"t3code_desktop","title":"T3 Code Desktop","version":"0.1.0"}}}}
33
{"type":"emit_inbound","label":"initialize","frame":{"id":1,"result":{"userAgent":"t3code_desktop/0.120.0 (Mac OS 26.4.1; arm64) dumb (t3code_desktop; 0.1.0)","codexHome":"/Users/julius/.codex","platformFamily":"unix","platformOs":"macos"}}}
44
{"type":"expect_outbound","label":"initialized","frame":{"method":"initialized"}}
55
{"type":"expect_outbound","label":"parent.thread/start","frame":{"id":2,"method":"thread/start","params":{}}}

‎docs/orchestration-v2/orchestrator-mcp-server.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,9 @@ result.
224224

225225
### `task_cancel`
226226

227-
Interrupts the active child run through the normal V2 `run.interrupt` command.
228-
It is idempotent for terminal tasks and accepts an optional cancellation
229-
reason.
227+
Interrupts the original delegated run through the normal V2 `run.interrupt`
228+
command. It is idempotent for terminal tasks and accepts an optional cancellation
229+
reason. Use `t3_thread_interrupt` to interrupt a later follow-up run.
230230

231231
### `create_threads`
232232

‎packages/contracts/src/orchestratorMcp.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,14 +186,14 @@ export const OrchestratorMcpDelegateTaskResult = Schema.Struct({
186186
childNodeId: NodeId,
187187
status: OrchestratorMcpDelegatedTaskStatus,
188188
hasPendingChildRuns: Schema.Boolean,
189-
providerInstanceId: ProviderInstanceId,
190-
model: Schema.NullOr(Schema.String),
191-
summary: Schema.NullOr(Schema.String),
192-
resultContextTransferId: Schema.NullOr(ContextTransferId),
193189
latestTerminalRunId: Schema.NullOr(RunId),
194190
latestTerminalStatus: Schema.NullOr(OrchestratorMcpTerminalDelegatedTaskStatus),
195191
latestTerminalSummary: Schema.NullOr(Schema.String),
196192
latestTerminalResultContextTransferId: Schema.NullOr(ContextTransferId),
193+
providerInstanceId: ProviderInstanceId,
194+
model: Schema.NullOr(Schema.String),
195+
summary: Schema.NullOr(Schema.String),
196+
resultContextTransferId: Schema.NullOr(ContextTransferId),
197197
waitTimedOut: Schema.Boolean,
198198
});
199199
export type OrchestratorMcpDelegateTaskResult = typeof OrchestratorMcpDelegateTaskResult.Type;

0 commit comments

Comments
 (0)