@devries-cameron20 / t3code Mirror · read-only / commits / 557db6cb4e
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 22, 17:00 UTC

fix(server): running delegates tell agents to end the turn (#24887)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Theo Browne committed Oct 25, 2026 at 13:03 UTC 557db6cb4eb7ebe5d9b1300ecce8e05f1929fc39
3 files changed +3 -3
apps/server/src/mcp/toolkits/orchestrator/tools.ts
+1 -1
@@ -81,7 +81,7 @@ const DelegateTaskTool = Tool.make("delegate_task", {
81
82 const TaskStatusTool = Tool.make("task_status", {
83 description:
84 - "Read one delegated task you started. `workState`: working, waiting_for_children, result_available. A finished turn with live child work is not done. `summary`: final result. Reading it marks it delivered.",
84 + "Read one delegated task you started. Do not call it on a running task before its completion wakes you. `workState`: working, waiting_for_children, result_available. A finished turn with live child work is not done. `summary`: final result. Reading it marks it delivered.",
85 parameters: OrchestratorMcpTaskStatusInput,
86 success: OrchestratorMcpDelegateTaskResult,
87 failure: OrchestratorMcpFailure,
packages/contracts/src/orchestratorMcp.ts
+1 -1
@@ -177,7 +177,7 @@ export type OrchestratorMcpDelegateTaskInput = typeof OrchestratorMcpDelegateTas
177
178 // Set only on results for still-running tasks whose completion will wake the parent.
179 export const ORCHESTRATOR_MCP_RUNNING_TASK_NEXT =
180 - "Completion wakes this thread. End your turn unless you need this result now.";
180 + "Completion wakes this thread, so end your turn. Do not wait on it or poll it.";
181 const OrchestratorMcpRunningTaskNext = Schema.Literal(ORCHESTRATOR_MCP_RUNNING_TASK_NEXT);
182
183 export const OrchestratorMcpDelegateTaskResult = Schema.Struct({
packages/provider-core/src/server/orchestrationInstructions.ts
+1 -1
@@ -9,7 +9,7 @@ Ordinary coding tasks need no T3 tools.
9 - Subagents: use your native tool when the child uses your provider, a model it offers, and no settings beyond yours, and you wait in this turn (Claude \`Agent\` always with \`run_in_background:false\`; Codex \`spawn_agent\`, then wait). Use \`delegate_task\` for another provider's model, user-asked settings, a separate checkout (\`isolation:"worktree"\`), background work, or \`delegate_task\` by name. A native type running another provider's model counts too. Workflow only when asked.
10 - Before \`delegate_task\`, call \`orchestrator_capabilities\` once. Again only after an error or a user-named provider change. Settings go in \`target.options\`. One child per named model. Provider or model unavailable: say so. Never switch unasked, or fall back to native tools, Workflow, or CLIs. Never make a child's checkout in the shell or in \`task\`.
11 - Every new delegate review or re-check is a new \`delegate_task\` (brief, findings, objections), never a \`t3_thread_send\`. Fix small review findings yourself; start no delegate for them. When told to proceed without a delegate, \`task_cancel\` it. Start no replacement.
12 -- Follow a running delegate's \`next\`. Do not poll it (\`task_status\`, \`sleep\`, watchers, Monitor, ScheduleWakeup). Stop delegates with \`task_cancel\`, never \`t3_thread_interrupt\` on a \`childThreadId\`.
12 +- Follow a running delegate's \`next\`. Do not poll it (\`task_status\`, \`sleep\`, watchers, Monitor, ScheduleWakeup). Stop a delegate run you replace or no longer need with \`task_cancel\`, never \`t3_thread_interrupt\` on a \`childThreadId\`.
13 - If you are a subagent or child, do the work yourself. Start no subagents unless your task says to.`,
14 `- \`t3_thread_launch\` and \`create_threads\` make new top-level threads, only when the user asks for a new thread. "Subagent", "delegate", and "parallel" never mean one. Worktree thread: set \`workspaceStrategy\`; shell worktrees do not bind it, and no checkout setup in its prompt. No \`workspaceStrategy\`: project root, not your worktree.
15 - Given a thread id, \`t3_thread_read\` it before you answer about it.