Spin Loops and Replay Cycles Produce the Exact Telemetry Shape Conventional Observability Considers Healthy

Agents can fail in loops while every request still looks healthy.

· 9 min read
Cover illustration for “Spin Loops and Replay Cycles Produce the Exact Telemetry Shape Conventional Observability Considers Healthy”
Agent Failures · November 14, 2026 · 9 min read · 1,970 words

Traditional error monitoring fails for AI agents because it measures request completion while task success depends on whether the decisions between requests advanced the task. Spin loops and replay cycles can produce HTTP 200 responses at normal latency while the agent makes no progress or reasons over corrupted results. Exposing these failures requires step-level evidence of repetition, tool-response validity, and progress toward the original goal.

Why traditional error monitoring fails for AI agents

Conventional application monitoring rests on the assumption that software failures announce themselves. APM reads status codes, latency percentiles, and error rates at the HTTP boundary because that is where many traditional failures surface. An exception produces a stack trace that points to a line number, giving the engineer a bounded place to investigate. The failure has a legible diagnostic signal. For deterministic software, the same inputs also produce the same outputs, allowing failures to reproduce and tests to catch them.

Agent failures break that diagnostic chain. A request can complete successfully while the agent chooses the wrong tool, accepts an invalid result, or repeats an action that does not advance its task. Any of those decisions can happen without an exception. The transport has done its job, but the task has not succeeded. Uptime, latency, and error rates therefore answer a different question from the one the engineer needs answered.

This distinction explains the limitation of using conventional APM signals to monitor agent behavior. The instruments remain useful for detecting unavailable services and slow requests, but they do not establish whether an agent reached the right outcome. A healthy request boundary is not evidence of sound execution. When failure lives in a sequence of decisions, monitoring only the calls leaves the causal sequence unexamined.

What agents actually do between one HTTP call and the next

An agent observes context, selects a tool, dispatches the call, reads the result, updates its working state, and decides whether to continue or stop. That sequence can repeat within what APM treats as a single request. Each pass changes the information available to the next decision. The execution is therefore not just a collection of calls, but a loop whose behavior depends on how the agent interprets their results.

Loops, tool calls, and state updates are part of normal control flow. They are not exceptions. A request log can establish that a call completed without showing why the agent selected it, what it accepted from the response, or how that response changed the next action. Those missing relationships distinguish purposeful work from repetition. Two successful calls may represent progress, or they may represent another pass through the same unresolved problem.

The dependency between steps also allows an early error to propagate. If step two produces corrupted information, subsequent steps can reason over that information without recognizing its origin. A hallucinated output becomes downstream input, and later decisions compound the original mistake. Every request in that sequence may still complete normally.

Non-determinism makes the resulting failure harder to reproduce. The same prompt can lead to different tool selections and reasoning paths across runs, so a production failure may not appear in a test environment. Explaining the failed execution depends on the actual sequence of decisions, tool results, and state changes from the affected task.

How a spin loop produces a healthy telemetry signature

A spin loop occurs when an agent continues its observe, decide, act, check, repeat cycle without a defined stopping point. Nothing in that cycle alone guarantees termination. A coding agent can run a failing test, edit code, and run the test again without addressing the underlying problem. The actions execute, but the approach does not improve.

Take a coding agent that makes twelve failed deploy attempts, all returning HTTP 200. At the request boundary, each attempt has completed successfully. The deployment outcome and the HTTP outcome are different facts, but conventional request telemetry records the latter as its success signal. If each response also arrives at normal latency, neither status nor timing shows that the task failed.

Across the sequence, APM therefore sees successful calls rather than unsuccessful progress. A healthy multi-step execution could produce the same response codes and timings while completing its intended work. In the spin loop, the agent continues without resolving the problem that caused the previous attempt to fail.

The missing exit condition can also produce the opposite behavior, where the agent reaches paralysis and no output fires. Both behaviors arise from objectives with no defined stopping point, although only the active loop produces the repeated healthy-call signature. Repeated attempts can use up the token budget before request-level monitoring spots a fault. A long execution may become visible as cost, but that is not an explanation of why it failed.

The diagnostic distinction is progress relative to repetition. Tracking step count, similarity between consecutive outputs, and the relationship between claimed progress and actual trajectory reveals information that HTTP status codes do not.

How a replay cycle produces a healthy telemetry signature

A replay cycle begins with a different defect. Rather than continuing because it lacks an exit condition, the agent repeats work in response to tool-call or schema errors. Those errors include wrong argument types, wrong key names, calls to tools outside the registered set, and HTTP 200 responses with empty or malformed payloads. The call can look successful even when its content cannot support the next decision.

When the agent trusts a malformed result, it can reason over that result without raising an exception. Its interpretation then becomes input to the next step, which can also complete with HTTP 200. Successful transport conceals invalid content. Repetition emerges from the agent's handling of the tool failure.

Conventional monitoring also has a reason to tolerate retries. Distributed systems retry transiently failing calls, so repeated requests can be evidence of resilience. A 2% uniform tool failure rate can fall within the range treated as healthy tool status, even as the agent's response to those failures creates a replay cycle. The overall rate does not show whether one task is stuck in repeated attempts to recover.

