Skip to content

[Bug]: Custom agents cannot access task tool despite frontmatter configuration #14308

@DevSissi

Description

@DevSissi

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

  1. 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.
  1. Start OpenCode and switch to the custom agent
  2. Try to use the task() tool to spawn a sub-agent
  3. 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:

permission:
  task: allow

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.

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions