All documentation pages

The pipeline

A pipeline run takes one task through plan → critique → finalize → implement → verify → review, with each step done by the agent configured for its role, until the review approves or the run asks you.

On this page

Starting a run

Ways to start a pipeline run
WhereHow
Chat (any interface)/pipeline <task>, or Pipeline in the recipient menu of the desktop app and VS Code
Terminal, one run then exitduo "<task>", duo run "<task>", duo --task-file task.md
  • The workspace must be inside a Git repository, and the CLIs of every role must be found. The configuration is checked before anything starts.
  • A workspace runs one pipeline at a time, guarded by a lock in its runs folder.
  • The run gets an id such as 20261031-101500-add-refresh-tokens and a folder of its own: run files.

Roles

Roles and their default agents
StepRoleDefault agent
PLANplannerCodex
PLAN_REVIEWplan critic (plan_reviewer)Claude Code
PLAN_FINALIZEplanner, signing offCodex
IMPLEMENTimplementerClaude Code
VERIFYyour gatesAgentDuo runs the commands
CODE_REVIEWcode reviewerCodex

Change who plays a role with the agents keys; each agent gets role_args of its own per role:

.agentduo/config.yaml

# Swap the roles: Claude Code plans and reviews, Codex critiques and implements.
# codex exec is read-only unless told otherwise, so the implementer gets a workspace-write sandbox.
agents:
  planner: claude
  plan_reviewer: codex
  implementer: codex
  code_reviewer: claude
codex:
  role_args:
    implementer: [--sandbox, workspace-write]

Planning and critique rounds

  1. PLAN

    The planner writes a plan with goals, scope, steps, acceptance criteria and risks (plan.v1.md).

  2. PLAN_REVIEW

    The critic checks that the plan is feasible and lists issues by severity. It approves only when no issue is blocking; an approval that still lists a blocking issue counts as changes requested, with a warning.

  3. PLAN_FINALIZE

    The planner answers the critique and signs off the final plan (plan.final.md), or requests another round. With quality_gates.require_plan_approval: false this step is skipped: the plan the critic approved is final.

Changes requested start the next planning round. After limits.max_planning_rounds rounds (4 by default) without agreement, the run stops with max_planning_rounds and asks you: resume implements the latest plan, recorded as accepted by you. With safety.pause_before_implement: true the run also stops with plan_ready once the plan is final, so you can read it first.

Implementation rounds

  • Before the first round AgentDuo snapshots the workspace as the baseline; after each round it snapshots it again.
  • The implementer builds the plan (round 1) or fixes the open findings (later rounds), and reports completed or blocked with a reason. blocked stops the run with implementer_blocked.
  • An implementer that does not answer every open finding gets a warning in the report.
  • Rounds continue until the review approves, up to limits.max_review_rounds (5 by default); then the run stops with max_review_rounds.

Command gates (VERIFY)

Gates are commands of yours that AgentDuo runs itself after each implementation round, in the workspace, through the shell. They are optional; without any, the run goes from IMPLEMENT straight to CODE_REVIEW.

.agentduo/config.yaml

# Command gates: agentduo runs each command in the workspace after every implementation round (the VERIFY step).
# A required gate that fails sends the work back to the implementer; an optional one is only reported.
gates:
  - name: tests
    command: "npm test"
    required: true
    timeout_sec: 600
  - name: lint
    command: "npm run lint"
    required: false
limits:
  max_consecutive_gate_failures: 3   # this many failing rounds in a row stop the run and ask you
  gate_timeout_sec: 900              # for gates without a timeout_sec of their own
  • A gate passes when its command exits with 0. required is true unless you set it to false; an optional gate is only reported.
  • Each gate has timeout_sec, or limits.gate_timeout_sec (900 seconds). Its output is logged in the run’s gates/ folder, and its last limits.max_gate_output_chars characters (6,000) go to the reviewer.
  • When a required gate fails, the work goes back to the implementer for another round, without a review (unless quality_gates.review_on_gate_failure is true). After limits.max_consecutive_gate_failures failing rounds in a row (3), the run stops with gates_failing.
  • If a gate changes files in the working tree, AgentDuo warns and snapshots again, so the reviewer sees the tree as the gates left it.
  • duo init suggests gates it detects (package.json scripts, pytest, go test, cargo test, a Makefile test target), commented out.

Note

Gates are not the same as quality_gates: gates are commands that run; quality_gates is the review policy below, which runs nothing.

Code review

The reviewer gets the final plan, the diff from the baseline to the latest snapshot (up to limits.max_diff_chars, 120,000 characters; longer diffs are cut and it is told so), the diff stat, the gate results, the open findings and the implementer’s report. It must name the snapshot it reviewed.

It answers with findings, each with a severity (critical, high, medium, low), and approves or not. A run is DONE when all of these hold:

  • the reviewer approves (or quality_gates.require_codex_approval is false);
  • no finding has a blocking severity (quality_gates.blocking_severities, by default critical and high);
  • every required gate passed, if you have gates (and quality_gates.require_tests_pass is true).

Otherwise the implementer gets another round. A critical finding stops the run with critical_finding first, while quality_gates.stop_on_critical_issue is true. An approval that still lists blocking findings counts as changes requested, with a warning.

The review policy (quality_gates)

quality_gates keys
KeyDefaultEffect
require_plan_approvaltrueThe planner signs off the plan after the critic approves it (PLAN_FINALIZE).
require_tests_passtrueA failing required gate keeps the run from DONE and sends the work back.
require_codex_approvaltrueThe code reviewer must approve. The name is historical: it applies to whichever agent reviews.
stop_on_critical_issuetrueA critical finding stops the run and asks you.
blocking_severities[critical, high]Findings and issues of these severities block approval.
review_on_gate_failurefalseReview a round even though a required gate failed.

.agentduo/config.yaml

# Review policy (quality_gates): how strict the loop is. These keys decide when a run is DONE or stops for you;
# they run no commands. Commands to run are under gates.
quality_gates:
  blocking_severities: [critical, high, medium]   # findings of these severities must be fixed before DONE
  stop_on_critical_issue: true                     # a critical finding stops the run and asks you
  review_on_gate_failure: true                     # the reviewer sees a round whose required gates failed
safety:
  pause_before_implement: true                     # stop with the final plan and wait for your go-ahead
limits:
  max_review_rounds: 3

Warnings

AgentDuo blocks nothing, but it reports. Warnings appear on screen as they happen and in the run’s report.md:

  • files changed by a planning or reviewing agent;
  • files changed outside the workspace during a step, with paths relative to the workspace (../shared/x.ts);
  • tool calls Claude was denied, naming the tools;
  • gates that changed the working tree;
  • an approval with blocking issues, an implementer that skipped findings, a step re-run after an interruption.

When the run ends

Nothing is committed or pushed. The changes are in your working tree:

Terminal

git status
git diff

The run’s report.md has the timeline, gate results, diff stat, unresolved issues, warnings, cost and tokens. /diff, /plan and /status show them in the chat; the desktop app’s inspector and VS Code’s ⋯ menu open them.