Skip to content

Concepts

Role Job
planner Turns the spec into tickets and answers follow-ups from the queue.
orchestrator Dispatches ready tickets to workers and reacts to events.
worker Implements one ticket in a pair and submits the round for review.
reviewer Gives a pass or fail verdict on a submitted round.

Instances are numbered: worker.2 is the second worker. orchestrator and planner are always .1. A pair is one worker and one reviewer with the same index.

Each role resolves to an agent definition (TOML): cli, optional model, profile, and prompt. Built-in CLIs are listed on Providers. wteam runs one headless adapter invocation per turn, resumes the stored session id when the CLI supports it, and parses assistant text plus token usage from stdout. See Architecture.

The team graph says who talks to whom and on which event. It is a DOT file:

digraph default {
graph [max_visits=3, handoff_tokens=150000]
orchestrator [agent="orchestrator"]
worker [agent="worker", count="$pairs"]
reviewer [agent="reviewer", count="$pairs"]
orchestrator -> worker [on=dispatch, kind=broadcast]
worker -> reviewer [on=submit, kind=pair]
reviewer -> worker [on=fail, kind=pair]
reviewer -> orchestrator [on=pass, kind=fan-in]
worker -> orchestrator [on=blocked, kind=fan-in]
}

With --pairs 2, wteam materializes two worker/reviewer pairs. The same edges apply; dispatch is broadcast (every worker), submit/fail stay within a pair, and pass/blocked fan in to the orchestrator:

flowchart TB
O[["orchestrator.1"]]
subgraph P1["Pair 1"]
W1[worker.1]
R1[reviewer.1]
W1 -->|submit| R1
R1 -->|fail| W1
end
subgraph P2["Pair 2"]
W2[worker.2]
R2[reviewer.2]
W2 -->|submit| R2
R2 -->|fail| W2
end
O -->|dispatch| W1
O -->|dispatch| W2
R1 -->|pass| O
R2 -->|pass| O
W1 -->|blocked| O
W2 -->|blocked| O

The default preset also declares a planner node for spec and ticket authoring; routing from the planner is configured in your own DOT when you wire it in.

Node shapes: box is an agent role, parallelogram is a command (script=), and hexagon is a human gate. Edge kind defaults to pair (broadcast, fan-in are the other options — see Mail routing). count defaults to 1. max_visits caps review rounds: after that many failures, the ticket becomes Blocked.

A ticket’s Verify: commands run first at submit, then the command nodes on the worker’s path. A failing command (non-zero exit or timeout) returns the ticket to the worker with the output tail as the finding. A human gate holds a passed ticket until wteam approve <ticket>. A human gate cannot directly follow submit. A pass path that reaches a reviewer who already passed the round blocks the ticket.

A worker step is any agent node with a submit edge. When a PASS path (through reviewers, command nodes or human gates) reaches another worker step, that step’s instance on the same pair takes the ticket, with a brief that names its skill=. The ticket keeps its worktree and commits once, after the last step’s reviewers pass. A FAIL goes back to the step whose reviewer failed it. Every step needs the first step’s count. continue=true on a step moves the previous step’s session to it when the session fits under session_tokens; a resumed session skips the new step’s role prompt, so put per-step instructions in skill=. A ticket’s **Start at:** <step> skips the earlier steps, for work whose earlier output already exists. A blocked ticket that is requeued resumes at its step, with the requeue note in its brief; requeue --fresh discards the work and starts again at its first step.

plan [agent="worker", count="$pairs", skill="plan-experiment"]
approval [shape=hexagon]
run [agent="worker", count="$pairs", skill="run-experiment", continue=true]
plan_rev -> approval [on=pass]
approval -> run [on=pass]

The work graph holds tickets and their Blocked by links. wteam ready lists the tickets with every blocker Done. wteam graph --work draws it.

A ticket may name skills: **Skill:** diagnose-failure for its worker and **Review skill:** audit-agent-diff for every reviewer. A node’s skill= names one for every ticket that role handles. Each brief, review request and fix request then opens with “Use the <skill> skill for this turn”, so an agent whose session is resumed still gets the instruction; the role prompt reaches only a session’s first turn. wteam pickup flags a value that is not a skill name, but it cannot check that the skill is installed in the agent’s harness.

  1. dispatch sets a ready ticket to Doing and mails its brief to a worker.
  2. submit moves it to Review and mails the reviewer the ticket, the worker’s summary and the diff of the ticket’s files.
  3. verdict pass commits the ticket’s files as feat: <title> (wteam NN) and sets it to Done. verdict fail returns it to Doing with the findings.
  4. block marks the ticket Blocked and tells the orchestrator. requeue returns a blocked ticket to Todo with a note for the next dispatch brief; the review round count resets. Only blocked tickets can be requeued.

Full sequence: Architecture.

Each agent has an append-only mailbox at .wteam/<slug>/mail/<agent>.md. A message is a marker line, headers (from, at, optional ticket, length), a blank line and exactly length bytes of body. Parsers read by length, so a body can hold a diff or a whole ticket. wteam inbox shows unread messages and --all shows the whole mailbox.

On the first turn of a session, the role prompt includes a Team section: every instance id (worker.2, reviewer.2, orchestrator.1, …) and your pair index when you are a worker or reviewer. Reach anyone with wteam send <instance> "…" (ticket flow still uses submit / verdict / dispatch).

When the orchestrator’s context passes min(handoff_tokens, 0.75 × context_window), wteam run asks it for a baton. The baton is written to handoffs/orchestrator-<gen>.md, and the next generation starts with that file as its brief.

wteam run --dispatch auto (the default) fills idle pairs with the watcher itself, so dispatch costs no model turn. The orchestrator wakes only when a ticket blocks or a human gate needs approval. --dispatch model keeps the orchestrator dispatching every ticket.

--replan (off by default) gives each blocked ticket one planner turn under auto. The planner runs in the repo root with the plan profile, rewrites the ticket, and requeues it. A ticket blocked again after its re-plan stays blocked, and the stop report says it was re-planned once. The stop report and --json record the mode.

A turn that ends while its agent still holds a ticket, with no submit or block, gets one re-prompt. A second silent turn blocks the ticket and tells the orchestrator. Transient adapter failures retry three times with backoff. A busy agent whose turn process has died is reset on the next command.

One small smoke test, not a benchmark. The work is a small Python project. Workers and reviewers run Claude Haiku. Costs are Claude-reported.

Run Work Wall time Result Cost
2 Tickets 01 (subtract) and 02 (clamp_diff), one pair 16 s and 13 s Both passed on round 1 about $0.025
3 Tickets 03 (multiply) and 04 (safe_divide), wteam run --pairs 1 34 s Stop report: 4 done, 0 blocked; orchestrator used 3 turns about $0.056

Run 1 stalled before these numbers: agents loaded user settings and Bash denials left the worker unable to submit. Agent isolation and the one-command rule fixed it.

Every verdict appends to reviews/NN.md, newest last. Non-blocking follow-ups (--follow-up key:text) append to queue.md for the planner.