Skip to content

degiorgig/debateloop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

debateloop

debateloop is a terminal CLI for running structured model-vs-model debates on top of your local OpenCode setup.

By default, each stage uses a 60000ms timeout.

It runs a fixed debate loop:

  1. Debater A opening answer
  2. Debater B opening answer
  3. Debater A critique of B
  4. Debater B critique of A
  5. Debater A revised answer
  6. Debater B revised answer
  7. Judge verdict

The result is a winner-first summary plus a saved transcript you can inspect later.

Requirements

  • Node.js >=20.12.0
  • OpenCode installed and working locally
  • At least three available models in OpenCode:
    • one for Debater A
    • one for Debater B
    • one for the Judge

Install

From npm

npm install -g debateloop

From a local checkout

npm install
npm run build
npm link

Usage

Start a debate:

debateloop ask "Why is TypeScript better than JavaScript?"

Override the models for one run:

debateloop ask "Which is better: microservices or a monolith?" \
  --debater-a github-copilot/claude-sonnet-4.6 \
  --debater-b github-copilot/gpt-5.4 \
  --judge github-copilot/claude-haiku-4.5

Show every model output as each stage completes:

debateloop ask "When does clean code make a codebase worse?" --debug

Override the stage timeout for one run:

debateloop ask "Should we rewrite this service?" --stage-timeout-ms 90000

Inspect a saved transcript:

debateloop inspect <run-id>

First Run

On the first run, debateloop asks you to choose:

  • Debater A model
  • Debater B model
  • Judge model

It saves this config under:

~/.config/debateloop/config.json

Saved transcripts live under:

~/.config/debateloop/runs/

The saved config also contains reliability settings, including the default stage timeout. A CLI override such as --stage-timeout-ms 90000 applies only to the current run and does not rewrite your saved config.

If you already had an older config file, it keeps your previously saved timeout instead of silently switching to a new default. To make the saved timeout permanent, edit:

~/.config/debateloop/config.json

and update:

{
  "reliability": {
    "stageTimeoutMs": 60000
  }
}

If you want to reset the local configuration completely and re-run guided setup on the next command:

rm ~/.config/debateloop/config.json

How It Behaves

  • opening answers are generated independently before critique begins
  • retries are applied conservatively for transient stage failures
  • judge output is validated as structured JSON
  • partial transcripts are preserved when a run fails
  • inspect shows prompts, outputs, attempts, durations, and stage errors

Development

Install dependencies:

npm install

Run the CLI in dev mode:

npm run dev -- ask "Should tests come first?"

Run tests:

npm test

Build:

npm run build

Notes

  • debateloop depends on your local OpenCode configuration and available providers/models
  • different judge models may produce longer or more verbose verdicts; transcripts preserve the raw output for inspection
  • this project is optimized for structured comparison and tradeoff analysis, not open-ended agentic planning

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors