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
| Where | How |
|---|---|
| Chat (any interface) | /pipeline <task>, or Pipeline in the recipient menu of the desktop app and VS Code |
| Terminal, one run then exit | duo "<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-tokensand a folder of its own: run files.
Roles
| Step | Role | Default agent |
|---|---|---|
PLAN | planner | Codex |
PLAN_REVIEW | plan critic (plan_reviewer) | Claude Code |
PLAN_FINALIZE | planner, signing off | Codex |
IMPLEMENT | implementer | Claude Code |
VERIFY | your gates | AgentDuo runs the commands |
CODE_REVIEW | code reviewer | Codex |
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
PLAN
The planner writes a plan with goals, scope, steps, acceptance criteria and risks (
plan.v1.md).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.
PLAN_FINALIZE
The planner answers the critique and signs off the final plan (
plan.final.md), or requests another round. Withquality_gates.require_plan_approval: falsethis 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
completedorblockedwith a reason.blockedstops the run withimplementer_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 withmax_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.
requiredis true unless you set it to false; an optional gate is only reported. - Each gate has
timeout_sec, orlimits.gate_timeout_sec(900 seconds). Its output is logged in the run’sgates/folder, and its lastlimits.max_gate_output_charscharacters (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_failureis true). Afterlimits.max_consecutive_gate_failuresfailing rounds in a row (3), the run stops withgates_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 initsuggests 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_approvalis 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_passis 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)
| Key | Default | Effect |
|---|---|---|
require_plan_approval | true | The planner signs off the plan after the critic approves it (PLAN_FINALIZE). |
require_tests_pass | true | A failing required gate keeps the run from DONE and sends the work back. |
require_codex_approval | true | The code reviewer must approve. The name is historical: it applies to whichever agent reviews. |
stop_on_critical_issue | true | A critical finding stops the run and asks you. |
blocking_severities | [critical, high] | Findings and issues of these severities block approval. |
review_on_gate_failure | false | Review 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: 3Warnings
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 diffThe 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.