Course contents
Concept · 4 hands-on exercises

Failure Modes and Recovery

Recognize the three failure modes behind most multi-agent pain (doom loops, collisions and context poisoning), see why long runs fail more often than short ones, and build the guardrails in up front.

Three failure modes account for most multi-agent pain: doom loops, collisions and context poisoning. They share one lesson: build the guardrail into how you brief and partition work, rather than reacting run by run. First, one piece of arithmetic that explains why long runs are fragile.

Why long runs fail

An agent task is a chain of steps: read, plan, edit, run, fix. If each step succeeds 95% of the time, a 20-step run succeeds only about 36% of the time, because the failures compound. Checking each step and retrying failures, which is what tests and verifiers do, changes the curve dramatically.

This is why Antigravity puts verification inside the loop rather than at the end: tests in the sandbox, browser checks, and the adversarial verifiers in /swarm all check steps as they happen instead of hoping the whole run holds. The percentages here are illustrative, since real per-step rates vary by task and model, but the compounding is real.

Explore: Why long runs failExercise 1 of 4
1 step200 steps
95.0%per step
36%whole run of 20 steps
64runs that fail, per 100

Move the controls and watch what changes.

Quick checkExercise 2 of 4

Keep 95% per step and 20 steps, then turn on checking with an 80% catch rate. What happens to the whole run?

Doom loops

An agent repeats the same failing step, burning quota without progress. It happens because each attempt is a small variation on the last, and the conversation fills with failed attempts that anchor the agent on the same approach. Notice it early, when the same error shows up a third time, and stop to re-brief with the cause instead of a bare "try again." The twelfth iteration of a failing approach is never better than a sharper brief.

Collisions

Two parallel agents touch the same files, and their branches conflict at merge. The fix is structural, decided before you start: separate worktrees, plus a task split in which no file belongs to two tasks. Watch for the subtler kind too. Two branches can touch different files and still collide in meaning: one renames a function that the other starts calling. Both merge cleanly, and the build breaks. Run the full test suite after merging parallel work, as well as each branch's own tests.

Context poisoning

A wrong "fact" enters the run early, and every later decision inherits it. The source is usually something the agent read: a README that still documents a removed npm run db:reset, an error message it misread, a comment describing code that changed two releases ago. The fix is to audit the trail for the first wrong belief and correct the source, as in the last lesson. A poisoned conversation is often cheaper to restart with a corrected brief than to argue with, because the wrong fact is now part of its context.

Build the guardrails in up front

  • Briefs name the done and the command that checks it, so loops surface fast.
  • Tasks are partitioned by file before any agent starts, so collisions can't happen.
  • Rules and docs stay current, and /learn turns corrections into rules, so poison doesn't recur.
  • Long jobs are split into short, checked tasks, so failures don't compound.
Match them upExercise 3 of 4

Match each symptom to the failure mode behind it.

Pick one on the left, then its partner on the right.

Symptom
Failure mode
0 of 4 matched
You make the callExercise 4 of 4

The two-day refactor

You need to move 30 modules to a new logging library. It touches most of the codebase.

  1. How do you structure the work?

Check your understanding
Q1. What's a doom loop, and what's the right response?
Q2. Why does splitting a long task into short, tested ones raise the overall success rate?
· Work through the 4 remaining exercises above (stuck? each one can show you the answer).
· Score 100% on the quiz.
Vocabulary in this lesson

Plain-English definitions from the AI Coding Dictionary.