Skip to content

[Bug]: t3_thread_list includeSubagents:false still lists tasks delegated from a linked environment, and omits delegatedFrom #36956

Closed

Description

@coledeb

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

  1. Link environment A to environment B (Linked environments on).
  2. From a thread on A, run delegate_task with target.environmentId = B, and let it finish. Don't settle it on B.
  3. On B, call the MCP tool t3_thread_list with allProjects: true, includeSubagents: false.
  4. Call t3_thread_read on 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.ts has isDelegatedAppThread (relationshipToParent === "subagent" || delegatedFrom != null), which treats it as delegated.
  • ThreadManagementService.listProjectThreads (apps/server/src/orchestration-v2/ThreadManagementService.ts) filters with isListedThreadLineage, which only checks relationshipToParent and sideChat, so the task passes as listed.
  • The thread shell mapping in apps/server/src/mcp/OrchestratorMcpService.ts never outputs delegatedFrom (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)

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions