Description
When an LLM generates multiple Task (subtask) tool calls in a single response, they execute one at a time instead of concurrently. In packages/opencode/src/session/prompt.ts, the session loop does tasks.pop() to grab a single subtask, awaits it, then continues the loop — so even 3 simultaneous Task calls run sequentially.
Regular tool calls already run in parallel via Promise.all in the batch/processor path, but subtask parts bypass that entirely.
Steps to reproduce
- Create an agent that dispatches 3 Task tool calls in one response (e.g. an orchestrator that sends work to 3 subagents)
- Observe that each subagent runs only after the previous one completes
- Expected: all 3 subagents run concurrently
OpenCode version
Latest dev branch (commit c6bd320)
Operating System
macOS 15.5 (darwin-arm64)
Description
When an LLM generates multiple Task (subtask) tool calls in a single response, they execute one at a time instead of concurrently. In
packages/opencode/src/session/prompt.ts, the session loop doestasks.pop()to grab a single subtask,awaits it, thencontinues the loop — so even 3 simultaneous Task calls run sequentially.Regular tool calls already run in parallel via
Promise.allin the batch/processor path, but subtask parts bypass that entirely.Steps to reproduce
OpenCode version
Latest dev branch (commit c6bd320)
Operating System
macOS 15.5 (darwin-arm64)