Skip to content

OpenCode provider: subagents spawned via delegation never appear in the Agents pane (no task.* events) #11894

Closed as not planned

Description

@gustavocaiano

What happened

When using T3 Code with an OpenCode-based thread, subagents spawned via delegation (the native task/subagent tool) never appear in the Agents pane. They only show up as a "Subagent task" row in the chat timeline. In contrast, Claude Code and Codex threads show live subagent entries in the Agents pane.

Why

The Agents pane is built purely from runtime task.started / task.progress / task.completed events bearing parentAgentId/task linkage:

  • Claude adapter: emits task_started/task_progress/task_notification system messages → task.* events ✅
  • Codex adapter: collabAgent/* notifications → mapCollabAgentEvent → task.* events ✅
  • Antigravity (ACP) adapter: promotes ToolCallUpdated to subagent task.* events ✅
  • OpenCode adapter: has no equivalent path ❌. In message.part.updated handling, tool parts are classified by toToolLifecycleItemType() into collab_agent_tool_call chat items only. Child opencode sessions (session.created with parentID) are tracked just for permission/question routing (relatedSessionIds), never promoted to task.* events.

All the data needed is already available at the emit site: part.state.metadata.sessionId (child session), part.state.input.subagent_type (agent name), part.state.input.description, part.callID — and the tool-part handler shares the same closure as the adapter's runtime emit.

Suggested fix

In the OpenCode adapter's tool-part handler, when the tool is a delegation tool (task/subagent) and part.state.metadata.sessionId exists, emit alongside the item event (deduped per callID):

  • task.started once: { taskId: sessionId, taskType: "subagent", title: input.description ?? state.title, role: input.subagent_type, toolUseId: callID, model? }
  • task.progress on running updates: { taskId, description }
  • task.completed on completed/error: { taskId, status: "completed" | "failed", summary }

The shared fold layer (runtimeEventToActivities / taskLinkageActivityFields) and the UI already render these correctly for any provider — no UI changes needed.

I have a working prototype patch against the 0.0.41-nightly.20260914 server bundle (OpenCode adapter, insertion right after const itemType = toToolLifecycleItemType(part.tool);) that restores full Agents-pane parity; happy to share or open a PR.

Environment

  • Version: 0.0.41-nightly.20260914.1687 (also verified absent in 0.0.41-nightly.20260915.1752)
  • Provider: OpenCode (with the oh-my-opencode-slim orchestration plugin, though the issue reproduces with native delegation too)

Activity

  1. juliusmarminge commented on Sep 15, 2026

    @juliusmarminge
    Member

    Closing as a duplicate of #5952. Same report: OpenCode native Task/subagent child sessions never appear in the Agents panel because OpenCodeAdapter does not emit task.* activities (only collab_agent_tool_call chat items).

    Track the remaining work in #5952 (open fix PRs: #7393, #10858).

  2. juliusmarminge commented on Sep 15, 2026

    @juliusmarminge
    Member

    Duplicate of #5952.

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

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions