<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Posts on Loop &amp; Retry</title>
    <link>https://loopandretry.github.io/posts/</link>
    <description>Recent content in Posts on Loop &amp; Retry</description>
    <image>
      <title>Loop &amp; Retry</title>
      <url>https://loopandretry.github.io/images/og-default.png</url>
      <link>https://loopandretry.github.io/images/og-default.png</link>
    </image>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Thu, 16 Jul 2026 09:00:00 -0400</lastBuildDate>
    <atom:link href="https://loopandretry.github.io/posts/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Streaming tool calls without losing your mind</title>
      <link>https://loopandretry.github.io/posts/streaming-tool-calls-without-losing-your-mind/</link>
      <pubDate>Thu, 16 Jul 2026 09:00:00 -0400</pubDate>
      <guid>https://loopandretry.github.io/posts/streaming-tool-calls-without-losing-your-mind/</guid>
      <description>Streaming a text response is easy: print tokens as they arrive, order doesn&amp;rsquo;t matter to the reader. Streaming a tool call is not, because the payload is JSON, and partial JSON is not valid JSON. The three ways people handle that mismatch, why two of them break in production, and the pattern that lets you show progress without ever executing on a half-formed argument.</description>
    </item>
    <item>
      <title>Retry budgets by language: Python, Go, and JavaScript</title>
      <link>https://loopandretry.github.io/posts/retry-budgets-by-language/</link>
      <pubDate>Wed, 15 Jul 2026 09:00:00 -0400</pubDate>
      <guid>https://loopandretry.github.io/posts/retry-budgets-by-language/</guid>
      <description>A retry budget is a language-agnostic idea, but the place you enforce it is not. Python&amp;rsquo;s tenacity decorators, Go&amp;rsquo;s context-plus-backoff, and JavaScript&amp;rsquo;s promise chains each make a different mistake easy and a different guarantee hard. Where the shared budget lives, and the per-language trap that leaks it.</description>
    </item>
    <item>
      <title>Debugging a failed agent run costs more than the run itself</title>
      <link>https://loopandretry.github.io/posts/debugging-a-failed-run-costs-more/</link>
      <pubDate>Tue, 14 Jul 2026 13:00:00 -0400</pubDate>
      <guid>https://loopandretry.github.io/posts/debugging-a-failed-run-costs-more/</guid>
      <description>The cheap part of a failed agent run is running it again. The expensive part is that you can&amp;rsquo;t — the failure was non-deterministic, so the run that broke is gone, and you pay to summon it back. A cost model shows why reproduction, not repair, dominates your debugging bill, and why always-on tracing is almost always cheaper than the alternative it replaces.</description>
    </item>
    <item>
      <title>Predicting agent failure before you ship it</title>
      <link>https://loopandretry.github.io/posts/predicting-agent-failure-before-release/</link>
      <pubDate>Tue, 14 Jul 2026 05:02:00 -0400</pubDate>
      <guid>https://loopandretry.github.io/posts/predicting-agent-failure-before-release/</guid>
      <description>A demo proves an agent can succeed once. It says almost nothing about how often it will fail under real load, real input distributions, and real adversarial garbage. The failures that cost you in production are predictable before release — but only if you test the things that actually shift between the demo and the deployment. Four pre-release signals that forecast production failure, and the ones that don&amp;rsquo;t.</description>
    </item>
    <item>
      <title>One bad step, N bad steps: how agent failures cascade</title>
      <link>https://loopandretry.github.io/posts/how-agent-failures-cascade/</link>
      <pubDate>Tue, 14 Jul 2026 05:01:00 -0400</pubDate>
      <guid>https://loopandretry.github.io/posts/how-agent-failures-cascade/</guid>
      <description>A single agent error rarely stays a single error. The bad output goes into the context, the next step reasons on top of it, and the mistake compounds down the trajectory — one wrong step becoming N wrong steps. This is the cascade, why it&amp;rsquo;s structurally different from a fleet-wide blast radius, and the three interruption points that stop a local mistake from eating the whole run.</description>
    </item>
    <item>
      <title>Your token bill is the cheap part: dimensioning the real cost of an agent</title>
      <link>https://loopandretry.github.io/posts/cost-beyond-tokens/</link>
      <pubDate>Tue, 14 Jul 2026 05:00:00 -0400</pubDate>
      <guid>https://loopandretry.github.io/posts/cost-beyond-tokens/</guid>
      <description>Everyone budgets the token bill because the provider hands you an invoice for it. But an agent in production spends across five other axes that never show up on that invoice — wall-clock latency, orchestration, tool-call fees, human review, and idle polling — and for a lot of workloads the tokens are the smallest line. A model that sums all six so you can see which one you&amp;rsquo;re actually paying.</description>
    </item>
    <item>
      <title>Cheap first, smart later: model routing that cuts cost without cutting quality</title>
      <link>https://loopandretry.github.io/posts/cheap-first-smart-later/</link>
      <pubDate>Mon, 13 Jul 2026 20:30:00 -0400</pubDate>
      <guid>https://loopandretry.github.io/posts/cheap-first-smart-later/</guid>
      <description>Most requests to your agent are easy, and you&amp;rsquo;re paying frontier-model prices for all of them anyway. A routing cascade — try the cheap model, escalate on a measurable confidence signal — cuts spend without touching output quality, if you get the escalation trigger right. Here&amp;rsquo;s the pattern, where it breaks, and the arithmetic on when it&amp;rsquo;s worth building.</description>
    </item>
    <item>
      <title>Distributed retry patterns: bounding blast radius across a fleet</title>
      <link>https://loopandretry.github.io/posts/fleet-retry-patterns/</link>
      <pubDate>Mon, 13 Jul 2026 18:15:00 -0400</pubDate>
      <guid>https://loopandretry.github.io/posts/fleet-retry-patterns/</guid>
      <description>A per-step retry cap bounds a step. It never bounds a run, and it never bounds a fleet — twelve workers each retrying &amp;lsquo;reasonably&amp;rsquo; is how you turn one bad deploy into a bill. The four patterns that actually put a ceiling on what a fleet of agents can spend recovering from a failure: shared retry budgets, circuit breakers, decorrelated backoff, and poison quarantine.</description>
    </item>
    <item>
      <title>Your agent&#39;s failures are silent: measuring failure modes in production</title>
      <link>https://loopandretry.github.io/posts/measuring-agent-failure-in-production/</link>
      <pubDate>Mon, 13 Jul 2026 18:10:00 -0400</pubDate>
      <guid>https://loopandretry.github.io/posts/measuring-agent-failure-in-production/</guid>
      <description>Most agent failures don&amp;rsquo;t throw. The run returns a result, exit code zero, and the result is wrong — or it burns an hour and quietly gives up. If your monitoring only counts exceptions, you&amp;rsquo;re blind to the failures that actually cost you. A taxonomy of agent failure modes and the specific instrumentation that catches each one before your users or your bill do.</description>
    </item>
    <item>
      <title>Why a long agent run costs O(N²) tokens — and how to flatten it</title>
      <link>https://loopandretry.github.io/posts/long-agent-runs-are-quadratic/</link>
      <pubDate>Mon, 13 Jul 2026 18:05:00 -0400</pubDate>
      <guid>https://loopandretry.github.io/posts/long-agent-runs-are-quadratic/</guid>
      <description>A naive agent&amp;rsquo;s token bill doesn&amp;rsquo;t grow with the number of steps — it grows with the square of them, because every step re-reads the whole transcript that every previous step appended to. A small cost model shows the curve, and four structural moves turn the quadratic back into something close to linear without dropping information the agent actually needs.</description>
    </item>
    <item>
      <title>Your agent&#39;s p99 is a different animal</title>
      <link>https://loopandretry.github.io/posts/your-agents-p99-is-a-different-animal/</link>
      <pubDate>Mon, 13 Jul 2026 18:00:00 -0400</pubDate>
      <guid>https://loopandretry.github.io/posts/your-agents-p99-is-a-different-animal/</guid>
      <description>Average latency is the number you demo and the number nobody experiences. A multi-step agent is a sum of random variables, so its total time is dominated by the tail of each step — and the more steps you add, the more certain it becomes that at least one of them is slow. Here&amp;rsquo;s the model, why the p99 of the whole is worse than the p99 of the parts, and the two levers that actually move it.</description>
    </item>
    <item>
      <title>Compaction is a lossy operation</title>
      <link>https://loopandretry.github.io/posts/compaction-is-a-lossy-operation/</link>
      <pubDate>Mon, 13 Jul 2026 16:00:00 -0400</pubDate>
      <guid>https://loopandretry.github.io/posts/compaction-is-a-lossy-operation/</guid>
      <description>When the context window fills up, the standard fix is to summarize the old turns and keep going. That summary is a lossy compression step, and the thing it silently drops is usually the one early constraint the agent needs a hundred turns later. Here&amp;rsquo;s why recency-based compaction fails, a simulation of how often the load-bearing fact survives, and the rule that actually protects it.</description>
    </item>
    <item>
      <title>Tool output is untrusted input: prompt injection is a data-flow bug</title>
      <link>https://loopandretry.github.io/posts/tool-output-is-untrusted-input/</link>
      <pubDate>Mon, 13 Jul 2026 15:00:00 -0400</pubDate>
      <guid>https://loopandretry.github.io/posts/tool-output-is-untrusted-input/</guid>
      <description>Prompt injection isn&amp;rsquo;t a prompting problem, so you can&amp;rsquo;t prompt your way out of it. It&amp;rsquo;s the same class as SQL injection: data from an untrusted source crosses into a control channel and gets executed as instructions. The web page your agent just fetched, the ticket it just read, the email in its inbox — all of it is attacker-controllable input flowing straight into the one component that can&amp;rsquo;t tell data from commands. Here&amp;rsquo;s the data-flow framing, why &amp;lsquo;ignore injected instructions&amp;rsquo; can&amp;rsquo;t work, and the boundary that actually helps.</description>
    </item>
    <item>
      <title>Your retry just sent the email twice: idempotency keys for agents</title>
      <link>https://loopandretry.github.io/posts/idempotency-keys-for-agents/</link>
      <pubDate>Mon, 13 Jul 2026 09:00:00 -0400</pubDate>
      <guid>https://loopandretry.github.io/posts/idempotency-keys-for-agents/</guid>
      <description>Retrying a read is free. Retrying a write can charge a card twice, send two emails, or book two rooms — and the model has no idea it happened. Retry safety is a property you build into the tool, not a flag you set on the loop. Here&amp;rsquo;s why at-least-once delivery is the default you&amp;rsquo;re actually running, how to derive a stable idempotency key from an agent&amp;rsquo;s intent, and a dedup wrapper that makes any write safe to retry.</description>
    </item>
    <item>
      <title>Postmortem: the agent that spent $200 retrying a 400</title>
      <link>https://loopandretry.github.io/posts/postmortem-200-dollars-retrying-a-400/</link>
      <pubDate>Sun, 12 Jul 2026 09:00:00 -0400</pubDate>
      <guid>https://loopandretry.github.io/posts/postmortem-200-dollars-retrying-a-400/</guid>
      <description>An agent burned ~$200 overnight retrying an HTTP 400 — a request that was defined to fail. No component was buggy; each layer retried &amp;ldquo;reasonably.&amp;rdquo; The teardown: why retryability is a property of the error and not a default, how three nested retry caps multiply into 75 doomed attempts per item, and why per-step caps never bound a bill. With the two-line fix and a circuit breaker.</description>
    </item>
    <item>
      <title>When not to build an agent</title>
      <link>https://loopandretry.github.io/posts/when-not-to-build-an-agent/</link>
      <pubDate>Wed, 08 Jul 2026 02:00:00 -0400</pubDate>
      <guid>https://loopandretry.github.io/posts/when-not-to-build-an-agent/</guid>
      <description>An agent is an LLM that controls its own control flow — and that autonomy has a price you pay on every run: quadratic token cost, serial latency, and a failure surface you can&amp;rsquo;t unit-test. Most tasks people reach for an agent on are a fixed pipeline wearing a costume. Here&amp;rsquo;s the decision checklist I use, the arithmetic on what the agent tax actually costs, and the same task built both ways so you can see the difference.</description>
    </item>
    <item>
      <title>Your LLM-as-judge is lying to you</title>
      <link>https://loopandretry.github.io/posts/llm-as-judge-is-lying-to-you/</link>
      <pubDate>Wed, 08 Jul 2026 01:30:00 -0400</pubDate>
      <guid>https://loopandretry.github.io/posts/llm-as-judge-is-lying-to-you/</guid>
      <description>A model grading your agent&amp;rsquo;s output is the only thing that scales for subjective quality — and it&amp;rsquo;s a biased instrument you&amp;rsquo;re reading as a ruler. Here are the biases that actually move scores (position, verbosity, self-preference, leniency), why raw agreement with a human hides them, and how to validate and harden a judge with code — including why you should be reporting Cohen&amp;rsquo;s kappa, not accuracy.</description>
    </item>
    <item>
      <title>What to actually measure when your agent &#34;works&#34;</title>
      <link>https://loopandretry.github.io/posts/what-to-measure-when-your-agent-works/</link>
      <pubDate>Tue, 07 Jul 2026 21:00:00 -0400</pubDate>
      <guid>https://loopandretry.github.io/posts/what-to-measure-when-your-agent-works/</guid>
      <description>&amp;ldquo;It works&amp;rdquo; is a demo result, not a measurement. An agent is a trajectory, not a function, and grading only the final answer throws away most of what decides whether it&amp;rsquo;s reliable. Here&amp;rsquo;s a five-layer scheme for what to measure — outcome, trajectory, cost, failure class, and stability under nondeterminism — with a small harness that computes it.</description>
    </item>
    <item>
      <title>The context window is a cache, not a memory</title>
      <link>https://loopandretry.github.io/posts/context-window-is-a-cache/</link>
      <pubDate>Tue, 07 Jul 2026 20:00:00 -0400</pubDate>
      <guid>https://loopandretry.github.io/posts/context-window-is-a-cache/</guid>
      <description>Treating the context window as append-only memory is how agents get slow, expensive, and quietly wrong. The fix is to run it like a cache with a budget and an eviction policy: decide what earns its tokens every turn. Here&amp;rsquo;s the cost math, the accuracy failure mode, and a working context manager.</description>
    </item>
    <item>
      <title>Loop drift: how agents convince themselves they&#39;re making progress</title>
      <link>https://loopandretry.github.io/posts/loop-drift/</link>
      <pubDate>Tue, 07 Jul 2026 10:00:00 -0400</pubDate>
      <guid>https://loopandretry.github.io/posts/loop-drift/</guid>
      <description>The worst agent failures don&amp;rsquo;t crash — they keep working. A postmortem on loop drift: an agent that stayed busy for 40 steps without getting closer to done, why the model&amp;rsquo;s own progress reports can&amp;rsquo;t catch it, and the external signals and evals that can.</description>
    </item>
  </channel>
</rss>
