feat: Implement opencode-council-swarm - Multi-agent coordination system #6822

Closed
opened 2026-02-16 18:05:22 -05:00 by yindo · 2 comments
Owner

Originally created by @mannyluvstacos on GitHub (Jan 19, 2026).

Originally assigned to: @thdxr on GitHub.

Feature Request

Implement a "council" or "swarm" architecture for coordinating multiple OpenCode agents working together on complex tasks.

Motivation

Currently, agents (Koda, Vor, Ralph, Planner, Explore, Ideator) operate independently or in simple parent-child relationships. A council/swarm system would enable:

  1. Parallel agent execution - Multiple agents working on different aspects simultaneously
  2. Consensus mechanisms - Agents voting or deliberating on decisions
  3. Specialized roles - Different agents handling their domain expertise
  4. Conflict resolution - Resolving disagreements between agents
  5. Emergent intelligence - Better outcomes from collective agent reasoning

Proposed Architecture

Council Model

┌─────────────────────────────────────────────────────────┐
│                    Council Session                       │
├─────────────────────────────────────────────────────────┤
│  ┌──────────┐  ┌──────────┐  ┌──────────┐              │
│  │  Koda    │  │   Vor    │  │ Planner  │              │
│  │ (Build)  │  │  (QA)    │  │(Strategy)│   ...more    │
│  └────┬─────┘  └────┬─────┘  └────┬─────┘              │
│       │             │             │                     │
│       └─────────────┼─────────────┘                     │
│                     ▼                                   │
│             ┌───────────────┐                          │
│             │   Mediator    │                          │
│             │  (Consensus)  │                          │
│             └───────────────┘                          │
└─────────────────────────────────────────────────────────┘

Swarm Model

┌─────────────────────────────────────────────────────────┐
│                    Swarm Session                         │
├─────────────────────────────────────────────────────────┤
│  Worker Pool (N agents)                                 │
│  ┌───┐ ┌───┐ ┌───┐ ┌───┐ ┌───┐                         │
│  │ W1│ │ W2│ │ W3│ │ W4│ │ W5│   ...dynamic scaling   │
│  └───┘ └───┘ └───┘ └───┘ └───┘                         │
│       ▲           ▲           ▲                         │
│       └───────────┼───────────┘                         │
│                   ▼                                     │
│         ┌─────────────────┐                            │
│         │  Task Queue     │                            │
│         └─────────────────┘                            │
└───────────────────────────────────────────���─────────────┘

Use Cases

  1. Code Review Council - Koda writes, Vor reviews, they discuss and iterate
  2. Architecture Planning - Multiple agents brainstorm approaches, vote on best
  3. Large Refactor Swarm - Many worker agents each handling files in parallel
  4. Debug Council - Agents with different expertise collaborate on hard bugs

Technical Considerations

  • Session sharing/isolation between council members
  • Message passing protocol between agents
  • Consensus/voting mechanisms
  • Resource/token budget management
  • Deadlock prevention
  • Agent spawn/despawn lifecycle

Acceptance Criteria

  • Define council/swarm protocol specification
  • Implement council session manager
  • Implement inter-agent communication bus
  • Add consensus/voting mechanisms
  • Create at least one example council configuration
  • Add tests for multi-agent coordination
  • Document usage and configuration

Prior Art

  • AutoGen multi-agent conversations
  • CrewAI agent teams
  • LangGraph multi-agent workflows
  • ChatDev collaborative agents

Notes

