Adversarial multi-agent pipelines for OpenCode 2.x: a simulated PR log, verdict routing, and a mobile web UI.
  • TypeScript 64.2%
  • Svelte 31.6%
  • JavaScript 2.1%
  • CSS 1.5%
  • HTML 0.6%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Claude 203e8d6eb2
Queued runs: refresh or switch their pipeline, edit title, issue, model
A queued run snapshots its pipeline when it's queued, so later pipeline
edits never reached it, and there was no way to change its pipeline.

- A run's own choices (model, variant, vars, repo) are recorded in
  run.meta.overrides, so its pipeline can be re-read with them re-applied.
  Runs queued before this get them inferred from their snapshot.
- pipelineStatus: current / changed / missing / invalid, on the run, the
  runs list and the sequence detail.
- PATCH /api/runs/:id (queued only): {} refreshes; pipelineId switches;
  title, issue (the opening PR entry is rewritten), model/variant. Checks
  the pipeline is valid and its models exist; notes each change in the log.
- POST /api/sequences/:id/refresh updates every outdated queued run.
- UI: pipeline picker, 'Use the current version' and an edit form on the
  queued run's page; 'pipeline changed' badges on the runs list and the
  sequence board, with Update all. Queued runs show when they were queued.
- Sequence re-runs carry the original run's choices.
- Tests, README.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01S4VkvCcxhnqdRsX5KCbaLR
2026-11-26 04:08:08 +00:00
docs/screenshots Per-item, per-stage instructions for loops 2026-11-24 15:00:34 +00:00
pipelines Per-item, per-stage instructions for loops 2026-11-24 15:00:34 +00:00
scripts Loop stage: big changes one step at a time 2026-11-24 14:32:22 +00:00
src Queued runs: refresh or switch their pipeline, edit title, issue, model 2026-11-26 04:08:08 +00:00
test Queued runs: refresh or switch their pipeline, edit title, issue, model 2026-11-26 04:08:08 +00:00
web Queued runs: refresh or switch their pipeline, edit title, issue, model 2026-11-26 04:08:08 +00:00
.gitignore Core: pipeline schema, comment-preserving YAML, engine, store, mock backend 2026-11-22 01:01:15 +00:00
bun.lock Core: pipeline schema, comment-preserving YAML, engine, store, mock backend 2026-11-22 01:01:15 +00:00
package.json Web UI: live PR log, agents, graph editor; README 2026-11-22 01:23:37 +00:00
README.md Queued runs: refresh or switch their pipeline, edit title, issue, model 2026-11-26 04:08:08 +00:00
tsconfig.json Core: pipeline schema, comment-preserving YAML, engine, store, mock backend 2026-11-22 01:01:15 +00:00

Gauntlet

Structured, adversarial multi-agent workflows for OpenCode 2.x.

Gauntlet treats your prompt like an issue and the work like a pull request. You define a graph of stages: planner, worker and read-only reviewer agents, commands and human gates. Each stage posts to a shared PR log, and its outcome decides where the work goes next:

plan ─▶ dev ─▶ tests ─▶ spec review ─▶ quality review ─▶ docs ─▶ docs review ─▶ human ─▶ done
         ▲        │fail        │fail          │fail          ▲          │fail
         └────────┴────────────┴──────────────┘              └──────────┘
   spec review ──replan──▶ plan          (loops are capped with max_visits)

A run's PR conversation on desktop Approving a gate on a phone

  • Persistent agents. Each agent stage keeps one OpenCode session for the whole run (or a fresh one every visit, per stage), so the developer remembers every round. OpenCode compacts context automatically.
  • Structured verdicts. Agents finish by calling MCP tools (gauntlet_submit, gauntlet_verdict with findings, gauntlet_plan), so outcomes are never scraped from text. An agent that goes idle without calling its tool is nudged, then routed to error.
  • A planner that orchestrates. A planner agent sees the whole pipeline after it: every stage's role, permissions, instructions, routes and loop limits. When re-planning, it also sees what has run so far. It publishes a plan that every later agent works from, plus a brief per stage (for example, what the developer should do first, or what a particular reviewer must verify).
  • A researcher for questions. A read-only research agent investigates the code, its history and the web to answer a question, then posts a sourced answer (with its confidence) to the run's conversation. Use it as a stage before the work, or on its own with the "Research question" pipeline.
  • Agents can ask you. Any agent can pause with gauntlet_ask: its question (with context and suggested answers) is posted to the PR, the run waits, and your answer resumes the same session.
  • Enforced roles. Per-session OpenCode permission rules make reviewers and planners read-only by default (edit, shell and external_directory denied).
  • Contracts as a graph. Route any outcome to any stage; cap loops with max_visits (then route exhausted), plus run-wide max_steps and max_cost_usd.
  • Git-native. Every run gets its own worktree and branch, in a folder next to the repository (D:\code\app → D:\code\app.worktrees\<run>). Worker rounds are committed, so the run branch reads like a PR's commit history.
  • Merges are pipeline runs. Combining branches is a run of a merge pipeline, in the repository itself, so merging gets the same agents, checks and review loops as any other work.
  • Big changes, one step at a time. A loop stage takes the planner's steps (or a fixed list) and runs dev → review on each in turn, with fresh sessions and a fresh review budget per step. A final review of the whole change can send fix steps back into the loop; docs come at the very end.
  • Sequences. Group runs into named phases: a phase's runs wait (no worktree yet) until the previous phase is merged, then branch from the result, so later work never builds on stale code.
  • Web UI for phone and desktop. Watch the PR conversation live; see every agent, its sub-agents, tool calls and streamed text; approve gates, answer permission requests, comment, pause or force an outcome. Build pipelines in a graph editor that reads and writes the same YAML, comments included.

A tour

Everything below comes from the mock backend (node scripts/screenshots.mjs regenerates it), so names and costs are made up.

Runs. Every run with its pipeline, current stage, steps and spend. Runs that need you are counted at the top; queued, finished and merged runs have their own tabs.

The runs list

The PR conversation. The issue, the planner's plan and per-stage briefs, each submission, every verdict with its findings, test output, commits and routing, as one timeline. When an agent asks something, or a gate needs you, a bar under the title jumps straight to it.

An agent pausing to ask a question, with suggested answers A human approval gate at the end of a run

Agents, graph and files. The Agents tab shows each stage's sessions and sub-agents with streamed text, tool calls, model, tokens and spend, and follows whichever agent is active. The Graph tab shows the route the run took (counts on each edge), and Files shows the branch's diff.

The Agents tab The run's path through the pipeline graph The branch diff

Research. The researcher answers a question with sources and a confidence.

A research run's sourced answer

Starting a run. Pick a pipeline, describe the work, and see which model each agent will use and what it costs before you start. Add the run to a sequence, or queue it without starting.

The New run form Searching models with their prices

Pipelines. A graph editor and a YAML editor over the same file (comments survive either). Drag from an outcome dot to a stage to route it; select a stage to edit its prompt, role, permissions and model.

The pipelines list Editing a stage in the graph editor The same pipeline as YAML

Step-by-step loops. The planner splits the work into steps; a developer and a reviewer do them one at a time. The checklist shows where the run is, and which items are fixes a later review sent back. On the graph, the loop counts items done and the stages inside it are marked ↻.

A phased run's checklist of steps, two of them fixes from the final reviewer The phased pipeline's graph during a run Editing a loop stage

Sequences. Phases of runs that merge into the target one phase at a time. Here Foundation is merged, Features is running (one run is waiting on a question) and Polish waits, without a worktree, for Features to land.

The sequences list A sequence board

Merges. A merge is a run of the merge pipeline in your repository. It checks the repository first and asks if it's on the wrong branch or has uncommitted changes; afterwards it shows each branch it verified, and the command that undoes it.

Merge runs Choosing runs to merge A merge asking to stash changes and switch to main A finished merge run

Settings. The default model, the cost cap, and every model OpenCode can run, with prices.

