A control plane for running AI coding agents in parallel
Observe → Reconcile → Decide → Recover → Verify
What It Does • In Practice • Quick Start • Architecture • CLI • Status
Running one AI coding agent in a terminal is easy. Running several at once — each on its own issue, branch, worktree and PR, with CI and code review in the loop — is where things start to drift. Sessions stop without leaving recovery context, PRs go stale while local state still thinks they are active, two sessions pick up the same task, and nobody can say afterwards why an automated action happened.
ao-pilot is the layer that keeps that work coherent. It sits on top of agent-orchestrator (AO), which spawns and coordinates the agent sessions, and adds:
- durable task state — tasks, ownership leases, PR bindings, handoffs and checkpoints that survive any single session;
- reconciliation — continuous comparison of what AO believes against what GitHub actually shows for PRs, CI and reviews;
- lifecycle diagnostics — classifying work as healthy, blocked, ambiguous, stale, orphaned or ready for review;
- recovery — successor handoff and checkpoint resume when a worker session dies mid-task;
- policy gates and audit records — every automated action is tied to an explicit decision;
- evaluation — replayable scenarios, metrics and scorecards to check that changes actually make the system better.
When sources disagree in a way that cannot be resolved safely, ao-pilot marks the work blocked or ambiguous and surfaces it, rather than letting automation continue on a guess.
ao-pilot is used every day to develop a separate (private) product repository:
- An orchestrator session (referred to as the OR throughout the docs) drives a chain of related issues.
- Worker sessions implement each issue on its own branch and worktree and open a PR.
- An independent reviewer session reviews each PR; corrections loop back to the worker, usually over several rounds.
- Once review passes, the OR merges.
ao-pilot observes and judges throughout — which tasks are healthy, which are stuck, which sessions need a successor — while the OR keeps the authority to act. Run this way, the system works unattended overnight and has carried more than 100 issues, across dozens of parent-issue chains, from issue to merged PR.
Platform: Linux x64/arm64, including WSL2. Windows-native runtime is not supported.
- Node.js 20+ (the unified release launchers need Node ≥ 22.15)
- npm, Git, tmux
curl,tarandgzipfor the checksummed Go toolchain bootstrap- GitHub CLI (
gh), authenticated withgh auth login - A repository where AO-style agent sessions will operate
git clone https://github.com/Samsen879/ao-pilot.git
cd ao-pilot
npm ciBootstrap the pinned AO runtime into a content-addressed managed store:
./scripts/bootstrap.sh --jsonThe bootstrap builds the exact locked runtime source and never uses an ao found on PATH; it refuses to continue if one would shadow the managed binary. See AO Runtime for paths, offline mode, reinstall and recovery, and Unified installation for packaged releases with systemd services and rollback.
npm link
ao-pilot init --project my-project # writes ao.config.json
ao-pilot doctor --json # runtime provenance, auth availability, unhealthy work
ao-pilot start # start the managed runtime daemon
ao-pilot status --json
ao-pilot dashboard # localhost-only browser dashboard
ao-pilot controller --holder my-session --mode observedoctor reports whether GitHub and Codex credentials are available but never prints probe output or the credentials themselves.
npm test # unit and integration suite
npm run ao:test:acceptance # lifecycle acceptance scenarios
ao-pilot eval --pack all # bundled evaluation packsao-pilot is organised around a control loop:
┌──────────────────────────────────────────────────────────────┐
│ ao-pilot │
│ │
│ Observation Sources │
│ ├─ AO state │
│ ├─ GitHub PR state │
│ ├─ CI/check state │
│ └─ Review state │
│ │ │
│ ▼ │
│ Event Ingest │
│ │ │
│ ▼ │
│ Reconciliation │
│ ├─ local AO state │
│ ├─ GitHub-facing truth │
│ └─ drift / ambiguity detection │
│ │ │
│ ▼ │
│ Lifecycle / Diagnostics │
│ ├─ blocked │
│ ├─ ambiguous │
│ ├─ stale │
│ ├─ orphaned │
│ └─ ready / needs review │
│ │ │
│ ▼ │
│ Decision + Policy Gates │
│ │ │
│ ▼ │
│ Action Proposal / Assisted Execution │
│ │ │
│ ▼ │
│ Persistent State + Audit Trail │
└──────────────────────────────────────────────────────────────┘
- Observe — read active tasks, ownership leases, PR bindings, branch heads, CI checks, review decisions, handoff records and checkpoints.
- Reconcile — compare local AO state with GitHub. If AO thinks a PR is failing but GitHub shows green checks, the stale local view loses. A task with an open PR but no valid owner becomes orphaned. A disagreement that cannot be resolved safely becomes ambiguous.
- Diagnose — classify each task: healthy, blocked, ambiguous, stale, orphaned, review-pending, or ready for its next action.
- Decide — map the diagnosis to an action: keep observing, refresh stale observations, retry bounded recovery, request review, propose a handoff, resume from a checkpoint, notify a session, or hold until CI or review changes.
- Act — in
assistmode, permitted actions execute through policy gates. - Persist — write state changes and decision records to the durable state model.
| Mode | Observes | Reasons | Proposes actions | Executes actions |
|---|---|---|---|---|
observe |
✅ | ✅ | ❌ | ❌ |
shadow |
✅ | ✅ | ✅ | ❌ |
assist |
✅ | ✅ | ✅ | ✅ |
shadow shows what the system would do without changing anything, which makes it the natural way to trial a new policy before enabling it.
Control-plane records live in a local, file-based state model:
tasks · ownership leases · controller leases · PR bindings
actions · policy decisions · handoff requests / claims / transfers
checkpoints · review records · run metrics · audit entries
The schemas are still evolving; versioned JSON Schemas for the stable contracts are in schemas/.
- Explicit state over hidden session memory.
blockedorambiguousover unsafe automatic progress.- GitHub PR / CI / review state is the source of truth during reconciliation.
- Handoff and recovery are durable, not reconstructed from conversation history.
- Observing and acting are separated: ao-pilot judges, the orchestrator holds merge authority.
- Machine-readable output everywhere, for debugging and audit.
All commands are subcommands of ao-pilot; most accept --project <id> (default: from ao.config.json) and --json. Run ao-pilot <command> --help for full options.
| Area | Commands |
|---|---|
| Control loop | controller |
| Diagnostics | doctor, reconcile, lifecycle, state, metrics |
| Task management | manage, handoff, review, override, knowledge |
| Runtime | start, stop, status, runtime-path, runtime-project-get, runtime-contract, upgrade, restore |
| Sessions & messages | session, send, ack |
| Tooling | init, dashboard, eval, execution, publication-preflight |
Common examples:
# Control loop: single pass, continuous, or focused on one issue
ao-pilot controller --holder dev-session --mode shadow --json
ao-pilot controller --holder dev-session --mode assist --continuous
ao-pilot controller --holder dev-session --issue 42
# Does AO state agree with the PR's branch, CI and review state?
ao-pilot reconcile --pr 42 --json --strict
# Is there enough continuity, CI and review evidence to move forward?
ao-pilot lifecycle --pr 42 --json
# Enroll an issue as a managed task
ao-pilot manage enroll --issue 42 --title "Fix failing parser test" \
--branch feat/fix-parser-test --worktree ../worktrees/fix-parser-test
# Hand a task to a successor session
ao-pilot handoff request --issue 42 --successor-session next-worker
# Check Git publication identity and credentials without pushing or changing config
ao-pilot publication-preflight --expected-repository owner/repo \
--expected-principal github-login --worker-principal github-login --jsonThe supported ESM entrypoints are ao-pilot, ao-pilot/cli, ao-pilot/contracts, ao-pilot/repository, ao-pilot/engines, ao-pilot/protocols, ao-pilot/providers, ao-pilot/authority and ao-pilot/execution:
import { createStateRepository } from 'ao-pilot/repository';
import { reconcileObservations, runControllerLoop } from 'ao-pilot/engines';
import { createLocalCommandRunner } from 'ao-pilot/providers';Paths outside package.json#exports intentionally fail with ERR_PACKAGE_PATH_NOT_EXPORTED.
ao-pilot is at v0.2.0 and runs a real development workflow every day (see In Practice), but it is a single-maintainer project rather than a general-purpose product:
- The declared library exports and CLI are maintained; internals under
scripts/may change without notice. - Documentation is written for the maintainer's workflow first; onboarding for other setups is still thin.
- It assumes human review stays in the loop and is not designed to operate without it.
See the CHANGELOG for release history.
Installing the package and running it on a fresh workstation are verified separately. The package-level portability claim (npm ci, npm run verify:package) is accepted; runtime bootstrap is covered by an empty-HOME fresh-clone gate (npm run verify:fresh-clone); full new-workstation self-hosting is still awaiting its receipt. Details are in the P0-R01 incident baseline and AO Runtime.
bin/ao-pilot.js Unified CLI entrypoint
lib/ Public ESM entrypoints (package.json#exports)
scripts/ CLI command implementations
scripts/ao/lib/ Engines: controller loop, reconciliation, lifecycle,
doctor, handoff, checkpoints, policy, actions, eval
schemas/ Versioned JSON Schemas for stable contracts
dashboard/ Localhost dashboard front end
browser/ Imported upstream dashboard source (see browser/SOURCE_IMPORT.json)
integrations/ Dashboard native adapter
runtime/ Runtime locks and the vendored headless AO runtime source
templates/ Example config, systemd units, tmux layouts
docs/ Architecture, runtime, release, evaluation and design notes
tests/ao/ Unit, integration and acceptance tests
agent-orchestrator (formerly ComposioHQ/agent-orchestrator) provides the session runtime: spawning agent sessions, routing feedback and coordinating work. ao-pilot is maintained independently and adds the control plane described above. To make installs reproducible it also vendors two pieces of upstream code:
runtime/headless/— a reduced copy of the upstream Go runtime, pinned to an exact commit, with the desktop launcher replaced by a fail-closed command;browser/— the upstream browser dashboard source, imported byte-for-byte with a hash manifest.
Issues and PRs are welcome. For larger architectural changes, please open an issue first. Useful areas include clearer docs, smaller examples, simpler setup, better diagnostics and safer default policies.
ao-pilot is released under the MIT License. Vendored upstream code keeps its original license: runtime/headless/ is Apache-2.0, and browser/ is MIT.