As retries accumulate, context drift can deepen the failure. Error messages and retry artifacts occupy the context window, crowding out the original goal. The agent then begins optimizing for resolving the current error instead of completing the task that started the session. Requests can continue returning 200 throughout this change in purpose.

One repeats without an effective stopping point, while the other repeats around tool errors and corrupted interpretations. At the HTTP boundary, both can look like ordinary multi-step execution.

Why false success reporting makes both patterns invisible at the output layer too

Language models produce output that reads smoothly and sounds confident, even when the execution has failed. A summary of repeated unsuccessful attempts can read like a report of completed work. The wording is not a reliable success signal. An agent that has looped or replayed can still announce “task completed successfully.”

False success reporting hides a sign that might otherwise lead someone to look into the failure. A visibly incomplete response would at least expose uncertainty about the outcome, but a confident closing statement reinforces the successful HTTP status. The two signals appear to agree even though neither establishes that the requested state was reached. The dashboard stays green while the user gets the wrong result.

Laksh Advani's From Confident Closing to Silent Failure looks at this gap between the claim that work is complete and the environment state. The distinction is important because false success is a claim that the task succeeded when the state shows otherwise. The output layer can therefore conceal the same failure that the request layer missed.

The agent's final report can actively discourage scrutiny of the execution that produced it. A human who is stuck often looks stuck, while an agent can present the same confident finish after success or failure. The dangerous asymmetry is that invisible failures are indistinguishable from an absence of failures until a user reports the wrong outcome or a downstream process acts on corrupted state.

What the telemetry would need to show to expose these patterns

Detection requires signals that describe the steps within a task, beginning with iteration count relative to expected complexity. A session containing more tool invocations or model calls than its task warrants can reveal a loop even when every call succeeds. The threshold must reflect the work being attempted. A turn limit enforces a boundary proactively, while monitoring identifies executions that cross the expected count.

Step count alone cannot establish whether the agent is progressing. Semantic similarity between consecutive outputs adds evidence of repetition, including near-identical interpretations that recur during a replay cycle. Combined with iteration count, it helps distinguish extended work from oscillation.

Even when a response returns HTTP 200, it must have usable content that matches the expected schema. Validating tool-call schemas before dispatch and response content before it enters the agent's context catches corruption at its entry point. This separates a successful exchange from a result the agent can safely interpret.

Trajectory coherence addresses the harder question of purpose. The current action must be compared with the original goal stated at session start to detect whether retries have redirected the agent toward a local error. That comparison is more demanding than counting steps. It is also more diagnostic when an agent remains active and produces varied outputs while moving away from the intended task.

For teams implementing these signals, structured step-level logging is the minimum useful foundation. Each event records the step type, tool name, arguments, response content, cumulative token count, and session ID. Those fields connect the action to its result and execution context. Without that connection, a repeated output or malformed response cannot be attributed to the decision sequence that produced the outcome.

A Session groups the traces belonging to one multi-turn conversation or task, a Trace represents one execution attempt, and a Span represents one model call, tool call, retrieval step, or routing action. This hierarchy helps engineers look for the failure at the level where it starts. Monitoring that cannot explain why the agent failed on step six does not yet provide agent observability.

How the detection-to-fix loop closes when instrumentation is in place

Step-level traces allow recurring failures to be grouped into patterns. A tool that fails on the same schema shape across executions presents a diagnosable failure mode. The individual trace supplies the evidence. Comparing traces then establishes where that evidence recurs, allowing detection to focus on the repeated mechanism.

Diagnosis follows the failed execution span by span. The trace shows where iteration count exceeded task expectations, which tool returned malformed content, and when context drift redirected the agent. Instead of reconstructing those relationships through an afternoon of log-scrolling, the engineer can inspect them in minutes. A Slack alert can fire when the pattern threshold is crossed, making the execution itself the trigger for investigation.

That evidence also improves the fix handoff. Passing trace context to a coding agent over MCP gives the engineer the loop, malformed response, and drift point together with the code. The proposed change can address the observed mechanism. Detection has then produced something actionable, but the feedback loop is not yet closed.

Verification turns the real failure into an eval that runs against the fixed agent before release. This tests the change against the execution problem that prompted it and creates a way to catch regressions before another user encounters them. Without that step, stopping one loop does not establish that the failure mode has been corrected.

The alternative routes production feedback through the customer or the billing dashboard. By the time a cost anomaly appears, the loop has already consumed its budget, and the customer may already have received the wrong outcome. Step-level instrumentation moves the evidence earlier, from the consequence back to the decision that caused it.

Sources

  1. AgentPProf: Semantic Profiler for Long Horizon AI Agents
  2. What Is the AI Agent Loop? The Core Architecture Behind Autonomous AI Systems
  3. Outcome Monitors: Recovery Affordances for Silent Tool Failures
  4. From Confident Closing to Silent Failure: Characterizing False Success in LLM Agents
  5. TelemetrySuffBench: Is Agent Telemetry Sufficient for Failure-Origin Diagnosis?
Filed underAgent Failures

More in Agent Failures