Settings

On your phone

The whole UI works on a phone, which is how it's meant to be used from elsewhere over Tailscale: answering a question, approving a gate, starting or re-running work, editing a stage.

Runs, with what's waiting for you
Runs, with what's waiting for you
An agent's question
An agent's question
Approving a gate
Approving a gate
Agents and their tool calls
Agents and their tool calls
Starting a run
Starting a run
Pipeline stages
Pipeline stages
Editing a stage
Editing a stage
The graph, zoomed to the current stage
The graph, zoomed to the current stage
A sequence's phases
A sequence's phases
A run's steps, one at a time
A run's steps, one at a time
A merge asking first
A merge asking first
Dark mode follows the phone
Dark mode follows the phone

Quick start

Requirements: Bun 1.4 or newer, git, and OpenCode 2.x running on the same machine (the desktop app, the TUI, or opencode serve --service).

git clone https://code.cthulhub.net/7S/Gauntlet.git
cd Gauntlet
bun install
bun run build                       # builds the web UI into web/dist
bun start -- --repo ~/code/my-app   # gauntlet serve

The built UI isn't in git, so run bun run build again after every pull (Gauntlet warns at startup when the build is older than its source). If a browser still has a page from an older build, Gauntlet reloads it once; if the app can't start at all, the page says why instead of staying blank.

Open the printed URL, then go to Settings and pick a default model and a cost cap before your first run. Otherwise every agent runs on OpenCode's own default model, which may be a premium one. Then pick a pipeline, describe the work and start a run.

Gauntlet finds the local OpenCode service via its registration file (the same mechanism @opencode/client uses). To point it elsewhere:

bun start -- --opencode-url http://127.0.0.1:4096 --opencode-password "$PW"
bun start -- --ensure-opencode     # start the OpenCode service if it isn't running

To try the UI without spending tokens, use the scripted mock backend. Its workers edit files and submit; its reviewers fail their first look:

bun start -- --backend mock --repo /tmp/some-git-repo

Reaching it from your phone (Tailscale only)

Gauntlet answers only on localhost and Tailscale addresses (100.64.0.0/10, fd7a:115c:a1e0::/48); every other client gets 403. By default it binds to 127.0.0.1 plus this machine's Tailscale IP, so http://<machine>.<tailnet>.ts.net:7317 works from any device on your tailnet. Alternatives:

  • tailscale serve --bg 7317 gives you HTTPS at https://<machine>.<tailnet>.ts.net while Gauntlet stays on localhost (--host localhost).
  • --token <secret> (or GAUNTLET_TOKEN) adds a shared secret on top. The UI asks for it once per browser (or open it with ?token=<secret>) and a cookie remembers it. Only the API needs the token: the app shell itself holds no data, so it loads first and then asks.
  • --allow <cidr> admits another network if you really need one.

Mutating API calls must be application/json, so a cross-site form can't trigger them. The MCP endpoint answers only on loopback.

Add to Home Screen. In Safari (Share → Add to Home Screen) or Chrome (⋮ → Add to Home screen / Install app), Gauntlet opens full screen like an app. On iOS a home-screen app has its own cookies, so if you use a token it asks for it once more there.

On mobile data. The first load is about 150 KB (gzipped); the editor and graph code load only when you open them. Built files are cached for good, and the page itself is never cached, so a phone always picks up a new build.

Models and cost

Gauntlet reads the model list from your OpenCode server, with prices, context sizes and variants. You never type a model id: every model field in the UI is a searchable picker, and searching flash 1017 finds a model whose name or id contains both words, however it's spelled. The CLI can do the same:

gauntlet models flash 1017     # prints matching provider/model ids with prices and context size

An agent stage uses the first of these that is set:

  1. the stage's own model (and variant)
  2. the model chosen for this run on the New run form
  3. the pipeline's opencode.model
  4. Gauntlet's default model (Settings)
  5. OpenCode's own default

The New run form lists which model each agent will use, and what it costs, before you start. A run won't start if a model or variant isn't in OpenCode; the error suggests close matches.

Cost cap. limits.max_cost_usd in a pipeline, or the default cap in Settings, stops a run as soon as reported spend reaches it, even in the middle of an agent's turn. Each session's model and spend are shown in the Agents tab.

Deferred runs

Tick Don't start yet on the New run form and the run is only queued: no worktree, no branch, no agents. Press Start on its page when you're ready; the worktree is created then, from the base branch as it is at that moment. Queued runs have their own tab on the Runs page.

Until it starts, a queued run is just a title, an issue and a pipeline, so all of that can still change. On its page:

  • Pipeline: pick another one to switch to it.
  • Use the current version: a run keeps a copy of its pipeline from when it was queued. If you edit the pipeline afterwards, the run page, the Runs list and the sequence board say pipeline changed, and this button updates the run to the current version. The run's own model and variables are kept.
  • Edit title, issue, model: the issue at the top of its conversation changes too.

A sequence board with outdated queued runs offers Update all. Every change is noted in the run's conversation. (PATCH /api/runs/:id with pipelineId, title, issue, model, variant; {} just refreshes.)

Merging parallel runs

Runs work in parallel, each in its own worktree and branch. The Merges page combines them. A merge is a run of a merge pipeline, and it works in the repository itself (not a worktree), on the target branch.

  1. Pick the runs (or any branches), the target branch (e.g. main), the order, the merge pipeline (merge by default), the model, and whether to push afterwards.
  2. Before any agent starts, Gauntlet checks the repository. If it's on another branch or has uncommitted changes, the merge asks you what to do: switch to the target (or stash the changes and switch, suggested when there are changes), I fixed it, check again, or cancel.
  3. It notes the target's commit before anything changes, with the git reset --hard <sha> that undoes the merge (also on the run page).
  4. The pipeline runs. The bundled merge pipeline has a merger agent (given each branch and what its run was for: issue, plan, submissions), a git diff --check stage that sends it back on conflict markers or whitespace errors, and a reviewer that can send it back up to three times. Edit it like any pipeline, or point merges at your own.
  5. When the pipeline succeeds, Gauntlet verifies that every branch is an ancestor of the target. If one isn't, the run fails ("merge incomplete").
  6. With push upstream, the target is pushed to its remote. If the remote rejects it (a protected branch, say), Gauntlet pushes a new branch gauntlet/merged-<target>-<id> instead, ready for a pull request.

Every run page has a Merge button that starts a merge with that run selected. Once a merge succeeds, its runs move from Finished to the Merged tab on the runs page, and their pages link to the merge run. Merges made with the earlier integration-worktree system stay viewable under Earlier merges.

Sequences

A sequence stages work. It has a target branch, a merge pipeline and named phases, e.g. Foundation → Features → Polish. Add runs to any phase from the sequence board or the New run form; they're queued, with no worktree.

  • Start begins the first phase: its runs start, branching from the target.
  • When every run in the phase has finished, Gauntlet starts a merge run of that phase's branches into the target (same checks as above, push included if the sequence has it on).
  • When that merge succeeds the next phase starts on its own. Its runs get their worktrees only now, from the freshly merged target.
  • A failed run blocks the phase: Re-run it (a fresh run with the same issue) or Skip it. A failed merge blocks it too: Retry merge, or merge it yourself and press I merged it myself.
  • Runs added to a phase that's already running start right away; queued runs can be moved between phases that haven't started. Pause stops the next phase from starting; Cancel cancels every unfinished run.

Step-by-step loops

A big change in one go overwhelms an agent: the context fills up, the review has too much to look at, and one bad part sends everything back. A loop stage splits it up. It runs the stages its next route leads to (its body, e.g. dev → review) once per item, one item at a time:

stages:
  plan:
    type: agent
    role: planner                # its steps become the loop's items
    prompt: Plan the change as small, self-contained steps.
    max_plan_steps: 8            # optional
    briefs_for: [dev, step_review] # optional: the only stages it writes instructions for
    on: { planned: steps }

  steps:
    type: loop
    items: plan                  # or a fixed list: [Add the model, Add the API, Add the UI]
    item_briefs: plan            # each step's instructions per stage: plan | agent | none
    briefs_for: [dev]            # optional: which of its stages get them (default: all its agents)
    sessions: per_item           # dev and reviewer start fresh on every item (or: shared)
    max_items: 30                # fix items included
    prompt: Keep the change to this step.   # plan/none: a note shown with every item
    on: { next: dev, done: final_review }

  dev:
    type: agent
    prompt: Implement the current step, with tests.
    on: { submitted: step_review }

  step_review:
    type: agent
    role: reviewer
    prompt: Review the current step's change.
    max_visits: 4                # per item: every item gets a fresh budget
    on: { pass: steps, fail: dev, exhausted: human }

  final_review:
    type: agent
    role: reviewer
    prompt: Review the whole change. If you fail it, give `todos`.
    on: { pass: docs, fail: steps }   # sent back: its todos become fix items
  • Each item. Entering the loop starts the next item (next). When the body routes back to the loop, that item is done. After the last one, done routes on. Agents inside the loop see the current item, what's done and what's still to come, and are told to work on (or review) that item only. ${item}, ${item_n} and ${items_total} work in prompts and commands.
  • Instructions per item, per stage. Besides the item itself, each stage in the loop can get its own instructions for that item, so the developer of step 3 is told what step 3 needs and the reviewer what to check for it. item_briefs says where they come from:
    • plan (default): the planner writes them. Its steps can be { step, briefs: { dev: "...", step_review: "..." } }, and it's told which stages it may brief. Nothing extra runs.
    • agent: a read-only briefing agent belonging to the loop runs before each item and writes them (with gauntlet_brief). The loop's prompt is then its instructions, which it turns into each item's instructions; the stages don't see that text. It keeps one session for the whole loop and is given the plan, so it researches once rather than per item. Pick its model on the loop. Items the planner already briefed skip it.
    • none: just the item. Limit who gets instructions with briefs_for: on the loop (which of its stages), and on the planner (which stages it writes for at all, whole-run briefs included). max_plan_steps caps the plan's length.
  • Fresh per item. With sessions: per_item (the default), the body's agents start a new session for every item, so context doesn't pile up. The body's max_visits budgets start over for every item too.
  • Where items come from. items: plan takes the latest plan's steps, and a re-plan replaces the items not done yet. With no plan, the whole issue is one item. Or give a fixed list.
  • Fix items. When a stage outside the loop sends work back into it, its feedback becomes items done before anything still pending:
    • a reviewer's todos (Gauntlet tells reviewers they can give them);
    • otherwise the reviewer's findings, as one item;
    • a failed command's output ("Make Test suite pass: …");
    • a human's comment when rejecting at a gate.
  • Stuck on an item. Escalation routes (exhausted, error) lead out of the loop. If an item's reviewer gives up and a human sends the work back, the loop resumes that item instead of counting it done.
  • The planner knows. Its instructions say its steps are the loop's items, so it writes them as self-contained, reviewable increments in build order.

The bundled Phased feature pipeline does all of this: plan → step by step (dev + step review) → test suite → final review (fixes loop back) → docs → docs review → human approval.

Sequences and loops differ in scope. A sequence coordinates separate runs, each with its own branch, merging phase by phase. A loop works through steps inside one run, on one branch.

Pipelines

Pipelines are listed under Pipelines. Duplicate (on the list, or in the editor, where it includes any unsaved changes) saves a copy under a new file name. The editor's YAML tab has Copy YAML and Paste YAML; pasting replaces the whole pipeline, and undo brings it back. On a plain-HTTP Tailscale address the browser won't let pages read the clipboard, so Paste opens a box to paste into instead.

Pipelines are YAML files in <data>/pipelines. The default data directory is ~/.local/share/gauntlet, or %LOCALAPPDATA%\gauntlet on Windows. Two examples are copied there on first start. Edit them in the UI's graph editor, in its YAML editor, or in your own editor.

