Agents ask to move the thread instead of delegating when running tasks across linked machines #49749
I regularly run prompts like "update X on all computers in the fleet" across my linked environments. Recently, instead of just delegating the task out to each machine and reporting back, agents started popping up the "Move this thread to another machine?" card (t3_thread_handoff) and stopping their turn.
I dug into main to see why this started happening. It looks like #49075 (for #49066) fixed a similar case right after linking a new machine, but when your machines are already linked, listing or using existing links doesn't emit that post-link notice, and the shared system prompt, tool descriptions, and composer context chips still heavily steer models toward t3_thread_handoff over delegate_task.
Full code trace and diagrams are below.
AI Details#
Summary#
Since thread handoff (t3_thread_handoff) was introduced in #44774 (3f63afc1f8), prompts asking an agent to run a task across already-linked machines can cause the agent to propose moving the current thread (t3_thread_handoff) instead of delegating work (delegate_task with target.environmentId).
#49075 (91db08de08, fixing #49066) updated the post-link acceptance notice in apps/server/src/peer/PeerLinkRequests.ts:465 to explicitly steer remote tasks to delegate_task. However, listing or directly using already-linked environments does not emit that notice, leaving models to rely on the shared prompt, tool descriptions, and (when attached) environment context chips.
Reproduction#
- Have 2+ machines already linked via Linked Environments (reachable,
full-accessorauto-accept-edits). - Start a thread on one machine and ask something like:
(or"Update X on all computers in the fleet"
@-mention one or more linked environments and ask the agent to run a command/update there and report back). - Actual: The agent lists linked environments and calls
t3_thread_handoff, showing the"Move this thread to another machine?"card (HandoffRequestCard.tsx:201) and ending its turn instead of doing the work. - Expected: The agent fans out
delegate_taskcalls withtarget.environmentIdset for each linked machine, does the work in parallel, and reports back in the current thread.
Why #49075 Didn't Cover Already-Linked Fleets#
flowchart LR
A["User asks for work on other machine(s)"] --> B{"Link card accepted\nin this thread?"}
B -->|"Yes (#49066 path)"| C["t3_environment_link card accepted"]
C --> D["PeerLinkRequests.ts:465 wake notice:\nuse delegate_task with target.environmentId;\nt3_thread_handoff only when moving"]
D --> E["Calls delegate_task (Fixed)"]
B -->|"No (Already-linked fleet)"| F["Calls t3_environment_links\n(or reuses known environmentIds)"]
F --> G["Post-link wake notice is not emitted"]
G --> H["Model relies on shared prompt,\ntool descriptions, and context chips"]
H --> I["Calls t3_thread_handoff (Still broken)"]
How Model-Facing Signals Bias Toward t3_thread_handoff#
flowchart TD
U["User: 'Update X on all computers in the fleet'"] --> P1
subgraph Surfaces["Surfaces seen on an already-linked fleet (main @ 67bcb9f534)"]
P1["System prompt (orchestrationInstructions.ts:10-21)\n- Native-subagent bullet omits 'another machine' from delegate_task exceptions\n- 'Another machine' bullet only names t3_thread_handoff\n ('Continuing this thread there: t3_thread_handoff, not a delegate')"]
P2["delegate_task description (tools.ts:92-95)\n- Top-level description omits remote execution / target.environmentId\n (documented in nested OrchestratorMcpTarget & t3_environment_links)"]
P3["t3_thread_handoff description (tools.ts:328-337)\n- 'Call this even if destination is unlinked or unknown'\n- 'Call this instead of asking in chat, then end your turn'\n- No instruction contrasting remote tasks vs continuing this thread"]
P4["Composer chip, when @-mentioned (composerContextReferences.ts:449)\n- Leads with: 'To move this thread, pass this environmentId\n to t3_thread_handoff.'"]
P5["t3_environment_links result (PeerForwarding.ts:289-308)\n- Returns environmentId, links[], and notListed\n (no delegation vs handoff reminder in payload)"]
end
P1 --> M{"Model selects tool for\n'act on other machines'"}
P2 --> M
P3 --> M
P4 --> M
P5 --> M
M -->|"High salience: 'other machine' + 'call instead of asking'"| BAD["Calls t3_thread_handoff\nShows move card & ends turn"]
M -.->|"Weaker signal in shared prompt"| GOOD["Expected: Fan out delegate_task\nwith target.environmentId per machine"]
Contributing Factors in main (67bcb9f534)#
(From static source review; relative weights across models have not been measured with live eval runs.)
Shared system prompt omits remote machines from
delegate_taskand only namest3_thread_handofffor acting on another machinepackages/provider-core/src/server/orchestrationInstructions.ts:10-14favors native subagents for same-provider work and lists exceptions that requiredelegate_task(another provider's model, user-asked settings,isolation:"worktree", background agent)—a task on another machine is omitted.packages/provider-core/src/server/orchestrationInstructions.ts:21:- Another machine:
t3_environment_linkslists linked ones. Pass itsenvironmentIdand that machine'sthreadIdto T3 tools. Continuing this thread there:t3_thread_handoff, not a delegate.
- Another machine:
- The
threadIdclause applies to acting on an existing remote thread, and the only concrete action tool named in that bullet ist3_thread_handoff(paired with"not a delegate"). There is no corresponding instruction for running a task on another machine and reporting back here viadelegate_taskwithtarget.environmentId.
delegate_task's top-level description omits remote execution;t3_thread_handoffis framed proactivelyapps/server/src/mcp/toolkits/orchestrator/tools.ts:92-95(delegate_task):"Start one child agent with only
task. No parent history. Separate checkout or PR per child:isolation:'worktree'. KeeptaskIdfortask_statusandtask_cancel. No secrets intask."target.environmentIdis documented inside the nestedOrchestratorMcpTargetschema (packages/contracts/src/orchestratorMcp.ts:118-123) and int3_environment_links's description (tools.ts:344), but not indelegate_task's own description.
apps/server/src/mcp/toolkits/orchestrator/tools.ts:328-337(t3_thread_handoff):"Move THIS thread with its code and edits. Call this even if the destination is unlinked or unknown: the move card handles linking. Stop at a safe point when the user is leaving.
environmentIdsuggests a machine. Call this instead of asking in chat, then end your turn. Put remaining work incontinuationPrompt."- Scoped to moving
"THIS thread", with no contrast pointing remote tasks todelegate_task.
- Scoped to moving
Deferred
tool_searchsurfacest3_thread_handoffon machine queriesapps/server/src/mcp/McpToolExposure.ts:54-67scores tools by query-term overlap withnameanddescription.- Although
delegate_taskis already listed directly inDIRECT_TOOLS(McpToolExposure.ts:8-16), searching"machine"or"linked"returnst3_thread_handoffalongsidet3_environment_link*(score1each) whiledelegate_taskscores0, increasing handoff's salience in tool-search results.
Composer
@-mentioned environment chips lead witht3_thread_handoff(when attached)- Plain-text fleet prompts do not receive this text, but when a user attaches an environment chip,
packages/shared/src/composerContextReferences.ts:449(updated in#44774) puts handoff in the first sentence:"To move this thread, pass this environmentId to t3_thread_handoff. For other work, link it if needed with t3_environment_link. Pass environmentId, or target.environmentId for delegate_task."
- Plain-text fleet prompts do not receive this text, but when a user attaches an environment chip,
Eval coverage gap (not a runtime cause)
evals/mcp-tool-use/cases/orchestration.ndjson:49-54(#44774) added 6 handoff cases (5 expect handoff, 1 forbids it).- Line
48tests delegating to one of several linked machines by load, and explicitly uses the word "Delegate". - Lines
58-59(#49075) both start from a post-link wake notice that explicitly namesdelegate_taskandtarget.environmentId. - There is no eval case for a plain-text request to run a task across multiple already-linked machines without the word "delegate", without an environment chip, and without a link-accepted notice.
Suggested Fix#
packages/provider-core/src/server/orchestrationInstructions.ts:10-22(highest priority):- Add
"a task on another machine"to thedelegate_taskexceptions in the native-subagent bullet (lines 10–14). - In line 21, explicitly contrast the two intents: e.g., "For a task on a linked machine (or each linked machine), call
delegate_taskwithtarget.environmentId. When the user wants to continue this conversation there, callt3_thread_handoff." Scope thethreadIdnote to tools acting on an existing remote thread.
- Add
apps/server/src/mcp/toolkits/orchestrator/tools.ts:- Add
Another machine: target.environmentId.todelegate_task's description. - Tighten
t3_thread_handoff's description with an intent-based scope (e.g., "Use when the user wants this conversation to continue on another machine."), preserving existing departure/unlinked-move evals without adding fleet-task keywords that would inflatetool_searchmatches.
- Add
packages/shared/src/composerContextReferences.ts:449(and updatecomposerContextReferences.test.ts:338-345):- Lead with acting/delegating there (
Pass environmentId, or target.environmentId for delegate_task. Link it if needed with t3_environment_link.), and placet3_thread_handoffsecond for moving/continuing this thread.
- Lead with acting/delegating there (
evals/mcp-tool-use/cases/orchestration.ndjson:- Add a regression case with 2 reachable already-linked machines and a plain-text prompt like "Update pnpm on both of my linked computers" (no "delegate", no environment chip, no link-accepted notice), expecting
delegate_taskonce per distincttarget.environmentIdandnotCalls: ["t3_thread_handoff", "t3_thread_launch", "t3_environment_link"].
- Add a regression case with 2 reachable already-linked machines and a plain-text prompt like "Update pnpm on both of my linked computers" (no "delegate", no environment chip, no link-accepted notice), expecting
Investigated and drafted with Gemini 4 Neon (Medium) via the Antigravity harness, and independently fact-checked and reviewed with GPT-6.2 Astra (Medium) via the Codex harness in T3 Code; both models agree on the diagnosis and suggested fixes.
tanstack-source added labelsbug
juliusmarminge added labelsneeds more info
@juliusmarminge Checked my local sessions — all 3 handoff occurrences were Codex with
gpt-6.2-sol(reasoningEffort: high, selected on all 3 and confirmed executed on the Dec 3 run), and all of them were plain-text prompts (no@-mentioned environment chips).There's also a really clear before/after split on the exact same model (
Codex / gpt-6.2-sol high) around#44774(Nov 29):Raised
t3_thread_handoffinstead of delegating (after#44774, no"subagent"/"delegate"in prompt)## Date (UTC) Provider & Model Prompt @-Chip?What Happened 1 2026-12-03 Codex / gpt-6.2-sol(high)"Install this skill across the fleet please. <url>"No Finished local machine; SSH to second machine failed → t3_environment_links→t3_project_list(plus thread search/read) →t3_thread_handoff2 2026-12-06 Codex / gpt-6.2-sol(high)"Install on Desktop now please."(same thread, later run)No t3_environment_links→t3_thread_handoff; after I replied"Yes delegate.",delegate_tasksucceeded3 2026-12-06 Codex / gpt-6.2-sol(high)Run 1: "Upgrade Antigravity on both computers please."/ Run 2:"It's online now, try again."No SSH to second machine failed → t3_environment_links→t3_thread_handoff; after I replied"Use a subagent instead please.",delegate_tasksucceededDelegated correctly (for comparison)#
- Before
#44774(Nov 21–25): The sameCodex / gpt-6.2-sol (high)delegated automatically on plain-text prompts without saying"subagent"or"delegate"— e.g."Yes, please copy it over and launch it on the other desktop.","And push to main and then pull it in the desktop as well.", and"Rebuild and restart the running app on Desktop as well please."(4/4 runs, no@-chips). - After
#44774(Dec 3–4): Every session that delegated directly to the linked machine explicitly included"subagent"or"delegate"in my prompt — e.g."Spin up a T3 subagent on the Desktop computer and download this and run it"(2 runs ongpt-6.2-sol high) and"Use a subagent on the desktop..."/"...T3-managed delegate limit..."(3 runs ongpt-6.1-terra high).
Researched and written with Gemini 4 Neon (Medium) in the Antigravity harness through T3 Code (session data verified with GPT-6.2 Astra via Codex).
- Before
juliusmarminge removed labelsneeds more info
Sign in to join this conversation.
@dylan1020 Which provider and model (e.g. Claude Code with Opus, Codex with GPT-6.1 Sol, Antigravity with Gemini 4 Neon) were the agents running when they raised the 'Move this thread to another machine?' card instead of delegating, and did you @-mention the machines as chips or just type the request?