Skip to content

AI engineering · 13 June 2026 · 8 min read

Who gets the CPU? Orchestrating a fleet of AI coding agents on one machine

Running a dozen AI coding agents at once turns your machine into a shared resource. Here's how we decide which work gets it, pause the rest safely, and stop slow machines from failing good tests.

  • AI engineering
  • AI coding agents
  • Testing
  • For engineers
  • For CTOs and tech leads
In this article
  1. What changes when you run a dozen agents at once?
  2. How did the most important work end up last?
  3. What does a governor do?
  4. Can you pause a test without failing it?
  5. Isn't this over-engineering?
  6. Six rules for running agents in parallel
  7. What does this mean for your business?
  8. What should your team do first?
  9. FAQ

The short answer: once you run many AI coding agents in parallel, the limit stops being how fast they write code and becomes the machine they share. Builds, tests and reviews all compete for the same processors, and without anyone deciding priorities, the most important work can end up waiting behind the least important. A small piece of orchestration fixes this: it knows which work matters most, gives that work the machine, pauses the rest safely, and makes sure a busy machine doesn't fail good code.

We hit this ourselves, running more than a dozen agents on one machine. Here's what went wrong, and the small piece of orchestration that fixed it.

What changes when you run a dozen agents at once?

One agent on a laptop is like one developer: it has the machine to itself. Run a dozen or more in parallel, each in its own copy of the code, and they behave like a team sharing a single computer. Each one compiles, runs tests and checks its work, and those are some of the most demanding things a computer does.

Most of the time, this is what you want. Parallel agents are how a small team gets through a large amount of work. But not all of that work is equally urgent. At any moment, one piece is usually on the critical path: the batch of changes about to be merged, which everything else is waiting for. The rest is background work that can wait a few minutes without anyone noticing.

The operating system doesn't know which is which. Left alone, it shares the processors out roughly evenly. That's fair, and it's exactly wrong.

How did the most important work end up last?

We found out the hard way, twice.

The 50-minute build. On Apple Silicon Macs, there are two kinds of processor cores: fast performance cores and slower, power-saving efficiency cores. macOS lets you mark a process as background work, which keeps it on the efficiency cores so it doesn't get in anyone's way. We launched our background agents like that, deliberately.

Then one agent, preparing the batch everyone was waiting for, copied the same launch command. Our most urgent build was now squeezed onto the four slowest cores, shared with more than a dozen background agents, while the fast cores sat partly idle. A build that should take minutes took 50. Nothing was broken. It was just in the wrong queue.

The tests that failed for being slow. Many tests have a time limit, for example "this must finish within two seconds", to catch code that hangs. On a quiet machine, that's fine. On a machine running a dozen agents, a perfectly correct test can simply not get enough processor time to finish in two seconds, and fails.

We spent most of a day treating those failures one at a time: re-running checks, making individual tests smaller. Then we asked the obvious question: why are we judging tests by the clock on the wall, when what we care about is how much work they do? That was the real fix, and the moment we should have asked it was the second time the failure appeared. When the same kind of failure appears twice, stop fixing instances and fix whatever is producing them.

What does a governor do?

Our answer is a small orchestrator we call the governor. It runs alongside the agents and does a few simple things.

It knows what matters most. A short, ordered list says which streams of work come first. The batch on its way to being merged is protected: it's never paused.

It limits how much runs at once. Only a handful of other agents may compile at the same time, and fewer while the protected batch is running its final checks. Everything else waits.

It pauses, it doesn't kill. Waiting work is paused mid-flight and resumed exactly where it left off when its turn comes. No work is lost and nothing has to restart.

It's careful about what it pauses. It only pauses work that doesn't watch the clock, such as compilers, linkers and type checkers. It never pauses the agents themselves, or anything talking to a live server, because those would time out or lose their connections.

It re-ranks continuously. Every few seconds, it looks again. When the urgent batch finishes, the next piece of work is promoted and resumed automatically.

Can you pause a test without failing it?

This was the hardest part. Tests are exactly the kind of work you'd like to pause, and exactly the kind that breaks if you do: a test paused for a minute wakes up, sees that a minute has passed, and fails its two-second deadline.

We're addressing that in two ways.

