Package Exports
- opencode-orchestrator
Readme
Overview
OpenCode Orchestrator is a framework designed to manage complex software engineering tasks through parallel multi-agent execution. It extends the capabilities of standard AI agents by introducing a hierarchical delegation model and a multi-stage verification pipeline.
Key Characteristics
- Parallel Execution: Manages multiple concurrent agent sessions to accelerate development.
- Hierarchical Delegation: Supports recursive task decomposition (Fractal Spawning) for complex requirements.
- Integrated Verification: Employs a multi-stage pipeline (Unit & Integration) to ensure code quality.
- Persistent State: Uses structured logging to maintain state and recover from interruptions.
β‘ Quick Start
npm install -g opencode-orchestratorIn an OpenCode environment:
/task "Implement a real-time collaborative editor using WebSocket"ποΈ Architecture
The system is built upon two core mechanisms that handle scaling and quality control.
HPFA (Hyper-Parallel Fractal Architecture)
HPFA is a parallel execution model that enables task decomposition at scale.
- Managed Concurrency: Orchestrates up to 50 parallel agent sessions simultaneously.
- Recursive Scaling: Allows "Worker" agents to spawn sub-workers for modular tasks, ensuring deep architectural coverage.
MSVP (Multi-Stage Verification Pipeline)
MSVP is a structured verification process that decouples implementation from quality assurance.
- Stage 1 (Unit Verification): Reviewers validate individual module changes and run local tests immediately after implementation.
- Stage 2 (Integration Review): A master reviewer verifies cross-module consistency and system integrity after all individual units are completed.
π Workflow Diagram
[User Task Input]
β
βββββββββββΌββββββββββ
β COMMANDER β (Orchestration context)
βββββββββββ¬ββββββββββ
β
ββββββββββββββββββΌβββββββββββββββββ
β Phase 0: Parallel Discovery β (Structure, Tech Stack, Docs, Infra)
ββββββββββββββββββ¬βββββββββββββββββ
β
βββββββββββΌββββββββββ
β PLANNER β (Create Hierarchical Plan)
βββββββββββ¬ββββββββββ
β
ββββββββββββββββββΌβββββββββββββββββ
β Phase 1: Parallel Execution β (HPFA Implementation Grid)
ββββββββ¬ββββββββββ¬ββββββββββ¬βββββββ
β β β
ββββββββΌβββ ββββββΌββββ βββββΌβββββ
β WORKER β β WORKER β β WORKER β (Fractal Spawning)
ββββββββ¬βββ ββββββ¬ββββ βββββ¬βββββ
β β β
ββββββββΌβββ ββββββΌββββ βββββΌβββββ
β REVIEWERβ β REVIEWERβ β REVIEWERβ (Stage 1: Unit Verification)
ββββββββ¬βββ ββββββ¬ββββ βββββ¬βββββ
β β β
ββββββββΌββββββββββΌββββββββββΌβββββββ
β Sync Barrier β (Wait for all units)
ββββββββββββββββββ¬βββββββββββββββββ
β
βββββββββββΌββββββββββ
β MASTER REVIEWER β (Stage 2: System Integration)
βββββββββββ¬ββββββββββ
β
βββββββββββΌββββββββββ
β Mission Sealed? β
βββββββββββ¬ββββββββββ
No β β Yes
[Loop] [Complete]π System Roles
| Role | Responsibility | Key Actions |
|---|---|---|
| Commander | Mission Control | Task assignment, conflict resolution, global synchronization |
| Planner | Architecture | Environment analysis, dependency mapping, TODO generation |
| Worker | Implementation | Code writing, file modification, unit test creation |
| Reviewer | Quality Control | Static analysis, build verification, integration testing |
π οΈ Features
- Concurrent Task Management: Efficiently handles up to 50 background agent sessions.
- Automated Context Synthesis: Parallel scouters gather environment intelligence (Structure, Stack, Docs) instantly.
- Synchronized Verification: Ensures all distributed tasks pass Stage 1 review before final integration.
- Fault Tolerance: Automatically resumes progress from checkpoints in case of tool or session failure.
- Context Optimization: Monitors context window limits and performs automated compaction for long sessions.
Piano Developer's Note
OpenCode Orchestrator was developed to solve the "sequential bottleneck" in AI-assisted coding. By treating agents as distributed processing units rather than just chat interfaces, we aim to provide a more reliable and scalable autonomous engineering experience.
π License
MIT License. See LICENSE for details.