My Agent Burned Fifty Steps and Real Money Going Nowhere
I was watching the trace scroll past. At step thirty-one, my agent called an exchange-rate tool for 30 February, got back “invalid date,” and reasoned that the error was probably transient and worth retrying. At step thirty-two it made the identical call, got the identical error, and concluded the failure was persistent and should be confirmed with one more attempt. Each step came with a calm, well-structured paragraph explaining why the next try would work. I killed it at step fifty and went to look at the bill. That was my introduction to agents, and it taught me the central fact of the field in one evening: a model that can act is a model that can be confidently, expensively and tirelessly wrong.
A loop, and everything that follows from it
The idea behind an agent is almost disappointingly small. An ordinary language model application is a function: input goes in and output comes out. An agent is a loop. The model reasons about its goal, picks an action, the action runs, the result is fed back in, and the cycle repeats until something tells it to stop. Every hard problem in this area comes from that loop. The first pattern I studied seriously was ReAct, which interleaves short bursts of reasoning with actions. I liked it because it makes the loop readable, and because the reasoning measurably improves which action gets chosen. It isn’t decoration.
The mechanics hinge on tool calling. You describe your functions with typed schemas, the model emits a structured call, your code runs it, and you hand back the result. What surprised me was where the quality came from. Most of an agent’s competence lives in the design of its tools, not in the model. A vague description makes the model call a tool for everything or for nothing. Two overlapping tools make it choose between them more or less at random. Eight optional parameters produce malformed calls. My February-the-thirtieth loop existed because the tool accepted an impossible date instead of rejecting it with a useful error. I ended up spending more time rewriting tool descriptions than prompts, and got more out of it. The case nobody benchmarks loudly is whether the model can tell that no tool applies at all, and simply answer. Mine often couldn’t.
Why it’s harder than it looks
Errors compound across steps in a way that’s easy to state and hard to feel until it happens. If each step is right ninety-five percent of the time, a ten-step task succeeds about sixty percent of the time, and at twenty steps you’re closer to a third. Worse, the model reasons impeccably on top of a bad earlier result, so the step that visibly fails is almost never the step that went wrong. I lost an afternoon debugging step four of a run whose real mistake was at step one. Agents also have no instinctive sense of when to stop. They repeat failed actions, orbit between two states, or declare success halfway through. Hard step budgets and loop detection, where the same action with the same arguments twice in a row ends the run, stopped feeling optional the moment I saw that bill.
Debugging turned into archaeology without a shovel. With a single prompt you inspect the input and output. With fifteen steps you need every step’s reasoning, tool call, arguments, result, latency and cost, or you’re guessing. So I started writing a structured record of every step, which is the direct answer to what I wrote in April about needing to see the middle of a system instead of just its ends. I’ve already decided this is the most valuable habit I’ve formed this year.
The argument hiding in the literature
This is where three years of reading papers badly finally paid off properly. Most people I see building agents assume, reasonably, that a model can catch its own mistakes if you ask it to check its work. The literature is quietly having a fierce argument about whether that’s true. One group of papers, including Self-Refine, Reflexion, Self-Debug, CRITIC and Chain-of-Verification, shows models improving their outputs by critiquing and revising them. Another group looks harder. Huang and colleagues’ ICLR 2024 paper is the sharpest: on reasoning tasks, once the model is no longer secretly told whether its answer was right, asking it to review its own work fails to help and often makes things worse. Models talk themselves out of correct answers.
Kamoi and colleagues’ survey explains why, and their explanation reorganised how I think about everything I’ve built. Nearly every real success relied on feedback from outside the model, such as code execution results, tool outputs or retrieved documents. And self-checking can only work when verifying an answer is actually easier than producing it in the first place. That was the pattern I’d noticed in April without being able to name it. A model critiquing itself with no new information is grading its own homework with the same blind spots it had while writing it. A model reading a compiler error is being told something it didn’t know. I’m now calling these intrinsic and extrinsic feedback, and I suspect the distinction organises the whole subfield. I can’t prove that yet, but I’ve started writing notes as if it does.
Frameworks, and a reason to be boring
I worked through the main framework styles this term: explicit state graphs, where you draw the flow and the model fills in steps; multi-agent conversations, where agents message each other until they finish; and code-as-action, where the agent writes small Python programs that combine several tools at once. That last one impressed me most, because a program is a far richer action than a single function call. But the lesson that mattered more than any framework is that they differ mainly in how much control over the flow they hand to the model. The real design question is how much you trust the model to decide what happens next. Uncomfortably often my answer was “not much,” which pointed toward mostly deterministic pipelines with the model confined to the steps that truly need language understanding. A lot of agentic systems would be better off being boring.
I also built the fashionable multi-agent setup, a planner with an executor and a writer with a critic, and watched them ignore each other’s constraints, approve each other’s mistakes, and lose crucial information in handoffs. Plain-language messages between agents are a lossy and unenforced interface, and every extra agent adds another place for things to leak.
My internship starts next week, the first time I’ll write code other people depend on. Everything I know about reliability I learned by breaking my own projects, and I’m curious how much of it survives contact with a real engineering team.
Leave a Reply