anomalyco / anomalyco/opencode
task tool missing from tool list despite permission.task being explicitly allowed
@rekram1-node is already working on this.
Since Jul 27, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Environment
- OpenCode Desktop (installer-based install, not CLI/npm)
- Custom OpenAI-compatible provider (
@ai-sdk/openai-compatible) pointed at a local proxy - Windows
What I did
I set up a primary agent with two subagents. The primary agent's config granted permission.task access to both subagent names explicitly, something like:
"permission": {
"task": {
"subagent-one": "allow",
"subagent-two": "allow",
"*": "deny"
}
}
Both subagents were defined with mode: subagent and their own restricted permissions (no edit/bash/write).
I tried this two ways:
- As a fully custom primary agent defined in
opencode.json. - As an override of the built-in
buildagent (same prompt and permission block, just placed underagent.buildinstead of a custom agent name), on the assumption that built-in agents might not hit the same limitation as custom ones.
Expected behavior
The primary agent should have a task tool available so it can actually delegate to the two subagents as independent calls.
Actual behavior
In both cases, the model's own tool list comes back as:
bash, edit, glob, grep, read, skill, todowrite, webfetch, write
No task tool anywhere, regardless of the permission.task config. This isn't the model guessing wrong — it genuinely doesn't have the tool, and it reports that plainly when asked to delegate. Same result whether the agent is custom or an override of build.
Related report
There's an existing open issue describing what looks like the same underlying problem for markdown-defined custom agents ("Custom agents cannot access task tool despite frontmatter configuration"), where tools: { task: allow } / permission: { task: allow } in frontmatter doesn't expose the tool even on mode: primary/all. My case adds one data point beyond that: it also happens when overriding the built-in build agent through opencode.json rather than defining a new markdown agent, so the scope might be wider than currently tracked.
Things worth checking during triage (not confirmed, just flagging)
- Whether
taskexposure depends on some internal flag that a config-definedmode: primaryagent doesn't actually get, even though it's functionally "primary." - Whether using a custom OpenAI-compatible provider instead of a native Anthropic/OpenAI provider affects whether
taskgets included in the tool schema sent to the model. subagent_depthdefaults to 1, but that shouldn't matter here since this is failing at the very first level of delegation, not a nested one.
Happy to share full config/logs if it helps narrow this down — let me know if this looks like the same root cause as the linked issue or something separate.
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.