anomalyco / anomalyco/opencode
[FEATURE]: Allow custom plugin tools to use the native subagent progress UI
@simonklee is already working on this.
Since Sep 11, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Feature hasn't been suggested before.
- I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
I would like OpenCode to provide an official opt-in API for custom plugin tools that create child sessions and behave like subagents to appear in the native subagent progress UI.
Currently, the CLI subagent UI only recognizes the built-in task tool because syncTaskTab contains this hard-coded check:
if (part.tool !== "task") {
return false
}
Location:
packages/opencode/src/cli/cmd/run/subagent-data.ts
This means a plugin tool can:
- create a real OpenCode child session;
- set the child session’s
parentID; - include
sessionIdandparentSessionIdin its tool metadata; - update its running title and metadata with
context.metadata();
but it still cannot use the native subagent progress footer or inspector because its tool name is not task.
I propose an official metadata-based opt-in contract, for example:
metadata: {
subagent: true,
sessionId: "ses_..."
}
OpenCode could then recognize either the built-in task tool or an explicitly marked custom tool:
const isSubagent =
part.tool === "task" ||
metadata(part, "subagent") === true
if (!isSubagent) {
return false
}
It may be better to use a namespaced or typed field chosen by the maintainers, such as:
metadata: {
opencode: {
subagent: true,
sessionId: "ses_..."
}
}
The exact API is less important than having a documented, stable opt-in mechanism.
Benefits
- Custom tools that delegate work to external agents can use OpenCode’s existing subagent progress UI.
- Users can see that long-running delegated tasks are active instead of assuming they are frozen.
- Users can inspect child-session activity through the same interface used by built-in subagents.
- Plugin authors do not need to replace or shadow the built-in
tasktool. - Native subagent behavior remains unchanged because custom tools must explicitly opt in.
- OpenCode gains a reusable extension point for external agent integrations.
Safety and compatibility
This should be opt-in only. OpenCode should still require a valid child session that belongs to the current parent session before displaying it as a subagent.
The built-in task behavior should remain unchanged. Custom plugin tools should not need to use the reserved task tool name, because registering another tool with that name could conflict with or replace native delegation.
A documented metadata contract would provide a safer and more maintainable integration path.
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.
Assessment
This issue has not been assessed yet.