Tests are judged by work, not by waiting. Each test gets a budget of processor time, enforced by the operating system, plus a generous safety limit on the wall clock to catch anything truly stuck. A test that's slow because the machine is busy no longer fails. A test that spins forever still does.

Paused tests don't see the pause. A small library loaded into our test runs adjusts the clocks that tests use for deadlines, so time spent paused by the governor doesn't count. The real time of day stays real. The governor only adds paused time after everything in that test run has stopped, and conservatively, so a test's clock can never jump or run backwards. Tests that talk to real databases and message queues are left alone, because those servers keep real time.

Neither of these makes any test less strict. They just stop a busy machine from being mistaken for a bug.

Isn't this over-engineering?

We're usually the first to argue against building defences for problems that won't happen. These problems did happen: a critical build running at a fraction of its speed, and a day lost to failures that weren't bugs. Measured in waiting engineers and wasted reruns, they were among the most expensive problems we had that week.

And the whole thing is small. The governor is a short script. The clock adjustment is a small library with its own tests, which prove that a paused test fails without it and passes with it.

The broader point is that running agents at scale is an operations problem, not just a coding one. The agents are only as fast as the system around them lets them be.

Six rules for running agents in parallel

1. Know your critical path

At any time, one piece of work is what everyone's waiting for. Make it explicit, and make sure it gets the machine first.

2. Put priorities in the tool, not the instructions

Our 50-minute build happened because an agent copied a launch command from another agent. Agents copy what they see. If priority depends on every agent launching things correctly, one will eventually get it wrong. Enforce it in the orchestrator.

3. Pause, don't kill

Stopping and resuming work loses nothing. Killing and restarting loses everything since the last save, and usually more.

4. Only pause what can be paused

Work with no deadlines (compiling, linking, type checking) can be paused freely. Work with timers, network connections or live servers needs care, or should be left running.

5. Judge tests by work, not by the wall clock

A test that's slow because the machine is busy hasn't failed. Give tests a budget of processor time and keep the wall-clock limit as a generous backstop for real hangs.

6. When something is slow, check how it's running before you blame the code

Before optimising a slow build or test, check its priority, which cores it's on, and what it's competing with. Our slowest build had nothing wrong with it.

What does this mean for your business?

Running lots of AI agents looks like free speed. In practice, once you have more than a few, the bottleneck moves from writing code to the machines it runs on. If your team's spending on AI tools and hardware keeps going up, but releases aren't getting any faster, this is a likely culprit.

The fix is ordinary operations thinking, the same kind any business applies to people and budgets: decide what matters most today, make sure it goes first, and let everything else wait its turn without losing its place. It's a small investment, and it means the release your customers are waiting for never queues behind work that could have waited.

What should your team do first?

  • Look at what's running when your agents are busy. Check how many builds and tests are running at once, and whether the urgent one is getting the machine.

  • Name your critical path for the day, and give it priority explicitly.

  • Find your flakiest tests and check whether they have tight wall-clock limits. Many "flaky" tests are just tests on a busy machine.

  • Cap parallel builds per machine, even crudely, before adding more agents.

FAQ

How many AI coding agents can you run at once? As many as your machine can serve without the important work slowing down. The real limit is processors and memory, not the agents. With orchestration that pauses background work, you can run more agents safely, because the urgent work still gets what it needs.

Why do tests fail randomly when running AI agents in parallel? Often because the machine is overloaded and tests with tight time limits don't get enough processor time to finish. Measuring tests by the processor time they use, instead of wall-clock time, removes most of these failures without making tests less strict.

Does macOS background priority help? It helps keep background work out of the way, but on Apple Silicon it also confines that work to the slower efficiency cores. Use it for genuinely background work only, and make sure your urgent work never inherits it by accident.

Should agents run in the cloud instead? Cloud machines move the problem, they don't remove it. Any shared machine needs someone, or something, to decide what runs first. Running locally has the advantage that you can see and control everything that's running.


We embed engineers who make AI-native engineering work at full speed: the agents, and the system around them. If your team is scaling up its use of coding agents, we're happy to talk.

All articles

Read something that sounds like your problem?

A free 15-minute intro with our CEO. Bring the article, and he’ll tell you which service fits, if any. If a spreadsheet and two rules would do the job, we’ll say so.