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
Control flow from main agent to subagent and back to main agent #2686
I use the main agent as an orchestrator, and the subagent as a specialized agent which does the atomic task. The prompts define control flow from main agent to sub agent and again back to main agent (as handover).
We see that when the main agent hands over to subagent, which might ask a user input, to accomplish its task, somehow the main agent starts over all again, this this goes into an endless loop.
Pretty confused why this is happening and how to fix this. Any help here please?
description: used so a primary agent can designate tasks to the given agent (this is basically a prompt for the main agent to know if it should call this agent or not)
prompt: this is the prompt the agent is being given
Now work with subagents almost impossible because thea are implemented just as prototype: some part of work can be delegated and that's all. You can't control anything:
decline some edit and guide in right path
queue some message to subagent to refine task details
ask user via subagent for some decision
Spoiler: all these points are not fantastic, already implemented in ClaudeCode and it's the reason why I switched to it.
Now Opencode subagents can just receive prompt for the subtask and return some result.
You can navigate to the child session and communicate with the subagent directly actually but we definitely need to make that permissions feedback better
You can navigate to the child session and communicate with the subagent directly actually but we definitely need to make that permissions feedback better
All messages sent to subagents are actually sent to main agent
Activity
venkatr21 commentedon Sep 19, 2025
@thdxr any inputs on this?
rekram1-node commentedon Sep 19, 2025
can you share a session of this? I havent seen it beforeedit: nvm I misunderstood post originally
anuramat commentedon Sep 19, 2025
shouldn't the
descriptionof the main agent be apromptinstead?rekram1-node commentedon Sep 19, 2025
just to note:
description: used so a primary agent can designate tasks to the given agent (this is basically a prompt for the main agent to know if it should call this agent or not)
prompt: this is the prompt the agent is being given
NaikSoftware commentedon Sep 21, 2025
its the same #2378
Now work with subagents almost impossible because thea are implemented just as prototype: some part of work can be delegated and that's all. You can't control anything:
Spoiler: all these points are not fantastic, already implemented in ClaudeCode and it's the reason why I switched to it.
Now Opencode subagents can just receive prompt for the subtask and return some result.
rekram1-node commentedon Sep 22, 2025
You can navigate to the child session and communicate with the subagent directly actuallybut we definitely need to make that permissions feedback betteredit: my bad mistake
NaikSoftware commentedon Sep 22, 2025
All messages sent to subagents are actually sent to main agent
rekram1-node commentedon Sep 22, 2025
@NaikSoftware you're right! I missed that thanks for calling out.
I raised with the team that some of the UX for subagents isn't quite as good as CC as you have called out. Thanks for the continuous feedback here