What Broke When I Let 26 AI Agents Run a Website
Most writing about AI agents stops at the demo. An agent opens a browser, fills a form, writes a function, and everyone claps. Nobody shows what happens on day nine, at 3 a.m., when four agents have touched the same file
Most writing about AI agents stops at the demo. An agent opens a browser, fills a form, writes a function, and everyone claps. Nobody shows what happens on day nine, at 3 a.m., when four agents have touched the same file and the main branch is red.
For the last three weeks I have run a real website this way. It is an events calendar for Bali with 13,000+ generated pages in 10 languages. Twenty-six AI agents do almost all of the work on it: they collect and clean data, write guides, translate, fix broken pages, check search performance and report every morning. Since mid-November they have produced 404 merged branches. Since November 22, when I started logging refusals, the merge gate has refused all or part of 87 branches.
The rejections taught me more than the merges. Here is what actually went wrong, and the plain rules that fixed it.
The setup, in one paragraph
Each agent is a role with its own written brief: content writer, translator, fixer, link checker, coordinator and so on. A scheduler starts each one once or twice a day, heavy code and content work at night, lighter analysis during the day. Every run has a hard time limit (45 to 60 minutes) and a hard budget (3 to 4 dollars). Each agent works in its own copy of the repository, using git worktrees, on its own branch. It never touches the live site. A separate merge script decides what reaches the main branch.
None of this is exotic. It follows the advice in Anthropic's guide on building effective agents: start with simple, composable pieces and add complexity only when it earns its place. The trouble started anyway.
Failure 1: agents editing the same files
The biggest single cause, 64 of the refusals logged since November 22, was one boring reason: a merge conflict that an automatic rebase could not resolve.
Agents do not know about each other. A fixer sees a failing test and repairs it. Two hours later a second fixer run sees the same failing test (because the first fix has not been merged yet) and repairs it again, differently. The content agent and the translator both edit the same guide. A growth report gets rewritten by three runs in one day. In one ten-day stretch a single agent hit 22 conflicts, mostly in a handful of shared test and data files.
Humans handle this with a quick message in a team chat. Agents need it spelled out. What fixed most of it:
- Check history before editing. Every brief now says: before changing a file, read its recent history on the main branch. If another run already fixed it, rebase instead of writing a second fix.
- Owners for dangerous files. Some files (robots rules, the sitemap, the build config) can be changed by exactly one agent. If any other agent touches them, the merge script drops those files from the branch and keeps the rest. Related rules keep translation files, tests and other agents' briefs out of reach of roles that should not edit them. Together these boundaries trimmed 16 branches. Not every trim was right: four times the rule blocked a harmless research note simply because its file name contained the word "sitemap" or "robots". Matching on words instead of exact paths is the next thing to fix.
- A shared message board. When an agent closes a problem, it writes one line saying so. The next agent reads the board before it starts.
The lesson is old. Martin Fowler's essay on continuous integration says to integrate often because the cost of a conflict grows with the time two people work apart. Agents are not exempt. They just produce conflicts faster.
Failure 2: the gate that guards the gate
The merge script is the most important piece of the system. Every branch has to pass gates before it reaches the main branch: a full site build, the test suite, a check for broken internal links and limits on file size. Branches that change only notes and reports go through a lighter gate, tests only, because a full build of 13,000+ pages takes a long time.
The gate itself broke twice.
On November 21 a build from an earlier gate run did not stop when it timed out. It kept writing into the same output folder while the next gate started its own build. Two full builds of the site were running at once in one folder, and a gate result could no longer be trusted. The fix was a machine-wide slot: only one full build can run at a time, anywhere on the computer, and a timed-out build gets killed along with every process it started.
On November 22 the coordinator agent raised an alarm that the main branch was broken. It was not. Several tests read the built site, and in a fresh worktree there was no built site yet. Those tests failed instead of skipping themselves when their input was missing. One decorator per test fixed it. Then I added a rule to the coordinator's brief: before escalating a red build to a human, check whether the failure is real or just a test with nothing to read.
Both bugs were in plain Python, not in the models. That is the pattern I see most often. The model does roughly what you asked. The scaffolding around it is where things quietly go wrong.
Failure 3: silent, expensive nothing
The worst failures did not crash anything. They just used money and produced nothing.
On November 19 and 20 the coordinator ran for long sessions, costing about 20 cents each, and merged zero branches, because the main branch was red and it had no instruction for that case. Its daily plan file sat a full day out of date because nothing told it to refresh the plan when it decided to skip. On November 18 one run failed before it started, with an "exec format error" from the command-line tool that launches the agent. From the outside, all three looked like "the agent ran."
Three changes helped:
- Every run must leave a trace. Each run writes a log entry, and a run that decides to do nothing has to write one line saying why. Silence should look different from "nothing to do."
- A morning report with numbers, not adjectives. How many runs, how many merges, how many rejections and the reason for each. A human reads it in two minutes.
- Budgets per run, not per month. A per-run cap turns a runaway loop into a small, visible cost instead of a surprise invoice.
Failure 4: an agent that never learns
In the first week, the same mistakes repeated across runs. An agent would be rejected for touching the sitemap, then try again the next night.
Now every rejection writes a lesson. When the merge script refuses a branch, it appends a short note to that agent's lessons file: what was refused, which files, why and what to do next time. The agent reads its own lessons file before it starts. Over three weeks those files grew to about 480 lines across all roles. Refusals fell from 35 on the worst day in late November to one to three a day since December 2, while merges continued at about twenty a day.
This is the blameless postmortem idea from Google's SRE book, applied to software that cannot remember yesterday. The rule that mattered most was keeping lessons short and specific: a date, a file name, one sentence. Long, general lessons get ignored by models just as they get ignored by people.
Failure 5: content that passes tests but should not ship
A green build does not mean a good page. Agents can produce thousands of pages that are technically valid and almost useless. Google's spam policies are clear about scaled content made mainly to rank, whoever or whatever writes it.
So content gates check more than syntax. Guides must meet minimum lengths and use real data from the events database. Numbers must come from the latest data export, never from the model's memory. Page types that cannot be backed by real data are not built at all. The link checker confirms that every new page is reachable. A run in mid-November checked every generated page and found zero orphans and zero broken links. That check now runs on every heavy merge.
What I would tell a team starting today
- Isolate every agent. Own branch, own working copy, no write access to production. Merging is a separate step with its own rules.
- Make the gate boring and strict. Build, tests, link check, file limits. Then test the gate itself, because it will break.
- Give files owners. A few critical files should have exactly one agent allowed to change them.
- Cap every run in time and money. Per run, not per month.
- Turn every rejection into a written lesson the agent reads next time. Keep each lesson to one sentence.
- Read the daily numbers. Merges, rejections, reasons. Two minutes a day catches most problems before users do.
Most of the work in a multi-agent system is not prompt engineering. It is the same discipline teams have used for years: small changes, a strict gate, clear ownership, honest postmortems. The agents just make skipping that discipline more expensive, and much faster.
Originally published at iishnik.com. About this article: I build with AI coding agents (Claude Code). This article was drafted with AI assistance and reviewed by me; the numbers come from my own merge-gate logs.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.