Why Long-Horizon AI Agents Fail: The Closed-Loop Reliability Bottleneck

    Long-horizon AI agents can look impressive in demos, then fail on success rate, latency, cost, and auditability in real work. This article argues that the main bottleneck is not a stronger chat model, but weak closed-loop reliability: locally plausible steps that drift from the goal and are hard to detect, locate, and correct. It covers compounded error, four stacked failure layers, reasoning budgets, memory, tool contracts, planning, multi-agent coordination, evaluation, and a minimal operable architecture.

    Agents no longer stop once they have answered a question. They take a goal, call tools, read intermediate results, rewrite the plan, and push a task toward completion over many turns. That capability looks striking in a demo. In real business work, success rate, latency, cost, and auditability all break down at once. Asking only whether the model is strong enough often sends effort to the wrong place.

    The larger bottleneck today is weak closed-loop reliability on long-horizon tasks. Every step can look reasonable while the trajectory drifts from the goal, and the system cannot reliably detect, locate, and correct that drift.

    Separate single-step skill from the closed loop

    Single-step skill is whether, given a clear context, the model can choose a suitable action, write an executable fragment, or summarize an observation. Closed-loop skill is whether the system can reach an acceptable end state within a limited number of steps and a limited budget when the goal is incomplete, the environment changes, tools fail, and context grows.

    The two are not linear. Raising an already high single-step accuracy a little more may still leave multi-step success flat, because errors multiply. If each step is independently correct with probability p and there are n effective steps, a rough success rate is close to p to the power of n. On a twenty-step task, a system that is 95% correct per step can fall to about 36% at the trajectory level. Real environments are harsher: errors are not independent. Choosing the wrong tool early contaminates later observations, and later reasoning stays self-consistent on a wrong state.

    The bottleneck should therefore not be phrased as “we still need a stronger conversational model.” It should be phrased as a missing mechanism that constrains probabilistic actions inside a verifiable state machine. The model proposes. The system constrains, checks, rolls back, and stops.

    Four stacked failure points

    Long-horizon failure is usually not a single fault. Four layers stack.

    The first is an under-constrained goal. The user says “finish this request,” while success criteria, prohibitions, the definition of done, and priorities stay vague. The agent then optimizes a goal it filled in itself. Demo tasks hide this because the goal is short and a reviewer is nearby. Production tasks run longer and acceptance arrives late, so the deviation grows.

    The second is partial observability. A tool returns a slice, not the whole world. A missed retrieval, a timed-out API, a stale page, or insufficient permission leaves the observation incomplete. Models tend to treat a partial observation as a complete fact and plan the next step from it.

    The third is irreversible action, or asymmetric cost. Writing a database, sending a message, changing configuration, and submitting a change are not the same risk as “search once more.” If the policy does not separate reversible exploration from irreversible commit, one overconfident step causes real loss.

    The fourth is an unevaluable trajectory. Without step-level records, no one can say whether failure happened in understanding, retrieval, tool choice, parameter construction, or result checking. What cannot be reviewed cannot be iterated. The bottleneck stays at “it feels unstable.”

    Reasoning: slower thinking does not fix a wrong state

    More search and self-checking during reasoning can improve single-step decisions, especially when a task needs decomposition, comparison, and elimination. The boundary is clear.

    Reasoning consumes the same observation. If that observation is wrong, a longer chain of thought only argues the error more smoothly. Reflection generated by the same policy, with no external criterion, often criticizes the conclusion and then keeps it. Useful reflection must bring in new information: the tool’s actual return, an independent checker, a rule, a test result, or another uncontaminated piece of evidence—not another longer explanation.

    In practice, split reasoning into two budgets. An exploration budget is for high-ambiguity, reversible steps. It allows multiple candidates, comparison, and abandonment. A commit budget is for irreversible actions. It requires harder gates: schema checks, permission checks, idempotency keys, a diff preview, and human confirmation. Without that split, simply thinking longer raises latency and cost and does little for critical mistakes.

    A schematic action gate can stay simple. The point is to separate proposal from execution:

    1. propose(goal, state) -> action
    2. validate(action, policy) -> ok | reject(reason)
    3. execute(action) -> observation
    4. judge(goal, observation) -> continue | replan | stop

    The rejection reason must be written back into state. Otherwise the next turn repeats the same illegal proposal. Stop conditions must also be explicit. Reaching acceptance, exhausting the budget, making no progress for several steps, or exceeding risk—any one of these should end the loop. The loop should not collapse only because the context window runs out.

    Memory: longer is not better; it must be retrievable and expirable

    Memory is often treated as an extension of the context window. A longer window does reduce the chance that earlier text is truncated. It does not solve three harder problems: what to write, how it expires, and which source wins in a conflict.

    Working memory holds the current goal, constraints, completed steps, and open questions. Its life should be bound to the task; when the task ends, archive or discard it. Episodic memory holds reusable trajectory summaries, such as the retry conditions that worked for a class of API failure, not raw long logs. Semantic memory holds relatively stable facts and procedures, but it must carry freshness and source. Mixing the three into one endlessly appended text makes retrieval noise drown the constraints, and the model treats stale facts as the current state.

    Be stingy about writes. Only information that changes later decisions belongs in long-term memory: a preference the user confirmed, a stable identifier in the environment, or a verified cause of failure. Large raw tool returns should be reduced to structured fields before anything is kept. Reads need filters: task, time, permission, and trust, not “similar, so inject it.”

    Expiration matters just as much. When a process, permission, or API field changes, old memory systematically misleads. Memory without versions and expiry becomes a larger hidden misconfiguration as it grows.

    Tools: a clear protocol can still fail on parameters and semantics

    Tools connect a language model to an executable world, and they are the most common failure surface. The failure modes cluster.

    Description and real behavior diverge. The name looks like a query, but the call writes. The document says the return is a list, while an empty result and an error share one structure. The model acts on the description. The environment reacts to the implementation. Nothing aligns them.

    The parameter space is too open. When free text is assembled into a query, script, or filter, a small format slip fails the call or over-executes it. Fields that can be constrained by enums, schemas, and allowlists should not be left to generation.

    Idempotency and side effects are missing. A retry after timeout can place a duplicate order or send a duplicate notice. When the agent sees “not sure it succeeded,” it often calls again. The tool layer must provide an idempotency key, a queryable receipt, and an explicit unknown state, not only success or exception.

    Permissions are too broad. Opening a wide scope so a demo can run turns a policy mistake directly into a security incident. Least privilege should be granted by task template, not by “this agent usually needs to do everything.”

    A contract should at least include purpose, preconditions, input schema, output schema, side effects, idempotency semantics, timeout, rate limits, and failure classes. Failure classes must guide recovery: retryable, switch tools, ask the user to clarify, or stop immediately. “The call failed” gives the planner no informative next step.

    Planning and reflection: dynamic, but progress must be decidable

    A static plan goes stale as soon as the environment changes. A fully dynamic plan easily spins in place. A usable approach is a hierarchical plan plus a progress criterion.

    The high level keeps only stages and acceptance, for example “clarify scope, collect evidence, draft a solution, verify, submit.” Only the low level binds specific tools. After each low-level action, an independent rule decides whether the stage is closer to acceptance. The model should not grade itself with “I think we made progress.” If the observation hash stays unchanged for several steps, a goal-coverage metric does not rise, or the same rejection reason keeps firing, force a replan or escalate to a person.

    The reflection loop should read the trajectory, not an emotional summary. Useful inputs are the action, a parameter summary, the observation delta, the check result, and the remaining budget. The output should be a controlled decision: retry, switch tools, roll back to the last stable state, narrow the goal, or stop. An open “think again” adds text and does not necessarily change state.

    Multi-agent systems: splitting work amplifies coordination cost

    When one agent’s context and duties are overloaded, splitting roles is a natural response. The split can isolate permissions and expertise. It also creates new bottlenecks: inconsistent shared state, messages that drop goal constraints, roles waiting on each other, and nobody owning final acceptance.

    A multi-role system needs a single source of truth first: goal, constraints, current stage, and committed actions. What passes between roles is a structured task ticket, not natural language that drifts as it is forwarded. Each role should have a different tool set and write scope. A coordinator may schedule, but commit rights should be centralized so two roles do not change the same external state at once.

    If a single agent’s state, evaluation, and permissions are not established yet, adding roles usually copies the same unreliability. Division of labor manages complexity. It is not a substitute for reliability.

    Multimodal and coding tasks: observation and verification must sit outside the model

    With interface and visual input, the bottleneck is often observation granularity. Screenshot pixels or a brief text description cannot stably express operable elements, focus, and occlusion. If an action lacks element-level targeting and a check after execution, the agent keeps planning in a state where it clicked and the page did not change.

    Coding loops look easier because tests and builds can supply an external signal. That only works if the signal is actually the criterion. A failure log should be attributed to a specific change, not trigger a full rewrite. Passing tests does not mean the requirement is met; the result still has to be checked against acceptance criteria. Without an isolated environment and a diff boundary, automatic edits push the cost of trial and error onto a real repository and real data.

    Evaluation: without trajectories, the bottleneck cannot be confirmed

    Offline question-answering scores do not explain an agent. At least four metric groups should be watched together.

    Task success: whether the task is completed under a fixed goal and hidden acceptance criteria, with acceptable partial completion distinguished. Process efficiency: step count, tool-call count, repetition rate, human interventions, latency, and cost. Safety and compliance: out-of-scope calls, irreversible mistakes, and leakage of sensitive information. Diagnosability: whether a failure can be classed as an unclear goal, missed retrieval, bad parameters, tool failure, a planning loop, or missing verification.

    The evaluation set should cover vague goals, tool failures, stale information, insufficient permission, and distracting observations, not only the happy path. Every policy or prompt change should be regressed on the same trajectory set. An aggregate success rate with no failure classes turns optimization into guesswork.

    How to find the current largest bottleneck

    Different systems rank their weaknesses differently. A simple decision order avoids changing ten places at once.

    First, see whether failures cluster on goal understanding. If success rises sharply once a person writes the acceptance criteria clearly, the bottleneck is the task contract, not the model. Next, look at observation quality. If putting the key facts directly into context makes the steps much shorter, the bottleneck is retrieval, memory, or the structure of tool returns. Then look at action legality. If failures are mostly parameters, permissions, or duplicate commits, the bottleneck is the tool contract and the gates. If single steps are right and the trajectory still diverges, the bottleneck is progress criteria and stop conditions. Only then is it the model’s own reasoning ceiling.

    The point of this order is that the first four can be improved with state design, interface constraints, and evaluation, and the gain is usually more stable than indiscriminately enlarging the generation budget. Model upgrades still matter, but they amplify the quality of a closed loop that already exists. If the loop does not exist, a stronger proposal only reaches a wrong commit faster.

    A minimal architecture for production

    An operable agent does not have to be complex at the start, but a few parts should not be missing.

    A goal card: success criteria, scope, prohibitions, and budget. State storage: stage, verified facts, open items, and failure counts. A tool adapter: schema checks, idempotency, timeouts, and error classes. A policy layer that only emits candidate actions. A control layer that validates, executes, records, and decides whether to continue or stop. Trajectory logs that are sufficient for later replay, without unbounded storage of sensitive raw text. Evaluation tasks fed back from real failures, not only from successful demos.

    General capabilities on a cloud platform such as Baidu AI Cloud—container runtimes, object storage, message queues, and logging and monitoring alerts—can provide execution isolation, trajectory retention, and failure alerts. They do not automatically constitute agent reliability. Reliability comes from whether the goal is acceptable, whether actions are constrained, and whether failures can be classified. Cloud resources are the carrier for running and observing. They do not replace the design of the state machine.

    Conclusion

    The bottleneck shifts with the product stage. In the move from “it can demo” to “it can be left on duty,” the largest bottleneck is usually an unreliable long-horizon loop, not the absence of one single-point trick. The model supplies a high-probability proposal. The environment supplies incomplete, expiring feedback with side effects. Without a verifiable state, tiered budgets, a strict tool contract, and trajectory-level evaluation, error accumulates into loss of control over a dozen steps.

    Shift the question from “how do we make it think better” to “how do we make a wrong action impossible to commit, force a loop with no progress to stop, and classify every failure.” The bottleneck then becomes an engineering object instead of a feeling. Only after that do a larger reasoning budget, more memory, or multi-role splits have a clear place to attribute their gains. Otherwise the system stays occasionally brilliant and unreliable on average, and it cannot enter a business process that requires accountability.