@rrr2010/opencode-roundtable
v0.3.9
Published
Multi-agent round-robin debate plugin for OpenCode
Maintainers
Readme
opencode-roundtable
OpenCode plugin that orchestrates multi-agent round-robin debates. Agents with different personalities debate a topic turn by turn, sharing context while keeping their own system prompts and tools.
A built-in observer automatically consolidates every debate into an executive summary.
Installation
npm (recommended)
{
"plugin": ["@rrr2010/opencode-roundtable@latest"]
}OpenCode auto-installs npm plugins on startup. No manual copy needed.
Local (dev)
git clone https://github.com/RrR2010/opencode-roundtable
cd roundtable
bun run build
npm linkThen add "@rrr2010/opencode-roundtable" to your opencode.json plugin array.
Features
- Round-robin debate — agents speak in sequence, each seeing the full discussion history
- Shared context — tool outputs and discoveries are visible to all participants
- Built-in observer — automatically consolidates the debate into an executive summary (overridable with a specific agent)
- Isolated session — the debate runs in a child session (like `task` tool), keeping the main session clean
- File persistence — state stored on disk, survives restarts
- Extend mode — continue a concluded roundtable with more rounds or a new topic
- Agent discovery —
available_agentstool helps the orchestrator know which agents exist - Active roundtables —
active_roundtablestool lists current debates with status - TUI command —
/roundtablesslash command lists sessions with clickable navigation - Auto-navigate — optional auto-navigation between sessions on create/conclude
- Parallel roundtables — multiple independent debates can run simultaneously
- Loop detection — Jaccard bigram similarity detects agent impasses early
Tool API
roundtable()
roundtable({
agents?: string[], // Names in speaking order (min 2). Required for new debates.
prompt: string, // Topic or challenge. For multi-round, include per-round instructions.
rounds?: number, // Complete rounds (default: 1, max: 50)
observer?: string, // Agent for final consolidation (default: built-in)
sessionID?: string, // ses_xxxx — pass to extend a concluded debate
title?: string, // Custom title (default: auto-generated from prompt)
observerPrompt?: string, // Override the observer consolidation prompt (e.g., "Save a detailed report to report.md")
})Returns: { sessionID: string, summary: string } after the debate concludes.
Side effect: injects system-level prompts into each agent's context during the debate (role-setting, topic, turn routing, and lifecycle signals).
available_agents()
available_agents()Returns: "Available agents: planner, developer, reviewer, ..." — a formatted string of agent names.
active_roundtables()
active_roundtables()Returns: session IDs for agents to use programmatically (NOT clickable links). Only the /roundtables TUI command has clickable session navigation. Example:
Active roundtables:
- #ses_xxx · planner→developer→reviewer (R1/2) · debating
- #ses_yyy · planner→developer (R2/2) · consolidatingUsage Examples
Basic — one round, built-in observer
roundtable({
agents: ["planner", "developer"],
prompt: "What architecture should we use?",
})Multi-round with per-round instructions
roundtable({
agents: ["planner", "developer"],
prompt: "Round 1: list pros. Round 2: list cons. Round 3: propose an implementation plan.",
rounds: 3,
})Explicit observer
roundtable({
agents: ["planner", "developer"],
prompt: "Should we migrate to microservices?",
rounds: 2,
observer: "reviewer",
})Extend a concluded debate (preferred)
roundtable({
sessionID: "ses_abc123",
rounds: 2,
prompt: "Dive deeper into operational costs",
})Prefer extend over starting a new roundtable — it reuses accumulated context, saving exploration tokens. The session ID is shown in the S1 noReply message when the roundtable starts — check S1 context to find it.
Explicit per-agent per-round instructions
When you need each agent to focus on a specific aspect, reference them by name in the prompt:
roundtable({
agents: ["planner", "developer", "reviewer"],
rounds: 2,
prompt: "Round 1 - planner: propose architecture. Round 2 - developer: implement plan. Round 2 - reviewer: review code.",
})Discover agents first
const agents = available_agents()
// agents => "Available agents: planner, developer, reviewer, builder, architect"
roundtable({
agents: ["planner", "developer"],
prompt: "...",
})List active roundtables
const active = active_roundtables()
// active => "Active roundtables:\n- #ses_xxx · planner→developer (R1/2) · debating"Configuration
Place ~/.config/opencode/roundtable.json to override defaults:
{
"$schema": "https://raw.githubusercontent.com/RrR2010/opencode-roundtable/refs/heads/master/docs/roundtable.schema.json",
"defaultTimeoutMs": 300000,
"loopSimilarityThreshold": 0.85,
"toolOutputPreviewMax": 500,
"maxRounds": 10,
"defaultObserverPrompt": "You are an impartial roundtable observer...",
"navigation": "link"
}The JSON schema is available at docs/roundtable.schema.json.
If the file doesn't exist, it's created automatically with defaults.
Navigation modes
| Value | Behavior |
|-------|----------|
| "link" (default) | No auto-navigation. Relies on native #ses_xxx link rendering |
| "auto" | Auto-navigates S1→S2 on create, S2→S1 on conclude |
| "none" | No automatic navigation |
TUI Features
The plugin registers a /roundtables slash command that opens a dialog
listing all active roundtables with clickable session navigation.
Tips
Multi-round strategy
For complex topics, structure rounds progressively:
- Round 1: Explore — each agent lists their perspective
- Round 2: Challenge — agents critique each other's positions
- Round 3+: Converge — propose concrete solutions
Include all round instructions in the prompt parameter — all agents see the full agenda.
Nested roundtables
Recursive roundtables (an agent inside S2 calling roundtable() again) are prevented by a runtime guard. The plugin detects if the current session is already a roundtable and rejects the call with an error message. This ensures debates stay linear and predictable.
Extend mode
- Use the session ID from the S1 noReply message when the roundtable starts
- Original topic is preserved; new prompt becomes the continuation
- Agents must be the same as the original debate (validated)
- Continue an extend for iterative refinement
Documentation
- docs/SPEC.md — Full technical specification
Requirements
- OpenCode (latest version)
- No external dependencies
License
MIT
