fix(opencode): show native Task subagents in the Agents panel
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 23k
- Forks
- 5.9k
- Avg merge
- 11h 14m
- Merged PRs (30d)
- 357
Description
Summary
OpenCode's native Task tool successfully creates and completes child-agent sessions inside a T3 Code thread, but the thread's Agents panel remains empty and says No agents yet.
This is specific to the OpenCode provider integration, not a refusal or failure by the selected model: the parent transcript contains multiple completed Task rows with distinct child session IDs and returned task results.
Area: apps/server (OpenCode provider adapter), observed in the apps/web Agents panel.
Steps to reproduce
- Start T3 Code Nightly
0.0.33-nightly.20260809.1047. - Open a thread using the OpenCode provider with OpenCode
1.18.15, theMiniMax-M3model, Build mode, and Full access. - Ask the primary agent to use OpenCode's native
Tasktool to launch at least two independent subagents. For example:Use the Task tool to launch two independent Explore subagents, each inspecting a different part of this project. - Wait until the parent transcript shows multiple completed
Tasktool calls with distinct<task id="ses_..." state="completed">results. - Open the thread's Agents panel.
Expected behavior
Each OpenCode child session created by the native Task tool appears in the Agents panel with its task identity and lifecycle state. Completed tasks remain visible as settled agents, consistent with the panel's promise that subagents spawned by the thread appear there.
Actual behavior
The native OpenCode subagents execute and return results to the parent transcript, but the Agents panel remains empty and displays:
No agents yet
When this thread spawns subagents or runs a workflow, they show up here with live status, activity, and token usage.
In the supplied reproduction, at least four distinct completed Task rows are visible while the panel still reports no agents.
Affected area
- OpenCode provider sessions using the native
Tasktool. - The server-side OpenCode event adapter and the persisted
task.*activity stream consumed by the Agents panel. - The web/desktop Agents panel roster for those threads.
Runtime or environment
- T3 Code Nightly:
0.0.33-nightly.20260809.1047 - T3 Code release commit:
062b4618c229f3e2f13e44efd8dab8c71ad33dae - OpenCode CLI:
1.18.15 - Model:
MiniMax-M3 - Agent/mode: Build
- Access mode: Full access
- Connection: Local checkout
- OS: macOS
26.5.2, Apple silicon (arm64)
Evidence
- The supplied screenshots show multiple completed OpenCode
Taskcalls with differentses_...task IDs in the parent transcript, followed by an Agents panel that still saysNo agents yet. - OpenCode documents subagents as child sessions invoked by primary agents and provides navigation between parent and child sessions: OpenCode agents documentation.
- In OpenCode
1.18.15, the native Task tool creates a session withparentID, then publishesparentSessionId, childsessionId, and model metadata on the tool state:packages/opencode/src/tool/task.ts. - In the affected T3 Code release, the OpenCode adapter recognizes task/agent tool names as
collab_agent_tool_call, but emits their lifecycle only as genericitem.started,item.updated, anditem.completedevents:apps/server/src/provider/Layers/OpenCodeAdapter.tsand the tool-part event mapping. - The same adapter discards subscribed events whose session ID differs from the parent OpenCode session, so child-session events do not reach the parent thread's activity projection:
OpenCodeAdapter.ts. - The Agents model is populated only from persisted
task.started,task.progress,task.updated, andtask.completedactivities; genericitem.*events do not create roster entries:packages/client-runtime/src/state/subagentRuntime.ts.
Together, these paths explain the observed behavior: T3 Code renders the parent Task tool call in the transcript but never projects an OpenCode child-agent lifecycle into the task.* stream that feeds the Agents panel.
Impact
Major degradation or frequent failure.
For OpenCode users, provider-native subagents are completely absent from the only fleet roster even while they are running or after they complete. Users cannot see which child agents exist, their status, activity, elapsed time, model, token usage, or completion state, and the empty-state message incorrectly implies that no subagents were spawned.
Additional context
The red/green closure signal is direct: with an OpenCode provider thread that produces two or more native Task child sessions, the current build leaves the Agents panel empty; a corrected build shows one stable roster entry per child session and transitions each entry to its actual terminal state without duplicating ordinary non-agent tools.
Existing-issue search did not find a duplicate. #5479 concerns a different path—agent CLIs launched as Bash child processes from another provider—whereas this report concerns first-party OpenCode Task tool calls in an OpenCode provider thread. #2778 concerns child-session permission prompts that can hang a task, not successful child sessions missing from the Agents roster.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with apps/server/src/provider/Layers/OpenCodeAdapter.ts, especially the task-tool mapping and the session-ID filtering, then trace how packages/client-runtime/src/state/subagentRuntime.ts consumes task.* activities. Reproduce the native Task flow with multiple child sessions and verify that each child gets one stable Agents-panel entry with the observed lifecycle and terminal state, without ordinary tools creating entries.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend, frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100