One Governor Loop, Not a Swarm
Why Agent!'s Auto-Pilot runs one disciplined governor loop with nested cycles instead of a swarm of sub-agents. One context, tight local feedback from the real compiler and OS, and recovery steered by the exact failure, not a vote between parallel guesses. With a C64 emulator as the worked example.
A lot of agent tooling right now answers hard problems with more agents. A planner persona hands off to a coder persona, which hands off to a reviewer persona, which hands off to a tester, and a manager agent tries to keep them in step. It looks great in a diagram. In practice it means paying, in tokens and in time, for the agents to tell each other what they know, and it opens the door to state drift and conflicting edits.
Agent! takes the other road. Auto-Pilot is one governor loop with nested cycles. One loop owns the goal, the context and the repository. Inside it, each cycle is a full task that hammers on one step until that step is built, fixed and committed. Then the governor steps back out, reads the result, and picks the next step.
We think that's a real architectural advantage, and this post is about why.
What the governor actually is
Auto-Pilot is the /auto command. The code lives in AutoPilot.swift, and the shape is simple:
- The outer loop is the governor.
/auto <goal>starts a session that runs cycle after cycle. There is no cycle limit. It ends only when the model starts its summary withAUTOPILOT: GOAL REACHED, reportsAUTOPILOT: BLOCKED(it needs you), runs out of an optional time budget (/auto 4h <goal>), or when you stop it. - The inner loop is the cycle. Each cycle is an ordinary Agent! task with every tool and guardrail, and no per-cycle iteration cap. Its prompt tells it to pick the single most valuable next step and implement it fully: edit → build → fix → commit, as many times round as it takes.
- State is carried forward on disk, not in chatter. When a cycle ends, its summary is appended to the tab's
progress.mdunder.agent/tabs/, and the next cycle's prompt starts with the recent progress, plus instructions to re-read it,git status,git logand the project index before doing anything. - Git is the heartbeat. The governor records
HEADwhen a cycle starts. A cycle that finishes without a new commit counts as a stall, and three stalls in a row end the session (autoPilotMaxStalledCycles = 3). "Busy" doesn't count. Committed work does.
That's the whole architecture: one steering loop, one working loop nested inside it, and the compiler, the test runner, the shell and git as the source of truth.
Zero coordination tax
In a swarm, every handoff is a lossy summary. The planner compresses its understanding into a message, the coder rebuilds a picture of the codebase from that message, and the reviewer rebuilds it again. Each persona spends tokens learning what another persona already knew, and each summary is a chance for something to fall out.
The governor doesn't pay that tax. There is one context per cycle, and between cycles the hand-off is to itself: a progress log it wrote, a git history it made, and project memory and an index shared on disk. Nothing has to be negotiated. The next cycle reads what happened and continues.
Tight local feedback loops
Take a genuinely hard build as a thought experiment: a Commodore 64 emulator. It isn't one problem. It's a CPU, a video chip, a sound chip, timers and I/O, and they all have to agree on timing down to the cycle.
A swarm would want to give the CPU to one agent, the VIC-II to another and the SID to a third, and then spend its effort reconciling them. The governor does it differently:
- One cycle, one subsystem. A cycle might hammer the 6510 opcode table against a test ROM: implement, build, run, read the failing opcode, fix it, run again, until the suite passes and the work is committed.
- The next cycle steps out and re-aims. The governor reads that summary and picks the next most valuable step, for instance VIC-II raster timing, with the CPU work already landed and visible in git.
- Then the hard edges. Something like a 230k-baud serial buffer is exactly the kind of bug you only find by running real code and reading real output, over and over, in one place.
Every inner cycle is grounded in what the build and tests actually say, not in what another agent claims they said.
Predictable steering and recovery
When something breaks in a swarm, several agents can see several different slices of the failure, and each can propose a fix. Now you have conflicting edits and an argument about whose turn it is.
When something breaks under the governor, there's one view of it: the exact compiler error, the exact failing test, the exact commit that came before. The cycle fixes it in place, or it ends with a summary that says what's still broken, and the next cycle starts from precisely that state. If a cycle ends with no summary at all (a provider error, say), the session doesn't die. It waits 15 seconds, then 30, then 60, up to five minutes, and tries again. If you press Esc, only the current cycle is cancelled and Auto-Pilot schedules the next one. Stop All is the one control that ends everything.
That's what makes it predictable. The loop can only move forward from the real state of the project, and it's easy to see where it stopped and why.
Where parallelism does belong
"No swarms" doesn't mean "never parallel." Agent! has sub-agents, and they're useful. They're just aimed at the right job. SubAgent.swift caps write-capable sub-agents at 3 per task "to avoid concurrent mutations", and lets read-only research agents fan out to 6. Searching docs, reading a big codebase or comparing APIs parallelizes nicely. Editing the same files from several minds at once doesn't.
The same thinking applies across tabs. Several Auto-Pilot tabs can work on one project, and each one keeps its own governor and progress log. When another Auto-Pilot is already live on the project, a new session gets its own git worktree and branch by default (/auto --worktree forces it), and every prompt lists the other live tabs so they don't duplicate work. Parallel governors are fine. Parallel hands on the same file are what we avoid.
The short version
- One governor holds the goal and the context. There's nothing to keep in sync.
- Nested cycles work one step at a time, all the way to a green build and a commit.
- Real feedback from the compiler, tests, shell and git steers every decision.
- Recovery starts from the exact failure, not a vote between guesses.
If you want to see it work, give it something hard: /auto <goal> in Agent! for Mac, or brew install --cask agentiloop-agent. For the gentler introduction to loops in general, start with What Is an Agent Loop?, and for a long-running example, read GoKart, built on Auto-Pilot.