AI in practice from Performance Metrics

From the engine room #7: When something goes wrong

Written by Thomas Petersen | Nov 23, 2026, 2:15:00 PM

Things go wrong. A task gets stuck on something the gate can't solve. An environment is down. A decision has not been made. And sometimes it is the runner itself that goes down at 3:00 in the morning. This part is about the two levels: work that is blocked, and the runner, which has to be kept running. And about a mechanism that worked, and which I deleted on 18 November anyway.

A month of blocks

From the end of August to the end of September we counted blocks. There were about 70 tasks and stories and 23 epics that were blocked. Of 65 releases, a human was responsible for 39, typically 6 to 11 hours later, because the block came at night. The runner's own sessions were responsible for 17, typically in about 5 minutes. All 23 epics were resumed by hand.

The distribution of causes was an estimate, but clear: about 40% were faults in the runner or the gates, 30% the environment, 15% real product decisions and 10% a story that was not finished enough. Most of what was waiting for me did not require me. Waiting is a cost too. The share of blocked tasks is one of the numbers the retrospective measures every time, and on 8 November it was 3.5%.

The blocked lane

Since October a block has its own path through the runner. First it is classified: is it an environment that is down, a test that fails, a decision that is missing, or a fault in the runner? The class gives a route.

  • Fix it yourself. A session gets the block and has to fix it. At most two attempts per block and class.
  • Decide. If that does not work, a new session is told to choose the solution it recommends itself, and carry it out.
  • Wait for the environment. If the cause is external, the runner waits for a probe. It tries again after 5, 10, 20, 40 and 60 minutes and then every hour, without limit. I am notified after four hours. When the probe turns green, everything that was waiting for it is released at once.
  • Triage. If none of that gets through, the block goes on to a human.

A session never releases anything itself. The runner measures whether the solution works: the gate, a clean worktree or a green probe. Only then does it release the work.

There is a closed list of areas where a decision is more serious: access and identity, data that cannot be recreated, external costs and changes to a tenant, contract documents and the gates themselves. At first a decision there had to wait for a card to me. Since 14 October it is only flagged. The decision is made, written down with guidance on how to roll it back, and the work is released. I wrote it myself in the design: as long as the runner solves the problem without my approval, that is the whole point.

Since 14 October the lane has released 173 blocks. 113 went through a decision, 42 were resolved directly, and 7 were released by a probe. 7 were faults in the runner, where a session repaired the state without touching the runner's code. The last 4 were epics waiting for a blocked story, which the runner resumed once the story was resolved. What a human releases is not in that count. In all, 130 decisions have been written down, and 58 of them hit the closed list.

In the example

Around access per data type there were five blocks. Four were resolved by the lane in between 4 and 8 minutes:

  • The story review found two incorrect statements in a document and a code comment. The lane corrected them and chose to keep the existing path through the code. 5 minutes.
  • A test compared all profile names with an old migration that cannot be changed, and went red when 28 new names were added. The fix: compare only with names that are older than the migration. 4 minutes.
  • A story was missing one line in the UI's overview of areas. The review had been approved, because no validation plan ran the UI tests. It was reported as a fault in the runner. 5 minutes, and the epic that was waiting resumed itself the minute after.
  • In a story in a neighbouring group a decision had to be made: should whoever may read licences also be able to read groups, so the tab can show which group a licence comes from? The lane decided yes, described what that means, and wrote it into the design document as an AMENDED with a date. It hit the closed list and was released anyway. 8 minutes.

The fifth took 1 hour and 50 minutes, because it was waiting for me. A test user in the shared development database had three connections whose origin nobody knew. The session refused to delete data it had not put in itself. That was right of it. I ran an updated seed, and the task moved on.

Who owns the row in the dev database?

The fifth block is a problem we had seen before. On 15 October an operator wrote a connection by hand in the shared development database, because one story needed it. The story was finished at 19:55. At 20:19 another story blocked on exactly that connection.

A Claude session solved it in three mechanical steps: recognise the cause, check that nothing that is running needs it, and remove it. My reaction was: if you can do it, the runner must be able to as well. The same day it became a design. Shared state that a story changes is described in a claim: a file with the owner, the command that removes it, and how it is recognised. When the owner is finished, the runner cleans up. And nothing in the design lets the runner delete state that no claim describes. The same evening the blocked story was released by its claim.

