Dev.to AI 🤖 Ai 👁 0 📖 7 min read

We Ran Seven Coding Agents in Parallel. Then We Went Back to One.

Between October 26 and November 4 our main branch took 1,283 commits, and 129 of them were merges. Between November 5 and November 15 it took 269 commits. Zero merges. That second number is not a slump. It is the result

Between October 26 and November 4 our main branch took 1,283 commits, and 129 of them were merges. Between November 5 and November 15 it took 269 commits. Zero merges.

That second number is not a slump. It is the result of a decision I did not want to make, and that I now think was right.

I build Since, which tracks the packages, AI models, APIs and runtimes your code depends on and opens the fix pull request when one of them changes. Most of the code is written by coding agents, with me planning, reviewing and arguing with them. For a while we ran a lot of them at once. This is what happened.

1. The setup looked like good engineering

We were rebuilding a big part of the product in late October. The plan was split into streams, and each stream got everything a careful team would give it:

  • its own worktree and its own branch
  • its own test database, so tests never fought over state
  • a written spec, with "rules for every builder" that all streams shared
  • file lanes: which files each stream was allowed to touch
  • a build, then an independent review whose findings needed a concrete failure scenario, then a fix round
  • an integrator that merged each stream into the main line with the full test suite

On paper this is how you scale. Seven people can't share one keyboard, so you give them seven keyboards and a merge process. The last full run we recorded in that period, on October 27, had 5,739 unit tests and 1,717 database tests green.

2. The first launch lasted ten minutes

On October 26 I launched seven streams in parallel. Ten minutes later I stopped all of them.

An independent reviewer, reading the plan and the code without building anything, found three things:

  1. Functions living in files the plan had given to other streams. Two agents were about to edit the same code from different lanes, each sure it owned it.
  2. Two answers I had given that touched code nobody owned. The decisions existed. No stream was going to carry them out.
  3. Two streams appending to the same schema block.

None of that is exotic. It is what a plan looks like when the code does not divide along the lines you drew on it. The lesson we wrote down was modest: have a read-only critic check a parallel plan before the streams start, not alongside them. It costs about fifteen minutes.

We took the wrong lesson from it. We thought the problem was the plan. So we made better plans and kept going in parallel.

3. The findings kept coming

What followed was rounds. Build in streams, test the whole thing, collect findings, split the findings into streams, fix in parallel, merge, test again.

By October 28 we had run four QA rounds with about 160 findings between them. Each fix round added something: a new mechanism to cover one finding, a carrier for another, a special path for a third. And the next round found new bugs in exactly those additions.

One retest that day ended with 58 findings, 15 of them high. Fourteen were already fixed by merges that landed while the test was still running. The other 42 went to six streams, and all six merged within nine minutes of each other.

Read that again, because none of us did at the time. Six parallel fixes to one codebase, merged in nine minutes. Nobody, human or agent, read those six together before they were one.

The next day it happened in miniature. Five parallel fix lanes plus an integration merge. The lanes each passed. The bugs were in between them, and they only showed up at the merge. There is literally a commit that day called "QA fix round, integrated: the cross-lane items at their mechanisms". A whole commit just for the bugs that belonged to no lane.

4. The sentence that ended it

The pushback was mine, and it took me two tries to say it properly.

On October 28, after the fourth round, I told my agent: "we keep adding fixes on top of fixes without going to the core of the issue and getting a diagnostic review."

On November 3 it came back with a plan for the next fixes in parallel lanes, and I said it more plainly: "I don't want parallel building because it's just not accurate enough... The build should be sequential."

The phrase I keep coming back to is "not accurate enough". Not slow. Not expensive. Not hard to follow. Inaccurate. Parallel streams were producing code that was locally right and globally wrong, and our process was very good at confirming the "locally right" part.

5. What one at a time looks like

From November 5 the rule is short. A plan's steps run in order, in the session that planned them, on main:

  1. Build one step.
  2. Run its tests.
  3. Commit.
  4. Start the next one.

No builder streams. No worktrees for builds. No merges. Research still fans out: reading code, reading docs, checking a provider's page, anything that changes nothing. Only building is serial.

Oct 26 to Nov 4 Nov 5 to Nov 15
Commits on main 1,283 269
Merge commits 129 0

(Both rows from git log on main, read Nov 16.)

The first row looks like a productivity collapse. It isn't, for two reasons.

The first is what the commits were. A big share of the first period was the rebuild itself, plus stream merges, plus integration fixes, plus fixes for the integration fixes. The second period is mostly one change, its tests, and the next change.

The second is where the bugs live now. With one step at a time, a bug is either in the step you just made or it was already there. You are never debugging the interaction of six changes nobody has read together.

6. What it didn't fix

I would like to say serial work made everything accurate. It didn't, and two things from the same week are worth telling.

The pipe that lied. On November 5, the very day the rule started, a commit went in with a failing test. The test command was piped into grep, and the shell reported grep's exit status, not the test runner's. Grep found its line, said zero, and the commit went in. Going one step at a time does nothing for you if "the tests passed" is itself wrong. The rule now: send the runner's output to a file, read the runner's own exit code, commit only on zero.

The shared checkout. On November 4 a throwaway command meant to test a rule ran a real git stash in the main checkout. It shelved every uncommitted change there, including other sessions' work. It was popped within a minute and nothing was lost, but it showed that "one branch, one place" has its own failure mode: the place is shared. We now never run a command that changes git state there except the ones a task needs.

Parallelism also bit us where nobody was writing features at all. Two integration test runs at once shared one test database, pushed the schema at the same time and blocked each other's transactions. On November 3 that gave us 11 timeouts and a broken test recording in one afternoon. The fix was not clever: one integration run at a time.

7. Why I think parallel failed us specifically

Parallel development works for big human teams. I think it works there because the parallelism is wrapped in a lot of slow, boring context: people read each other's pull requests, sit in the same standup, remember why a function exists, notice when a teammate is in "their" file.

Agent streams had the structure without the context. Each one had a perfect view of its own spec and no view of the others. The review at the end of each stream was good at its own stream, which was exactly the problem. And the merge was fast, which felt like a feature and was a bug.

So the thing that broke was not the agents' code. It was the assumption that a plan can split a codebase into lanes that don't touch. Ours couldn't. Most can't, at least not in the places that matter, which are the shared ones.

When this is the wrong call

Serial is not always right, and I don't want to pretend it is.

  • Read-only work should fan out. Searching, reading docs, checking ten provider pages, reviewing a plan. Nothing to merge, nothing to conflict.
  • Truly separate code can go in parallel. Two repositories, or two parts with no shared files, types or schema. If you can't name a single shared file, you may genuinely have two projects.
  • A deadline can justify it, as long as you budget for the merge. The merge is where the work is. If your plan gives it nine minutes, the plan is wrong.

What I'd tell myself on October 26: when a parallel plan fails in ten minutes, don't write a better plan. Ask whether the work can be split at all.

What's the worst bug you've found that lived in the gap between two changes that each passed on their own?

I'm Nabil. I build Since, which tracks what your code depends on and tells you before it breaks.

📰 Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.