Skip to content

feat(agent): add orchestrate subagent for task decomposition#24450

Open
kuro-toji wants to merge 1 commit intoanomalyco:2.0from
kuro-toji:feat/orchestrator-agent
Open

feat(agent): add orchestrate subagent for task decomposition#24450
kuro-toji wants to merge 1 commit intoanomalyco:2.0from
kuro-toji:feat/orchestrator-agent

Conversation

@kuro-toji
Copy link
Copy Markdown

@kuro-toji kuro-toji commented Apr 26, 2026

Issue for this PR

Closes #24447 (partially - addresses need for better task decomposition)

Type of change

  • New feature

What does this PR do?

Add a new orchestrate subagent that breaks down complex multi-step tasks into parallel subtasks executed by specialized agents.

Problem: Large tasks require manual decomposition and coordination of multiple Task calls.

Solution: Automate task breakdown with an orchestrator that:

  1. Analyzes complex tasks
  2. Creates focused subtasks (2-5 items)
  3. Executes subtasks in parallel via Task tool
  4. Synthesizes results

Files Changed

File Change
packages/opencode/src/agent/prompt/orchestrate.txt New orchestrator prompt
packages/opencode/src/agent/agent.ts Register orchestrate agent
packages/opencode/src/tool/task.txt Document orchestrate usage

How did you verify your code works?

  • Code follows existing agent patterns (explore, general, plan)
  • Import added to agent.ts
  • Orchestrator has appropriate permissions (task, todowrite, question)
  • Task tool docs updated with orchestrate example

Checklist

  • I have not included unrelated changes in this PR
  • Follows existing agent registration patterns

Add a new 'orchestrate' subagent type that specializes in breaking down
complex multi-step tasks into smaller, manageable subtasks that can be
executed in parallel by specialized agents.

Key changes:
- packages/opencode/src/agent/prompt/orchestrate.txt: New prompt defining
  the orchestrator's role and workflow
- packages/opencode/src/agent/agent.ts: Register the new orchestrate
  agent with task permissions
- packages/opencode/src/tool/task.txt: Document orchestrate agent usage

The orchestrate agent:
1. Analyzes complex tasks
2. Breaks them into 2-5 focused subtasks
3. Executes subtasks in parallel via Task tool calls
4. Synthesizes results into cohesive solutions

This enables efficient handling of large tasks by parallelizing work
across multiple specialized agents (explore, general, build, plan).
@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Apr 26, 2026
@github-actions
Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on my search results, I found one potentially related PR:

Related PR:

The other results (PRs #7156, #17210, #18528) are about general subagent features but less directly related to the task decomposition and parallel execution pattern introduced in PR #24450.

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Apr 26, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@kuro-toji
Copy link
Copy Markdown
Author

Thanks for the context! I see there's related work in PR #20152 (team tool for parallel subagents).

My orchestrate agent approach is different - it's a prompt-based subagent that does task decomposition, rather than a new tool.

Should I:

  1. Close this PR and let feat(tool): add experimental team tool for parallel subagents #20152 handle parallel execution
  2. Pivot to support/complement the team tool with the orchestrate prompt approach
  3. Keep as-is for prompt-based task decomposition (which could work alongside the team tool)

Let me know which direction makes sense!

Bojun-Vvibe added a commit to Bojun-Vvibe/oss-contributions that referenced this pull request Apr 26, 2026
…ate subagent, litellm chatgpt-responses SSE non-stream output synthesis

- anomalyco/opencode#24459 merge-after-nits: 204-fast async command endpoint, drive-by import migration to split out
- anomalyco/opencode#24450 needs-discussion: orchestrate subagent semantics overlap with direct Task fanout
- BerriAI/litellm#26549 request-changes: 80-line transformation.py fix bundled with 31 _experimental/out HTML files + next bump
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