Releases: Lexus2016/Agent-Debate-Consensus
v2.4.2 — Performance & UX fixes
What's Changed
Performance: eliminate browser slowdown on large chats
The main chat list was re-rendering every message bubble on every streaming token (~50/sec × N messages). Fixed with:
React.memoonMessageBubble— only the actively-streaming bubble re-renders; all completed messages are skipped. Possible becauseupdateMessagepreserves object identity for unchanged messages.- Lifted store subscriptions —
activeModels,availableModels,fontSize,moderatorIdmoved from each bubble toMessageList(4×N Zustand subscribers → 4 total). - Memoized
ReactMarkdowncomponents —useMemo((): Components => ...)keyed onuniqueModelsgives ReactMarkdown a stable reference across all streaming tokens. useMemofor model lookups —allModels,uniqueModels,modelcomputed once per models change, not per token.content-visibility: autoon message wrappers — browser skips layout/paint for off-screen messages.
Bug fix: chat input vertical alignment
Text in the chat input was top-aligned relative to the action buttons. Fixed by changing the flex container from items-end to items-center.
Full Changelog
v2.4.1 — Token Cost Optimization
Token Cost Optimization
Reduces API token consumption by ~15-20% per debate round without any quality degradation.
Changes
- Prompt caching support: Extracted non-moderator debate rules into a stable prefix constant (
PARTICIPANT_RULES_PREFIX) placed at the start of system prompts. All non-moderator models now share an identical ~270-token prefix, enabling provider-side prompt caching (Anthropic, OpenAI, Google) - Fixed caching blocker: Previous prompts included current time (
02:45 PM EET) which changed every minute, preventing any prompt caching. Now uses date-only format (2026-03-16), stable for 24h - Earlier progressive summarization: Lowered summarization threshold from 20→14 messages and re-summarization trigger from 10→7 new messages. Context is compressed sooner in multi-round debates, reducing input tokens for subsequent rounds
- Condensed prompt formatting: Shortened date format, language rule, and merged stop rules — all without removing any behavioral instructions
What's NOT changed
All debate behavioral instructions preserved intact: thinking style diversity, @mention mechanics, stop rules, quality standards, moderator role structure (OPENING/DISCUSSION/SUMMARY), rebuttal phase addendum.
v2.4.0 — Thinking Styles & Rebuttal Phase
What's New
Cognitive Thinking Styles
Each model is automatically assigned one of 5 thinking styles that shape how it approaches arguments:
- Skeptic — questions assumptions, demands evidence
- Pragmatist — focuses on real-world feasibility and trade-offs
- Visionary — explores unconventional possibilities
- Analyst — breaks down arguments structurally with logic
- Devil's Advocate — deliberately takes opposing positions
Styles are visible as badges on each message bubble.
Structured Rebuttal Phase
A new debate phase between opening arguments and free discussion:
- All models present their opening arguments
- Rebuttal round — each model challenges the weakest points of others' arguments using a structured format (Challenge → Assumption → Position)
- Free discussion continues via @mentions
- Moderator summarizes, acknowledging genuine disagreements
Prompt Overhaul
System prompts rewritten to encourage productive skepticism:
- "Before building on any argument, identify its weakest assumption"
- "Unexplained agreement is not allowed"
- Models must justify agreement, not just echo others
- Moderator acknowledges disagreements honestly rather than forcing false consensus
Technical Details
- New round structure: Opening (80/75) → Rebuttal (65) → Discussion (70) → Summary (50)
- @mention-triggered discussion suppressed during rebuttal phase to keep it structured
- Thinking styles assigned from unused pool when models are activated, ensuring diversity
- Rebuttal responses count toward discussion budget (1 of 5 per-model, 1 of 8 total)
Files Changed
src/types/chat.ts— AddedThinkingStyletypesrc/lib/conversationEngine.ts— Thinking styles, rebuttal phase, prompt rewritessrc/store/chatStore.ts— Auto-assign styles on activation/load/rehydrationsrc/components/ChatContainer.tsx— Rebuttal orchestration and prompt injectionsrc/components/MessageBubble.tsx— Thinking style badge displaysrc/lib/models.ts— Updated model definitionssrc/components/ModelDiscoveryModal.tsx— Minor adjustments
Full Changelog: v2.3.0...v2.4.0
v2.3.0 — Token Budget & Progressive Summarization
What's New
Token-Based Context Budgeting
- Replaced message-count-based context window (
slice last 20) with a token-budget system that respects each model's context limit - Automatic message compression for older messages to maximize context utilization
- Conservative token estimation (3.0 chars/token) optimized for mixed Latin/Cyrillic text
Progressive LLM Summarization
- After 20+ messages, the moderator (or a random active model) generates a semantic summary of earlier discussion
- Summary preserves verbatim: numbers, statistics, code snippets, URLs, and key parameters
- Re-triggers every 10 new messages after initial summary
- Summary replaces old messages in API context only — full messages remain visible in UI
API Cost Control
- Added explicit
max_tokensto all API calls (was missing — OpenRouter defaulted to 65536, causing 402 errors) - Server-side validation with hard cap at 8192 tokens per response
- Summarization disabled in public mode without user's own API key
Bug Fixes
- Fixed OpenRouter 402 error: "You requested up to 65536 tokens, but can only afford 58990"
- Fixed potential empty context when newest message exceeds budget
- Added
context_lengthto all default models for accurate budget calculation
Files Changed
src/lib/tokenBudget.ts— new token estimation & budget utilitiessrc/lib/conversationEngine.ts— rewritten context window builder + summarization enginesrc/app/api/chat/route.ts— max_tokens with server-side validationsrc/lib/streamHandler.ts— maxTokens passthroughsrc/components/ChatContainer.tsx— summarization trigger & lifecycle managementsrc/types/chat.ts— ContextSummary typesrc/store/chatStore.ts— contextSummary persistencesrc/lib/models.ts— context_length for default models
v2.2.0 — Onboarding, SEO & Favicons
What's new in v2.2.0
Onboarding
- New how-it-works process cards (2×2 grid) in the empty state: Pick Agents → Pose a Question → Watch the Debate → Steer Consensus
- Service title and description now visible before any agent is activated
- Audience pills: Researchers / Developers / Students / Curious minds
- Fixed content clipping on short screens (
min-h-fulllayout fix)
SEO
- Added
keywords,robots: index/follow,metadataBase og:imageandtwitter:cardwith icon image- All descriptions synced to "2–5 models"
Favicons
favicon.ico(16/32/48px) — now works in Safari and all legacy browsersapple-touch-icon(180×180) — iOS home screen support- PWA manifest with
icon-192.pngandicon-512.pngfor Android / splash screens - Theme color:
#6366f1(indigo)
v2.1.0 — Non-blocking Background Retry
What's New
Non-blocking Background Retry
Previously, when a model hit a rate limit or API error, the entire debate stalled — the system waited up to 50 seconds (5s + 15s + 30s) before other models could continue. This release fixes that.
How it works now:
- When a model fails, its concurrency slot is immediately released
- Other models continue the debate without waiting
- The failed model retries in the background on progressive delays (5s → 15s → 30s)
- When the retry timer fires, the model re-enters the priority queue and tries again
- Status messages in chat show retry progress (
Model: error, retrying 1/3...) - If all 3 retries fail, the model is marked as failed and the debate continues without it
Technical details:
- New engine methods:
releaseSlot(),scheduleRetry(),clearRetry() hasPendingWorkincludes retrying models to prevent premature moderator/summarizer triggers- All cleanup paths (stop, new round, round complete) properly clear retry timers
- Guard against double-queuing of retrying models in both
analyzeForResponseandqueueResponse
Full Changelog: v2.0.0...v2.1.0
v2.0.0 — 3-Phase Debate Engine, @ALL Trigger, Free Models
What's New
3-Phase Debate Engine
Complete rewrite of the conversation engine with structured phases:
- Opening — All models share independent perspectives. Moderator speaks last (priority 75 vs 80).
- Discussion — @mention-driven exchanges bounded by per-model (5) and total (8) caps. No more infinite loops.
- Summary — Moderator provides final synthesis with justified conclusions when discussion settles. Up to 3 moderation cycles.
Moderator as Full Participant
The AI moderator is no longer just a summarizer — it actively participates:
- Shares its own opinion in the opening phase
- Evaluates and challenges other participants' arguments
- Uses @mentions and @ALL to direct discussion
- Provides final summary with conclusions
@ALL Trigger
New @ALL mention addresses all participants at once. Any model that has already spoken will respond. Works for both users and AI participants. Highlighted in the UI.
Free Default Models
Default lineup is now 100% free — works without any API key:
- Nemotron 3 Super 120B (NVIDIA)
- Llama 3.3 70B (Meta)
- Mistral Small 3.1 (Mistral AI)
- Gemma 3 27B (Google)
Automatic Retry Logic
When a model returns an error, the system retries automatically:
- 3 retries with progressive delays (5s, 15s, 30s)
- Status messages in chat for each retry attempt
- Automatic moderator reassignment on permanent failure
Proactive API Key Button
Even in public mode with free models, users can add their OpenRouter API key at any time via the sidebar — unlocking paid models, web search, and bypassing rate limits.
NPX Quick Start
npx degit Lexus2016/Agent-Debate-Consensus my-debate
cd my-debate
npm install
npm run devUI/UX Improvements
- Onboarding empty state — Animated arrow + pulsing dots guide new users to activate agents
- "Click to activate" hint — Visible in sidebar when no agents are active
- Export header — Markdown exports now include participant list and moderator info
- File attachments — Attach text files (code, CSV, JSON, up to 100KB) to messages
- Collapsible debate history — Session list in sidebar with one-click restore
Bug Fixes
- Fixed moderator re-trigger loop (moderator no longer speaks 3 times from its own completion)
- Fixed
startNewRoundnot clearing pending state from previous round - Fixed empty responses not triggering moderator/summarizer
- Separate settle counter for moderator — discussion @mentions no longer consume summary budget
- Removed dead typing indicator code
Full Changelog: 355f438...v2.0.0
v1.0.0 — Multi-Agent Debate Platform
Agent Debate Consensus v1.0.0
A multi-agent debate platform where multiple LLMs engage in structured debates on any topic while you moderate.
Features
Core Debate Engine
- Multiple AI models debate simultaneously with priority-based response queue
- Configurable moderator role (auto-assigned or user-controlled)
- Round-based debate flow with automatic moderator summaries
- 10s cooldown between responses (bypassed by @mentions)
- User can send messages at any time during active debate
Model Management
- 4 default models: Kimi K2, Gemini 3 Pro, Claude Haiku 4.5, Grok 4.1 Fast
- Model Discovery modal — browse and add any model from OpenRouter catalog
- Configurable max active models via
MAX_ACTIVE_MODELSenv var - Per-model failure tracking with automatic recovery
Chat Interface
- @mention autocomplete with model color highlighting
- File attachments — text/code files up to 100KB
- Web search toggle (OpenRouter
:onlinesuffix) - Collapsible debate history with session management
- Temperature presets: Creative / Balanced / Precise
- Adjustable font size
- Copy individual messages as Markdown
- Export full debate as
.mdfile - Dark / Light theme toggle
- Responsive design with collapsible sidebar
Streaming & Performance
- Server-Sent Events (SSE) streaming via OpenAI SDK
- Per-model AbortController for individual stream cancellation
- Simulated reading delay for natural conversation flow
- Context window management (last N messages per model)
- Extended thinking / reasoning support with collapsible display
Deployment
- Supports both private (self-hosted) and public modes
- Public mode: users provide their own OpenRouter API key
- Welcome/onboarding screen for API key entry
- Zustand state persisted to localStorage
Tech Stack
- Next.js 16 (App Router)
- TypeScript
- Tailwind CSS v4
- Zustand (state management)
- OpenRouter API via OpenAI SDK
Getting Started
git clone https://github.com/Lexus2016/Agent-Debate-Consensus.git
cd Agent-Debate-Consensus
npm install
cp .env.example .env # Add your OPENROUTER_API_KEY
npm run dev