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
Background subagents cause problems with local agents #66360
v2.3.0 introduced "Background Subagents by Default". Technically that "by default" is not true, #63382 made subagents always run in the background. Which causes problems when running local agents.
Proposed solution:
Please make blocking sub-agent calls optional.
Plugins
No response
OpenCode version
v2.4.1
Steps to reproduce
Have a computer with a limited amount of VRAM, that can run exactly 1 of your LLM models at a time.
Have a model as an agent
Have a different model configured as a subagent
Make the agent call a subagent
Expected behavior:
Before background subagents were forced on us, the agent called the subagent, the agent was removed from memory, the subagent was loaded into memory, did its job, was removed from memory and the agent was loaded back into memory.
Current behavior:
The agent calls the subagent. The agent gets removed from memory. The subagent gets loaded into memory and starts to process its prompt. OpenCode moves on wants to move on with the parent agent. The parent agent and the subagent now compete for being in memory. The parent agent's context probably already large enough so re-processing would cause timeouts and the subagent's context growing bigger and bigger it will eventually end up with context re-processing timeouts as well. Practically the current behavior causes an unnecessary fight for resources for local models all of the time, and a deadlock quite often.
Thanks for the clear write-up, @balazsmiklos85. I think this is a duplicate of #64073, which asks to bring back foreground (blocking) subagent execution. Several comments there describe your setup: self-hosted models that can serve only one request at a time, where the parent and the subagent compete for the same slot.
For context: #63382 made subagents always run in the background and removed the subagent tool's background option.
Possible duplicates and related issues, ordered by likelihood:
feat(core): add subagent concurrency limit #55983 (open PR): would add experimental.subagent_concurrency, a cap on how many subagents run at the same time. It's related, but I can't say whether it would stop the parent and a subagent from competing.
I'm closing this issue now as a duplicate of #64073. Please add your details there, especially the deadlock you see with one model loaded at a time. If you think this is a different problem, reply here and this issue will be reopened.
Activity
opencodejr commentedon Nov 25, 2026
Thanks for the clear write-up, @balazsmiklos85. I think this is a duplicate of #64073, which asks to bring back foreground (blocking) subagent execution. Several comments there describe your setup: self-hosted models that can serve only one request at a time, where the parent and the subagent compete for the same slot.
For context: #63382 made subagents always run in the background and removed the subagent tool's
backgroundoption.Possible duplicates and related issues, ordered by likelihood:
experimental.subagent_concurrency, a cap on how many subagents run at the same time. It's related, but I can't say whether it would stop the parent and a subagent from competing.I'm closing this issue now as a duplicate of #64073. Please add your details there, especially the deadlock you see with one model loaded at a time. If you think this is a different problem, reply here and this issue will be reopened.