Description
Custom agents defined in .opencode/agents/*.md cannot access the task tool even when explicitly configured in frontmatter with tools: { task: allow } and mode: primary or mode: all. The task tool is completely absent from the agent's available tool list.
Steps to Reproduce
- Create a custom agent file at
.opencode/agents/my-agent.md:
---
description: Custom workflow coordinator
mode: primary
model: anthropic/claude-opus-4-6
tools:
* : allow
task : allow
---
You are a workflow coordinator that needs to spawn sub-agents.
- Start OpenCode and switch to the custom agent
- Try to use the
task() tool to spawn a sub-agent
- The agent reports that the
task tool is not available in its tool list
Expected Behavior
Custom agents with tools: { task: allow } in frontmatter should have access to the task tool, allowing them to spawn sub-agents just like built-in primary agents.
Actual Behavior
- The
task tool is completely missing from the custom agent's tool list
- The agent cannot spawn sub-agents via
task()
- Only built-in primary agents (like Build, Plan) can use the
task tool
- Custom agents can see all other tools (bash, read, write, etc.) but not
task
Additional Context
Documentation vs Reality
The documentation mentions using permission: for tool configuration:
However, in the current version (v1.2.6), only the tools: syntax works for opening OpenCode without errors. When using permission:, OpenCode fails to start properly.
Workaround Attempted
Tried various frontmatter configurations:
mode: primary + tools: { task: allow } ❌
mode: all + tools: { task: allow } ❌
mode: subagent + tools: { task: allow } ❌
permission: { task: allow } ❌ (causes startup failure)
None of these configurations make the task tool available to custom agents.
Environment
- OpenCode version: v1.2.6
- OS: Windows 10 (Git Bash)
- Model: anthropic/claude-opus-4-6
Related Issues
This appears to be related to but distinct from #8114, which addressed nested sub-agents for built-in agents. This issue specifically affects custom agents defined via markdown files, not built-in agents.
Impact
This limitation prevents users from creating custom orchestrator agents that coordinate multiple sub-agents, which is a common pattern for complex workflows. Users are forced to use built-in agents or manually coordinate tasks without delegation.
Description
Custom agents defined in
.opencode/agents/*.mdcannot access thetasktool even when explicitly configured in frontmatter withtools: { task: allow }andmode: primaryormode: all. The task tool is completely absent from the agent's available tool list.Steps to Reproduce
.opencode/agents/my-agent.md:task()tool to spawn a sub-agenttasktool is not available in its tool listExpected Behavior
Custom agents with
tools: { task: allow }in frontmatter should have access to thetasktool, allowing them to spawn sub-agents just like built-in primary agents.Actual Behavior
tasktool is completely missing from the custom agent's tool listtask()tasktooltaskAdditional Context
Documentation vs Reality
The documentation mentions using
permission:for tool configuration:However, in the current version (v1.2.6), only the
tools:syntax works for opening OpenCode without errors. When usingpermission:, OpenCode fails to start properly.Workaround Attempted
Tried various frontmatter configurations:
mode: primary+tools: { task: allow }❌mode: all+tools: { task: allow }❌mode: subagent+tools: { task: allow }❌permission: { task: allow }❌ (causes startup failure)None of these configurations make the
tasktool available to custom agents.Environment
Related Issues
This appears to be related to but distinct from #8114, which addressed nested sub-agents for built-in agents. This issue specifically affects custom agents defined via markdown files, not built-in agents.
Impact
This limitation prevents users from creating custom orchestrator agents that coordinate multiple sub-agents, which is a common pattern for complex workflows. Users are forced to use built-in agents or manually coordinate tasks without delegation.