Repository navigation
Description
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
- Link environment A to environment B (Linked environments on).
- From a thread on A, run
delegate_taskwithtarget.environmentId = B, and let it finish. Don't settle it on B. - On B, call the MCP tool
t3_thread_listwithallProjects: true, includeSubagents: false. - Call
t3_thread_readon that same task thread on B.
Expected behavior
includeSubagents: false leaves the delegated task out, as the desktop and mobile apps do when they nest it under its parent. At the least, t3_thread_list and t3_thread_read should return delegatedFrom, so a caller can tell the task is not an ordinary top-level thread.
Actual behavior
The task is returned as an ordinary top-level thread: threadId: "mcp:launch:…", createdBy: "agent", creationSource: "mcp", parentThreadId: null, relationshipToParent: null. delegatedFrom is not in either tool's output. The parent thread on A records the task as a remote delegate.
The apps and the MCP tools classify the same thread differently:
packages/contracts/src/orchestrationV2.tshasisDelegatedAppThread(relationshipToParent === "subagent" || delegatedFrom != null), which treats it as delegated.ThreadManagementService.listProjectThreads(apps/server/src/orchestration-v2/ThreadManagementService.ts) filters withisListedThreadLineage, which only checksrelationshipToParentandsideChat, so the task passes as listed.- The thread shell mapping in
apps/server/src/mcp/OrchestratorMcpService.tsnever outputsdelegatedFrom(no reference in that file).
As a result, agents and outside tools that read thread state through MCP can't tell a cross-machine delegated task from a thread an agent launched itself. In our case, two separate agents wrongly concluded that an orchestrator had misused t3_thread_launch, and a status tool that already passes includeSubagents: false still showed every remote task as unread top-level work.
Related issues (why this isn't a duplicate)
- iPhone app lists cross-machine delegated tasks as top-level threads; desktop nests them under their parent #26854 / feat(server): delegate_task to a linked environment #16719 and Delegated tasks show as top-level sidebar threads when their parent is an older settled thread #35263 / fix(server): a task on a linked environment stays under its parent in trimmed shell snapshots #34870 fixed how the desktop and mobile apps nest these tasks. This issue is about the MCP thread tools, which neither fix touched.
- Agent-launched thread on a linked environment is hidden from the sidebar and missing from the parent's Lineage panel when t3_thread_launch gets delegatedFrom #27004 covers
t3_thread_launchwithdelegatedFrombeing hidden in the apps. One comment there notes in passing thatt3_thread_listandt3_thread_readdon't returndelegatedFrom. This issue is thedelegate_taskpath and the MCP list filter.
Impact
Minor bug or occasional failure
Version or commit
0.1.10-nightly.20261114.4695 on both machines (server and desktop). Code paths checked on main @ ed101ef.
Environment
Two macOS (arm64) machines running T3 Code servers, linked as environments with full access over Tailscale. Delegates ran OpenCode (opencode-go/deepseek-v4.1-flash).
Logs or stack traces
# t3_thread_list on B, includeSubagents: false (trimmed)
{"threadId":"mcp:launch:9229a46d…","title":"AGENTS.md Reddit split (B)",
"createdBy":"agent","creationSource":"mcp","status":"completed",
"parentThreadId":null,"relationshipToParent":null, ...}
# delegate_task call on A, same second the thread above was created (trimmed)
{"toolName":"mcp__t3-code__delegate_task",
"input":{"title":"AGENTS.md Reddit split (B)",
"target":{"environmentId":"<B>","providerInstanceId":"opencode", ...}}}
# A's parent thread then shows a subagent item: node:delegated-task:…:remote-delegate:…Screenshots, recordings, or supporting files
No response
Workaround
Filter client-side on threadId starting with mcp:launch: + createdBy: "agent" + creationSource: "mcp" + parentThreadId: null. This also hides threads an agent was asked to open with t3_thread_launch, so it's only a heuristic.
Posted by Claude Opus 5.5, an agent, on behalf of the user.
Activity