name: Quick review
start: dev                      # optional; defaults to the first stage

workspace:
  worktree: true                # each run gets its own worktree + branch
  base: HEAD
  branch_prefix: gauntlet/
  worktrees_dir: ../app.worktrees # default: "<repo>.worktrees" next to the repo
  auto_commit: true             # commit after each worker submission

opencode:
  model: provider/model-id   # default for this pipeline's agents; copy an id from `gauntlet models` or pick it in the editor
  agent: build

defaults: { context: persistent }      # or fresh
limits: { max_steps: 60, max_cost_usd: 20 }
vars: { spec: SPEC.md }                # ${spec} in prompts and commands

stages:
  plan:
    type: agent
    role: planner                # finishes with gauntlet_plan; read-only by default
    prompt: Plan the change and brief each agent on what to do or check.
    on: { planned: dev }

  dev:
    type: agent
    role: worker                 # finishes with gauntlet_submit
    prompt: Implement the issue, with tests.
    ask_human: true              # may pause with gauntlet_ask (default true)
    max_questions: 3             # per round (default 5)
    on: { submitted: review }

  review:
    type: agent
    role: reviewer               # finishes with gauntlet_verdict
    permissions: read_only       # role default; full | read_only | no_shell | no_edit | [rules]
    context: fresh               # don't anchor on earlier approvals
    verdicts: [pass, fail, replan] # any names; each is a routable outcome
    prompt: Adversarially review against ${spec}.
    max_visits: 4
    on: { pass: tests, fail: dev, replan: plan, exhausted: stuck }

  tests:
    type: command
    run: bun test                # string = shell; list = argv
    timeout: 15                  # minutes
    on: { pass: approve, fail: dev }

  approve:
    type: gate                   # waits for a human in the UI
    prompt: Merge it?
    on: { pass: done, fail: dev }

  done:  { type: end, status: success }
  stuck: { type: end, status: failure }
Stage Outcomes Notes
agent planner planned sees the pipeline and run history; publishes the plan and per-stage briefs (briefs_for, max_plan_steps)
agent researcher answered read-only; posts a sourced answer (gauntlet_answer) to the conversation
agent worker submitted prompt, model, agent, permissions, context, nudges, ask_human, max_questions, include: [issue, plan, log, diff]
agent reviewer each of verdicts findings are posted to the log and shown to the next stage
command pass, fail run, cwd, env, pass_codes, output_limit; env has GAUNTLET_RUN_ID, GAUNTLET_STAGE, GAUNTLET_VISIT, GAUNTLET_BASE
gate pass, fail approve or request changes in the UI
loop next, done runs its body once per item: items (plan or a list), item_briefs (plan, agent, none), briefs_for, sessions, max_items, prompt, model
end — status: success or failure ends the run

Every stage can also produce error (agent or command failure, timeout, nudges used up) and exhausted (max_visits reached). An outcome with no route fails the run. The editor warns about unrouted outcomes, unreachable stages, uncapped loops and similar problems before you run.