That a session must create a claim before it changes shared state is today only stated in the design document and in the command's help text, not even in the contract the sessions read. It is text, and that has to be said out loud (#10). The test user from November is an example of what happens when it is not done.

When the agents find faults in the runner

The sessions run into the runner's faults every day. Before, they ended up as prose in a log that nobody read. Since 29 October every log from the blocked lane has a section called Runner feedback, and the content is collected in a queue. The agents that run in Teams can also report faults there. An entry is only closed when a commit that refers to it is in the version of the runner that is running.

The queue has 86 entries. 56 are closed, and 30 are open. 74 came from the blocked lane's logs. The sessions may report faults in the runner. They may not fix it (#9).

The supervisor

When the runner itself goes down, there is no runner to solve it. Before the supervisor, the answer was me when I woke up, and the loop stood still from the crash until I discovered it.

The supervisor is an outer loop. It has no project reference to the runner and talks to it through files and snapshots, so a fault in the runner does not take it down too. The runner writes a heartbeat from a separate thread with the operation it is in the middle of. If it is more than two minutes old, the runner has hung, and the supervisor stops the loop. The operation that was in the heartbeat becomes the signature that all later work counts against. If the heartbeat is fresh, but nothing has moved in two hours, it is a different kind of fault, and it is investigated, not killed. After a crash the supervisor waits before it starts the loop again, and longer each time: from ten seconds up to ten minutes. If the loop crashes with the same signature three times in half an hour, it is a crash loop, and then the supervisor does not start it again. If the runner has just switched to a new snapshot, it rolls back to the previous one. Otherwise the loop stands still in safe mode while the cause is found.

On top of that sits a ladder. The first rung is deterministic: restart, repair of state and rollback to the previous snapshot if a new one crashes. The second rung is triage: a session gets crash data, logs and the code and has a quarter of an hour to find the cause without changing anything.

Heal: autonomous, and then deleted

The third rung was called heal. If the cause was a fault in the runner's code, a session got 45 minutes to fix it on a branch and write a test that reproduced the fault. It did not run its gates itself. The supervisor did: only the runner's code could be touched, not the supervisor, not the approved prompts and not the budgets. At most 300 lines of production code. The test had to be red on the old code and green on the new. The whole runner had to build and be green, and the new snapshot had to pass a canary run, a trial run of it. At most two attempts per fault and three merges a day.

In September I decided that heal could only make a branch, which I merged. Three weeks later I reversed it. A heal that waits for me at 3:00 waits until 8:00. From 14 October the supervisor itself merged a heal that passed the gates.

Six heals were merged, all of them before 8:00 in the morning. The first was a trial of the whole idea: a session deliberately put a crash into the runner. The loop crashed three times in one minute, triage found the commit that had put the crash in, and heal removed it. The PR was merged at 1:34, without a human. One heal was rolled back 20 minutes after merge. It was not the heal that was wrong, but the product repo, which had broken that same morning, so the new snapshot's canary run failed. That same morning publishing got one more rule: if the new version's canary run fails, the current version's is run too. If that fails as well, the fault is in the target, not in the new code.

On 5 November I decided that changes to the runner must go through the runner-feedback queue and not be fixed by a session on its own. That was a decision and an instruction. Heal kept running. On 13 November a heal merged and published a fix on its own. On 18 November another heal pushed a branch alongside the queue's own fix of the same fault. The same afternoon I deleted heal: the session, its gates, its merge and its contract, 2,575 lines. A fault in the runner's code now goes to the queue and waits in triage.

It is the best illustration the series has of the rule in #10. My decision on 5 November was text. It was enforced on the 18th, when the code disappeared.

What is left of the supervisor does not change code. Restart, repair, canary runs and rollback are deterministic. Triage is still a session, but it only finds the cause and reports it to the queue.

The decision

Most of what goes wrong does not require a human. It requires a classification, an attempt, a decision written down and a measurement of whether it worked. The runner can do that in minutes, where I spent hours. What requires me is what nobody else owns: data nobody can explain, and decisions about what the runner itself may do.

Autonomy is not a principle. It is a tool that must be possible to switch off, and it is switched off by code, not by an instruction.

The next part is about the tools the gates and the work orders build on (#8).

Numbers as of 19 November 2026.

—
The code is written by AI. So is the text. The decisions are mine.