<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Agent Debugging on Programmer.ie: Modern AI programming</title>
    <link>http://programmer.ie/tags/agent-debugging/</link>
    <description>Recent content in Agent Debugging on Programmer.ie: Modern AI programming</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Sat, 08 Aug 2026 17:26:00 +0100</lastBuildDate>
    <atom:link href="http://programmer.ie/tags/agent-debugging/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Agents From First Principles 08: AI Agent Picks the First Solution? Add Search Instead of One-Shot Generation</title>
      <link>http://programmer.ie/post/agents-from-first-principles-08/</link>
      <pubDate>Sat, 08 Aug 2026 17:26:00 +0100</pubDate>
      <guid>http://programmer.ie/post/agents-from-first-principles-08/</guid>
      <description>&lt;p&gt;An AI agent often fails for a surprisingly ordinary reason:&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;it commits too early.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;It finds one plausible next action, follows it, and then spends the rest of the run trying to make that first choice work.&lt;/p&gt;&#xA;&lt;p&gt;That can look intelligent because the agent keeps reasoning, calling tools, revising plans, and explaining itself.&lt;/p&gt;&#xA;&lt;p&gt;But underneath, the trajectory may be almost completely determined by an early mistake.&lt;/p&gt;&#xA;&lt;p&gt;A coding agent chooses the wrong implementation strategy and spends twenty tool calls repairing it.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Agents From First Principles 05: AI Agent Gets Stuck in a Loop? Add State, Feedback and Stopping Conditions</title>
      <link>http://programmer.ie/post/agents-from-first-principles-05/</link>
      <pubDate>Sat, 08 Aug 2026 16:56:00 +0100</pubDate>
      <guid>http://programmer.ie/post/agents-from-first-principles-05/</guid>
      <description>&lt;p&gt;An AI agent that keeps calling the same tool, revisiting the same page, rewriting the same file, or repeatedly saying “I’ll try again” is not displaying persistence.&lt;/p&gt;&#xA;&lt;p&gt;It is displaying a control-flow bug.&lt;/p&gt;&#xA;&lt;p&gt;This is one of the most common failure modes in agent software because the basic loop is deceptively simple:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;observe&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  ↓&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;decide&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  ↓&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;act&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  ↓&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;observe&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  ↓&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;repeat&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The problem is hidden inside the final word.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Agents From First Principles 04: AI Agent Fails on Multi-Step Tasks? Separate Planning From Execution</title>
      <link>http://programmer.ie/post/agents-from-first-principles-04/</link>
      <pubDate>Sat, 08 Aug 2026 16:35:00 +0100</pubDate>
      <guid>http://programmer.ie/post/agents-from-first-principles-04/</guid>
      <description>&lt;p&gt;A surprising number of agent failures are not really model failures.&lt;/p&gt;&#xA;&lt;p&gt;The model may be perfectly capable of writing each individual step. The failure happens because the system tries to decide &lt;strong&gt;what to do&lt;/strong&gt; and &lt;strong&gt;do it&lt;/strong&gt; at the same time.&lt;/p&gt;&#xA;&lt;p&gt;That works for simple tasks:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;question&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  ↓&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;model&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  ↓&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;answer&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It becomes fragile when success depends on several ordered actions:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;goal&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  ↓&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;step 1&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  ↓&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;step 2&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  ↓&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;step 3&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  ↓&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;verification&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;A useful next step in agent design is therefore to separate two jobs:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Agents From First Principles 03: AI Agent Keeps Making the Same Mistake? Add a Critique-and-Revision Loop</title>
      <link>http://programmer.ie/post/agents-from-first-principles-03/</link>
      <pubDate>Sat, 08 Aug 2026 16:23:00 +0100</pubDate>
      <guid>http://programmer.ie/post/agents-from-first-principles-03/</guid>
      <description>&lt;p&gt;An AI agent can fail in a particularly frustrating way: it produces an answer that is almost right, you ask it to improve the answer, and it produces another answer with the same underlying defect.&lt;/p&gt;&#xA;&lt;p&gt;Sometimes the wording changes. Sometimes it adds more explanation. Sometimes it becomes longer and more confident. But the important mistake survives.&lt;/p&gt;&#xA;&lt;p&gt;That usually means the system is doing this:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;prompt&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  ↓&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;model&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  ↓&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;answer&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;or this:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Agents From First Principles 02: AI Agent Gives Inconsistent Answers? Generate Multiple Candidates and Rank Them</title>
      <link>http://programmer.ie/post/agents-from-first-principles-02/</link>
      <pubDate>Sat, 08 Aug 2026 15:54:00 +0100</pubDate>
      <guid>http://programmer.ie/post/agents-from-first-principles-02/</guid>
      <description>&lt;p&gt;One of the first things you notice when you build anything around a large language model is that the same prompt does not always produce the same quality of answer.&lt;/p&gt;&#xA;&lt;p&gt;Sometimes the first response is excellent.&lt;/p&gt;&#xA;&lt;p&gt;Sometimes it is merely acceptable.&lt;/p&gt;&#xA;&lt;p&gt;Sometimes it misses the point entirely.&lt;/p&gt;&#xA;&lt;p&gt;That creates a very common agent-engineering question:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;If the model is inconsistent, should the agent trust the first answer it gets?&lt;/p&gt;&lt;/blockquote&gt;&#xA;&lt;p&gt;Often, no.&lt;/p&gt;</description>
    </item>
    <item>
      <title>AI Agent Returning Invalid Tool Calls? How to Validate LLM Actions</title>
      <link>http://programmer.ie/post/agents-from-first-principles-01/</link>
      <pubDate>Sat, 08 Aug 2026 15:46:00 +0100</pubDate>
      <guid>http://programmer.ie/post/agents-from-first-principles-01/</guid>
      <description>&lt;p&gt;If your agent sometimes invents a tool name, omits a required argument, returns malformed JSON, or produces an action that looks plausible but cannot actually be executed, the problem is usually not &amp;ldquo;the agent is dumb.&amp;rdquo;&lt;/p&gt;&#xA;&lt;p&gt;The problem is that &lt;strong&gt;raw language-model output has been allowed to cross directly into execution&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;That boundary is too weak.&lt;/p&gt;&#xA;&lt;p&gt;The simplest useful agent architecture is not:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;prompt&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  ↓&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;model&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  ↓&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;execute whatever came back&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It is:&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