Loop budgets that start over. By default max_visits counts for the whole run, so once a stage is exhausted, any work that comes back to it (say, a human gate sends it back to the developer) is exhausted again on arrival, and the loop can never make progress. Set reset_on_exhausted: true (in the editor: Start counting again once it's exhausted) and the stage's count starts over after its exhausted route has been taken, so the next pass gets the full budget. The graph shows ×12 · 4/8 ↺ for a stage that ran 12 times and has used 4 of its 8 visits since the last reset. limits.max_steps and the cost cap still bound the run as a whole.

  tests:
    type: command
    run: bun test
    max_visits: 8
    reset_on_exhausted: true     # after 8 red runs go to approve; if sent back, 8 more
    on: { pass: review, fail: dev, exhausted: approve }

Custom permission rules use OpenCode V2 syntax: permissions: [{ action: shell, resource: "git *", effect: allow }, { action: edit, effect: deny }]. A rule left as ask shows up in the UI as a permission request.

Export on a run page saves the PR conversation as markdown, with or without the final diff, or copies it to the clipboard. The export has the run's details (pipeline, status, branch, cost, models, merge), the issue, and every conversation entry in order: plans with their briefs, verdicts with findings, research with sources, questions with their answers, command output, commits and stage transitions. From the command line: gauntlet export <run id> [--diff] [-o file.md], or fetch /api/runs/<id>/export.md.

The run page's Agents tab follows whichever agent is working. If you pick an agent, it stays on that one until that agent finishes and the next stage starts, then it goes back to following.

What an agent sees

On its first turn, an agent gets its instructions, the issue, the current plan and its own brief from the planner, the PR log so far, the diff against the base commit, and the finishing protocol. When the pipeline loops back to it, a persistent agent gets only what is new: new log entries (reviewer findings, test output, human comments), the plan if it changed, and the current diff. Human comments posted in the UI reach every agent on its next turn. The exact wording is in src/engine/prompts.ts.

Planner. A planner's prompt also describes the pipeline it is planning for: the happy path, then every stage with its role, permissions, instructions, routes and max_visits. When the run loops back to it (for example a reviewer's replan verdict), it also gets the execution history: which stages ran, in what order, with what outcomes, and which ones keep looping. Its gauntlet_plan call takes plan (markdown), steps, summary and optional briefs keyed by agent stage id. A new plan replaces the old one for every later turn. The planner can't change the graph itself: routing, reviewers and gates stay under your control.

Questions. gauntlet_ask takes a question, optional context and suggested options. The agent ends its turn and the run shows waiting. You can reply with one of the options, your own text, or "use your judgement". The answer is posted to the PR and sent to the agent as its next message; asking doesn't count against nudges. You can also answer while the run is paused, and the answer is delivered when you resume it. An agent can't finish its stage while its own question is open. Forcing the stage's outcome or cancelling the run closes open questions.

CLI

gauntlet serve [--port 7317] [--host auto|localhost|tailscale|<ip>] [--repo DIR]
               [--backend opencode|mock] [--opencode-url URL] [--token T] …
gauntlet validate pipelines/my.yaml
gauntlet run quick-review --title "Fix the flaky login test" --issue @issue.md
gauntlet runs

Architecture

src/core/       schema (zod), YAML I/O that keeps comments, graph checks.
                Shared by the server and the browser.
src/engine/     run state machine, SQLite store, git worktrees, commands, prompts
src/backends/   opencode.ts (OpenCode 2.x via @opencode/client), mock.ts
src/server/     Hono API, SSE live events, MCP endpoint, access policy
web/            Svelte 5 + Svelte Flow + CodeMirror UI
  • A run walks the graph one stage at a time; each visit produces an outcome that the stage's on table routes. Runs, the PR log, visits, sessions, activity and asks are stored in SQLite. If Gauntlet restarts mid-run, the run is paused, and resuming re-runs the interrupted stage in the same OpenCode session.
  • The OpenCode backend creates sessions with permissions, model, agent and metadata, registers Gauntlet's MCP endpoint (/mcp/<runId>) for the run's directory, and follows /api/event for text, tools, usage, sub-agents and permission requests. A status poll backs up the event stream.
  • Pipelines are snapshotted when a run starts, so editing a pipeline never changes a run already in progress.

Status and caveats

  • Built and tested against @opencode/client 2.3.2. The tests run the real client against a fake OpenCode service speaking its wire format. The first run against a live OpenCode install is still to come; please report anything that differs.
  • Gauntlet registers its tools through OpenCode's experimental MCP API (/api/experimental/mcp), which may change between OpenCode releases.
  • One stage runs at a time per run; several runs can run in parallel, each in its own worktree.

Development

bun test                 # engine, YAML round-trip, OpenCode adapter, HTTP + MCP
bun run typecheck        # tsc + svelte-check
bun run dev              # server with --watch
bun run dev:web          # Vite dev server on :5173, proxied to :7317
node scripts/screenshots.mjs  # regenerate docs/screenshots (needs Playwright + Chromium)