This originated from an attempt to @planner develop opencode-council-swarm which revealed a loop bug (see #9445). This issue captures the actual feature request for future planning.

Originally created by @mannyluvstacos on GitHub (Jan 19, 2026). Originally assigned to: @thdxr on GitHub. ## Feature Request Implement a "council" or "swarm" architecture for coordinating multiple OpenCode agents working together on complex tasks. ## Motivation Currently, agents (Koda, Vor, Ralph, Planner, Explore, Ideator) operate independently or in simple parent-child relationships. A council/swarm system would enable: 1. **Parallel agent execution** - Multiple agents working on different aspects simultaneously 2. **Consensus mechanisms** - Agents voting or deliberating on decisions 3. **Specialized roles** - Different agents handling their domain expertise 4. **Conflict resolution** - Resolving disagreements between agents 5. **Emergent intelligence** - Better outcomes from collective agent reasoning ## Proposed Architecture ### Council Model ``` ┌─────────────────────────────────────────────────────────┐ │ Council Session │ ├─────────────────────────────────────────────────────────┤ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ │ │ Koda │ │ Vor │ │ Planner │ │ │ │ (Build) │ │ (QA) │ │(Strategy)│ ...more │ │ └────┬─────┘ └────┬─────┘ └────┬─────┘ │ │ │ │ │ │ │ └─────────────┼─────────────┘ │ │ ▼ │ │ ┌───────────────┐ │ │ │ Mediator │ │ │ │ (Consensus) │ │ │ └───────────────┘ │ └─────────────────────────────────────────────────────────┘ ``` ### Swarm Model ``` ┌─────────────────────────────────────────────────────────┐ │ Swarm Session │ ├─────────────────────────────────────────────────────────┤ │ Worker Pool (N agents) │ │ ┌───┐ ┌───┐ ┌───┐ ┌───┐ ┌───┐ │ │ │ W1│ │ W2│ │ W3│ │ W4│ │ W5│ ...dynamic scaling │ │ └───┘ └───┘ └───┘ └───┘ └───┘ │ │ ▲ ▲ ▲ │ │ └───────────┼───────────┘ │ │ ▼ │ │ ┌─────────────────┐ │ │ │ Task Queue │ │ │ └─────────────────┘ │ └───────────────────────────────────────────���─────────────┘ ``` ## Use Cases 1. **Code Review Council** - Koda writes, Vor reviews, they discuss and iterate 2. **Architecture Planning** - Multiple agents brainstorm approaches, vote on best 3. **Large Refactor Swarm** - Many worker agents each handling files in parallel 4. **Debug Council** - Agents with different expertise collaborate on hard bugs ## Technical Considerations - Session sharing/isolation between council members - Message passing protocol between agents - Consensus/voting mechanisms - Resource/token budget management - Deadlock prevention - Agent spawn/despawn lifecycle ## Acceptance Criteria - [ ] Define council/swarm protocol specification - [ ] Implement council session manager - [ ] Implement inter-agent communication bus - [ ] Add consensus/voting mechanisms - [ ] Create at least one example council configuration - [ ] Add tests for multi-agent coordination - [ ] Document usage and configuration ## Prior Art - AutoGen multi-agent conversations - CrewAI agent teams - LangGraph multi-agent workflows - ChatDev collaborative agents ## Notes This originated from an attempt to `@planner develop opencode-council-swarm` which revealed a loop bug (see #9445). This issue captures the actual feature request for future planning.
yindo closed this issue 2026-02-16 18:05:22 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 19, 2026):

This issue might be a duplicate or related to existing issues. Please check:

  • #9280: [FEATURE]: Allow subagents to spawn subagents - Discusses agent composition and nested agent calls, which is foundational to multi-agent coordination
  • #9445: Planner agent gets stuck in infinite loop when planning undefined projects - Related to agent autonomy and coordination challenges
  • #9389: [BUG] it gets stuck in Plan mode - Documents issues with agent state management and handover between agents
  • #9296: Experimental plan mode handover -> build uses plan agent's model - Documents issues with agent transitions and model propagation

Feel free to ignore if your use case for council/swarm architecture differs from these foundational agent coordination issues.

@github-actions[bot] commented on GitHub (Jan 19, 2026): This issue might be a duplicate or related to existing issues. Please check: - #9280: [FEATURE]: Allow subagents to spawn subagents - Discusses agent composition and nested agent calls, which is foundational to multi-agent coordination - #9445: Planner agent gets stuck in infinite loop when planning undefined projects - Related to agent autonomy and coordination challenges - #9389: [BUG] it gets stuck in Plan mode - Documents issues with agent state management and handover between agents - #9296: Experimental plan mode handover -> build uses plan agent's model - Documents issues with agent transitions and model propagation Feel free to ignore if your use case for council/swarm architecture differs from these foundational agent coordination issues.
Author
Owner

@mannyluvstacos commented on GitHub (Jan 19, 2026):

Also please ignore, this is my own forked worked that was accidentally pushed up

@thdxr when you have a moment, would you kindly delete this?
I am still bikeshedding.

@mannyluvstacos commented on GitHub (Jan 19, 2026): Also please ignore, this is my own forked worked that was accidentally pushed up @thdxr when you have a moment, would you kindly delete this? I am still bikeshedding.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#6822