The best way to control Claude Code, Codex and more from any computer or phone
fix(server): background agent asks go to delegate_task, not a background Agent (#27139)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: maria-rcks <maria@kuuro.net>
Gabriel De Andrade committed
Nov 2, 2026 at 14:41 UTC
9bcf75335f9b2a8af877e1317c809b72a070b280
2 files changed
+5
-2
apps/server/src/provider/CodexDeveloperInstructions.test.ts
+4
-1
@@ -65,7 +65,10 @@ describe("Codex orchestration context", () => {
65
66
NodeAssert.ok(orchestration.includes("use your native tool when the child uses your provider"));
67
NodeAssert.ok(orchestration.includes("`run_in_background:false`"));
68
- NodeAssert.ok(orchestration.includes("A native type running another provider's model"));
68
+ NodeAssert.ok(orchestration.includes("A native type on another provider's model"));
69
+ NodeAssert.ok(
70
+ orchestration.includes("Background agent: `delegate_task`, never a background `Agent`."),
71
+ );
72
NodeAssert.ok(
73
orchestration.includes("Every new delegate review or re-check is a new `delegate_task`"),
74
);
packages/provider-core/src/server/orchestrationInstructions.ts
+1
-1
@@ -6,7 +6,7 @@ export const T3_CODE_ORCHESTRATION_SECTIONS: ReadonlyArray<string> = [
6
7
Ordinary coding tasks need no T3 tools.
8
9
-- Subagents: use your native tool when the child uses your provider, a model it offers, and no settings beyond yours, and it finishes 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.
9
+- Subagents: use your native tool when the child uses your provider, a model it offers, and no settings beyond yours (Claude \`Agent\`, \`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"\`), or \`delegate_task\` by name. A native type on another provider's model counts too. Background agent: \`delegate_task\`, never a background \`Agent\`. Workflow only when asked.
10
- Call \`orchestrator_capabilities\` once per thread, before the first \`delegate_task\`. Again only after an error or a user-named provider change. Settings go in \`target.options\`. 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, or to run fewer, \`task_cancel\` the extras. Start no replacement.
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\`.