roundtable

GitHub 作者 LeoYeAI/openclaw-master-skills

Adaptive multi-model AI roundtable. Runs up to 4 AI models (configurable) in 2 debate rounds with cross-critique and formal consensus scoring. Requires a configured Anthropic provider (Claude Opus recommended). Optionally adds GPT-5.3 Codex (OpenAI), Grok 4, and Gemini 3.1 Pro via Blockrun proxy. Works with Claude-only fallback if optional providers are unavailable. Writes results to local filesystem. Debate panel agents are persistent thread sessions; meta-panel and synthesis agents are one-shot.

安装 / 下载方式

TotalClaw CLI推荐
totalclaw install github:LeoYeAI~openclaw-master-skills~roundtable-adaptive
cURL直接下载,无需登录
curl -fsSL https://skills.taituai.com/api/skills/github%3ALeoYeAI~openclaw-master-skills~roundtable-adaptive/file -o roundtable-adaptive.md
# Roundtable v2 — Adaptive Multi-Model Orchestrator

**Trigger:** `roundtable [--mode] [prompt]` from any channel your agent monitors.
**Output:** Posted to your configured output channel (set `ROUNDTABLE_OUTPUT_CHANNEL` in your OpenClaw config, or results are posted back to the triggering channel).
**Panel agents:** Persistent sessions (`mode="session"`, `thread=true`) — stay alive in the Discord thread for follow-up questions. Meta-panel analysts and synthesis agent are one-shot (`mode="run"`).

**The orchestrator = COORDINATOR ONLY.** Uses your default model unless overridden in `panels.json`. Never argues a position, never joins the panel.

Core principle: the Meta-Panel (4 premium models) designs the optimal WORKFLOW for the task — parallel debate, sequential pipeline, or hybrid — then the right agents execute it.

## Configuration

Before using, set your output channel in `panels.json` (or the triggering channel is used):
```json
{
  "output": {
    "channel": "discord",
    "target": "YOUR_CHANNEL_ID_HERE"
  }
}
```

If using Discord threads (optional — creates one thread per roundtable for clean organization):
```json
{
  "output": {
    "channel": "discord",
    "target": "YOUR_CHANNEL_ID_HERE",
    "useThreads": true
  }
}
```
Without this config, results are posted directly to the channel where the command was issued.

## Cost transparency

| Component | Cost per full run |
|-----------|-----------------|
| Claude Opus (OAuth) | Free |
| GPT-5.3 Codex (OAuth) | Free |
| Gemini 3.1 Pro (Blockrun) | ~$0.05 |
| Grok 4 (Blockrun) | ~$0.08 |
| **Total (full panel)** | **~$0.13–$0.50** |
| **Degraded mode (Claude only)** | **Free** |

`--quick` flag halves cost (1 round only).

---

## Setup

**Minimum (degraded mode — free):**
1. Configure `anthropic` provider in `openclaw.json` (OAuth or API key)
2. Optionally add `openai-codex` for GPT-5.3 Codex
3. Done — Grok/Gemini slots fall back to Claude Sonnet

**Full panel (adds Grok 4 + Gemini 3.1 Pro via Blockrun):**
1. Install Blockrun: `openclaw plugins install @blockrun/clawrouter` then `openclaw gateway restart`
2. Fund the Blockrun wallet with USDC on Base (~$5-10). Address shown during install.
3. Full panel costs ~$0.13–$0.50/run; Claude and GPT slots remain free via OAuth.

Results are saved to `{workspace}/memory/roundtables/YYYY-MM-DD-slug.json` (created automatically).

---

## Trigger Patterns

### Optional: auto-trigger a dedicated channel
You can configure a Discord channel as a roundtable-only channel in your `AGENTS.md`:
```
Any message in channel [YOUR_CHANNEL_ID] → treat as a roundtable topic automatically.
No prefix needed. Message → auto-detect mode → create thread → spawn orchestrator.
```
This is entirely optional — the explicit `roundtable` command works from any channel.

### Explicit trigger (any channel)

### Explicit trigger (any channel)
- `roundtable [prompt]` — auto-detect mode, full flow
- `roundtable --debate [prompt]` — force parallel debate mode
- `roundtable --build [prompt]` — force build/coding mode
- `roundtable --redteam [prompt]` — force adversarial mode
- `roundtable --vote [prompt]` — force decision mode
- `roundtable --quick [prompt]` — skip meta-panel, use default panel for mode, 1 round only
- `roundtable --panel model1,model2,model3 [prompt]` — manual panel override, skip meta-panel
- `roundtable --validate [prompt]` — add Round 3 agent validation of synthesis
- `roundtable --no-search [prompt]` — skip web search (use only for purely theoretical/abstract topics)

