Left alone, an agent that keeps failing will try one small variation after another for hours. Each attempt looks like progress from the outside. Three rules break that loop.
After three failed fix attempts on the same problem, the pipeline stops and the coordinator searches the web before any fourth try. It searches the exact error text, the framework and version, and the symptom as an outsider would describe it. Dates matter, because a fix from two releases ago may be the very reason nothing converges.
A long-running agent can also go round in circles where the coordinator can't see it, so each agent has its own rule. A problem rooted in how the framework or operating system behaves gets searched before the first attempt. An ordinary logic bug gets two tries first.
The script that runs interface tests in the virtual machine keeps count of failures for each test. If a test fails twice in a row, the script refuses to run that test again until someone records a diagnosis. The diagnosis comes from a separate agent and says where the fault lies:
The coordinator records the diagnosis, which lifts the refusal, and runs the test again. After two diagnoses that didn't help, that task stops and is reported as unverified. The other tasks carry on.
When the fault was in the test, the lesson gets written down where the next run will find it. Best is a shared test helper that makes the mistake impossible. Next best is a lint rule that catches it. Last is a note in the testing instructions. Without this, every batch pays again for the same mistake.
Every agent that runs builds stops after six builds or about twenty minutes and reports what it has. Its instructions say plainly that hitting this limit is not a failure, otherwise it keeps going to avoid it. Before each build it adds one line to a progress log, so I can watch the work move.