You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE]: Allow configurable subagent-to-subagent task delegation with call limits #7296
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Problem
Currently, task.ts hardcodes task: false for all subagent sessions (lines 65-69, 132-137), preventing any subagent from delegating to another subagent. This blocks legitimate workflows like:
Principal-Partner delegating to Assistants
Assistant-Sonnet having Assistant-Flash cross-check its work
Assistant-Flash asking Assistant-Sonnet for thorough analysis
The agent config already supports granular task permissions:
But this config is ignored because task.ts unconditionally overrides it.
Proposed Solution
Respect agent-level task permissions instead of hardcoding task: false
Add optional task_limit config to prevent infinite loops:
assistant-sonnet: {
tools: { task: true },
permission: {
task: { *: deny, assistant-flash: allow }
},
task_limit: 3 // Max task calls per session (0 = current behavior)
}
Use Case
Building an Agentic Collaboration Framework where:
Principal-Opus orchestrates work
Principal-Partner (subagent) can delegate to Assistants
Assistant-Sonnet and Assistant-Flash can cross-check each other's work
The permission system already expresses "Sonnet can only task Flash" - it just needs to be honored.
Backward Compatibility
Default behavior unchanged - task_limit: 0 (or absent) means task tool disabled for subagents, matching current behavior. Only users who explicitly configure permissions get the new capability.
I am exploring trying to make a PR for this myself. I have no coding background, or developer experience. But I figure it's time to try to vibe code a contribution.
It also seemed logical, that at the very least I need to construct a more detailed design for the PR to make sure it does what my use-case requires.
My thinking is, even if I fail miserably in producing fully working code that can be pulled into the repo, I will succeed in defining a design that experienced developers managing the project can use to make a proper PR.
I'd even be inclined to view parts of this as a bug since I was actively able to leverage subagents that could invoke other subagents before the v1.1.1 release.
Even though task was hardcoded to false, I could override it by adding task: true into my subagent definitions. For example, I have a research orchestrator subagent that delegates to more focused subagents scoped to different groups of docs and sources that I didn't want to group together into one agent.
Agent YAML frontmatter example:
---
description: Research coordinator that routes queries to appropriate sources and consolidates results. Cross-cutting utility for all SDLC agents.
mode: subagent
tools:
// ... other tools here
task: true
---
Working Example from v1.0.223:
Running the same test with the same config on newer versions of OpenCode doesn't work any longer. I'm sure there's more nuance to the topic here in general, but it would be nice to have that optional override behavior back.
Activity
github-actions commentedon Jan 8, 2026
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
NamedIdentity commentedon Jan 9, 2026
I am exploring trying to make a PR for this myself. I have no coding background, or developer experience. But I figure it's time to try to vibe code a contribution.
It also seemed logical, that at the very least I need to construct a more detailed design for the PR to make sure it does what my use-case requires.
My thinking is, even if I fail miserably in producing fully working code that can be pulled into the repo, I will succeed in defining a design that experienced developers managing the project can use to make a proper PR.
akirfman commentedon Jan 9, 2026
+1 to this feature request.
I'd even be inclined to view parts of this as a bug since I was actively able to leverage subagents that could invoke other subagents before the
v1.1.1release.Example from
v1.0.223(https://github.com/anomalyco/opencode/blob/01237c5325f5c3eda142f459b22f902b5aa07d7c/packages/opencode/src/tool/task.ts)Even though task was hardcoded to false, I could override it by adding
task: trueinto my subagent definitions. For example, I have a research orchestrator subagent that delegates to more focused subagents scoped to different groups of docs and sources that I didn't want to group together into one agent.Agent YAML frontmatter example:
Working Example from v1.0.223:
Running the same test with the same config on newer versions of OpenCode doesn't work any longer. I'm sure there's more nuance to the topic here in general, but it would be nice to have that optional override behavior back.
NamedIdentity commentedon Jan 11, 2026
I have submitted a PR which provides these features. #7756
macastro9714 commentedon Jan 19, 2026
@NamedIdentity I'd suggest to not close the issue until the PR gets approved, since it might still be rejected or not reviewed/allowed
NamedIdentity commentedon Jan 19, 2026
@macastro9714 I'm new to this so I'll go with your suggestion to reopen this issue until the PR is accepted into main.
github-actions commentedon Mar 26, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.
NamedIdentity commentedon Mar 26, 2026
Issue is not closed. PR is not yet merged. #7756 (comment)