Your AI agent apologizes, then does the same thing again. Here's the mechanism

by

The most recognizable failure in agent-assisted coding: the agent tries a fix, hits an error, apologizes with real conviction, and produces the same fix with the variable names shuffled. The apology is what makes it maddening. It saw the failure. It acknowledged the failure. Attempt five is already running.

The explanation isn't that the model is dumb. It's that the model is stateless: every turn, it re-reads the entire session transcript, and that transcript is the whole world it can see. Count what's in that world after four failed attempts. The dominant pattern, by sheer volume, is the failed attempt itself. A human reads that history as mounting evidence to change course. A next-token predictor reads it as what this session does. The history doesn't fence off the bad path — it paves it. Even the apology deepens the groove, because apologize-then-retry is a pattern it has seen thousands of times and is faithfully continuing.

There's research that caught this on camera: in one trajectory study of coding agents, failed runs had located the correct file 72 to 81 percent of the time. Finding the right place was never the problem. Letting go of the hypothesis was.

The practical fixes live outside the prompt. A hard budget on turns or tokens, so a stuck run stops instead of politely burning money. A repetition tripwire: if a new attempt looks like the last one, force the agent to list hypotheses it hasn't tested, so the untried paths exist in the transcript and can compete. And the one the vendor manuals themselves recommend: clear the window. The fresh session isn't smarter. It just starts without the gravity, and the constraints you learned travel forward weighing a few dozen tokens instead of four failed attempts.

Sterner prompts don't fix structure. Circuit breakers do.

14 views

Add a comment

Replies

Best

Why do people write these useless posts?

"Water is wet"