Skip to content

feat(core): add task-parallel tool for concurrent subtasks - #60342

Closed
everest-an wants to merge 1 commit into
anomalyco:devfrom
everest-an:task-parallel-v2
Closed

everest-an wants to merge 1 commit into
anomalyco:devfrom
everest-an:task-parallel-v2

Conversation

@everest-an

Copy link
Copy Markdown

Summary

Adds a built-in task-parallel tool that fans out 2–5 independent subtasks concurrently, waits for all of them, and returns one combined summary.

This is a fresh V2 port of #47107 (the original PR was auto-closed by the stale-PR bot). dev has since moved the tool layer to packages/core/src/tool/plugin/, so the old branch could not be rebased; this implementation reuses the current subagent tool machinery.

How it works

  • Validates 2–5 tasks and applies the same experimental.subagent_depth limit as subagent.
  • Resolves each agent and asserts the task-parallel permission.
  • Creates one child session per task, prompts it, starts a SubagentJob, then waits for every job with Effect.all (concurrency unbounded, max 5).
  • Returns { results } plus a <parallel-tasks> summary.
  • A failing task is reported as error; the others still complete.
  • Backgrounded children are reported as running rather than silently dropped.

Tests

packages/core/test/tool-task-parallel.test.ts:

  • runs two independent subtasks and returns one combined summary
  • rejects fewer than 2 / more than 5 tasks
  • reports a failed subtask without failing the others
  • prevents nested fan-out via subagent_depth

bun test test/tool-task-parallel.test.ts → 5 pass.
bun run typecheck:tsc → clean.

Related

Port of anomalyco#47105 / anomalyco#47107 to V2's tool plugin architecture. Reuses subagent sessions and jobs, waits for all children with Effect.all, and isolates per-task failures.
@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Oct 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 72 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 72-hour window.

Feel free to open a new pull request that follows our guidelines.

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Nov 1, 2026
@github-actions github-actions Bot closed this Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant