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.

  • The findings go to a coder word for word, with sources, along with what the three rounds already tried. The coordinator never applies a fix itself, and it is most tempted to just after reading a promising answer.
  • If the research shows the plan was wrong, the task goes back to the planner and judge.
  • This happens once per problem. If the attempt that uses the research also fails, the task stops and comes to me with the findings attached.
  • Finding nothing is reported as a result. A search that reports nothing can't be told apart from a search that never happened.

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.

Two identical failures, then diagnose

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 test was written wrong, so fix the test;
  • the app really is broken, so it goes back to the coder;
  • the setup (the virtual machine, the tools) is at fault, so fix that.

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.

Bounded stretches

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.

Loading SilverBullet…