---

## Step -1: Create a Thread (FIRST ACTION)

Before anything else, create a thread in your configured channel and save the thread ID.

### -1a) Dedup check (REQUIRED)

Avoid double-spawn if the same topic is triggered twice.

1. Normalize topic string:
   - lowercase
   - trim
   - collapse multiple spaces
   - remove trailing punctuation
2. List recent threads in the target channel:
```
message(action='thread-list', channel='discord', channelId='[CHANNEL_ID]', limit=25)
```
3. If an existing active thread title matches normalized topic (+ same mode tag like `[[DEBATE]]`) created in last 24h:
   - **reuse that thread** (`THREAD_ID = existing_thread_id`)
   - post: `♻️ Duplicate topic detected — reusing existing thread.`
   - **do NOT spawn a new orchestrator/panel**
4. If no match: create a new thread.

### -1b) Create thread (if no dedup hit)

```
message(
  action = 'thread-create',
  channel = '[your configured channel]',
  channelId = '[CHANNEL_ID from user config]',
  threadName = '🎯 [topic — max 8 words] [[MODE]]',
  message = '**Panel:** [model list]\n**Mode:** [mode] | **Rounds:** [N]\n⏳ Analysis in progress...'
)
```

Save the returned thread ID as `THREAD_ID`.

**All subsequent message() calls use `target = THREAD_ID`, NOT the channel ID.**

If thread creation fails or channel is not configured: fall back to posting directly in the active channel.

---

## Step 0: Web Search Grounding (always first)

Run a web search on the topic **before anything else** — meta-panel and all agents will have current context.

```
web_search(query = prompt, count = 5)
```

**Timeout policy:** If web_search returns no result or errors within ~10s, do NOT block — continue immediately with `CURRENT_CONTEXT = "No real-time data available (search failed or timed out)."`. The roundtable proceeds on model knowledge only.

**Caching:** If re-running the same topic within the same session, reuse the prior `CURRENT_CONTEXT` block — do not re-search.

Summarize results into a `CURRENT_CONTEXT` block (max 250 words):
- Key facts, recent developments, relevant data points
- Date of search
- If no useful results found: note "No relevant real-time data found" and continue

This block is injected into:
1. The meta-panel prompt (so they design the workflow with current context)
2. Every Round 1 agent prompt (so all panelists argue from the same updated baseline)

---

## Step 0b: Meta-Panel — Workflow Design

**Skip if**: `--panel` flag used, OR `--quick` flag used.

### Spawn 4 premium meta-analysts in parallel

Read `panels.json` → `meta.models`. For each:
```
sessions_spawn(
  task = filled prompts/meta-panel.md,
  model = model_id,
  mode = "run",
  label = "rt-meta-[A/B/C/D]",
  runTimeoutSeconds = 90
)
```

### 0b. Synthesize workflow from 4 recommendations

After collecting all meta responses, the orchestrator synthesizes the final workflow:

1. **Workflow type**: majority vote among 4 recommendations
   - Tie → prefer `hybrid` (more flexible)

2. **Stage composition**: tally model recommendations per stage
   - For each stage position, pick the most-recommended model
   - If a model is not in `agents.defaults.models` allowlist → skip, use next
   - If a model is your orchestrator's model → skip (reserved for the orchestrator, never a panelist)

3. **Rounds**: median of recommendations (round up if tie) — **hard cap at 3 max, always**

4. **Synthesis model**: most-recommended premium model not on the main panel

5. **Log the decision** (include in output header):
   > "Meta-panel designed workflow: [type]. Stages: [N]. Panel: [models]. Synthesis: [model]."

### 0c. Workflow types explained

**parallel_debate** — classic roundtable
- All agents in Stage 1 work independently, same prompt
- Round 2: cross-critique
- Best for: debates, opinions, risk analysis, decision-making

**sequential** — output chains between stages
- Stage 1 agents produce outputs (drafts, code, research)
- Stage 2 agents receive Stage 1 outputs and review/validate/improve
- Best for: coding (write → review), research (collect → synthesize), creative (draft → refine)
- Round 2 within Stage 1 still possible; Stage 2 is a separate pass

**hybrid** — parallel within stages, sequential between
- Stage 1: N agents work in parallel on different aspects
- Stage 2: 1-2 premium agents receive ALL Stage 1 outputs and produce integrated output
- Best for: complex analysis (parallel research → premium synthesis)

### 0d. Panel degradation rule

If a