Long-Horizon AI Agents Tested: Lessons After 10 Million Tokens
This article shares practical findings from a hands-on test of long-horizon AI agents that consumed more than ten million tokens across software engineering, logical reasoning, lightweight Q&A, and cost monitoring. It explains why token-intensive testing is necessary, then breaks the observations into four evaluation dimensions: autonomous planning and long-horizon execution, reasoning stability, overthinking on simple tasks, and cost structure with caching. Readers will find concrete failure modes, milestone-based orchestration patterns, routing strategies, and an actionable engineering checklist for building their own agent evaluation pipelines.
1. Why Burning Tokens Is Necessary for Evaluating Long-Horizon Agents
Traditional evaluations measure model capability through single-turn question-answering accuracy. But once a model is placed inside an AI coding tool, an automated operations pipeline, or a data analysis workflow, success no longer depends on whether a single answer is correct. It depends on whether the model can stay aligned with the original goal after dozens of tool calls. These tasks share three traits: the context keeps expanding, intermediate artifacts keep accumulating, and errors propagate downstream along the call chain. Only by consuming enough tokens on real tasks can you observe a model’s stability, planning quality, and error-correction ability in long-horizon scenarios.
This test consumed more than ten million tokens in total, covering four scenario types: engineering development, logical reasoning, lightweight Q&A, and cost monitoring. Note that this article does not recommend or compare any specific product. Instead, it abstracts the observations into transferable evaluation dimensions that teams can reference when building their own test sets.
2. Dimension One: Autonomous Planning and Long-Horizon Execution
2.1 Planning Quality Matters More Than Single-Step Accuracy
In an open-constraint database design task, we provided only the business goal, with no restrictions on table structure, module breakdown, or validation approach. Better-performing models first produced a layered plan: core functional modules, data table design, development order, and a self-check list to run after implementation. This “plan first, execute next, verify last” behavior pattern is the key to completing long-horizon tasks.
Planning quality can be assessed on three points. First, is the task breakdown executable, with each subtask producing a clear deliverable? Second, is a verification step reserved, rather than declaring completion as soon as code is generated? Third, are dependencies reasonable, avoiding rework such as building the UI before defining the data structure?
2.2 Three Failure Modes During Continuous Execution
The most common failure in long-horizon execution is not “inability to write code” but the following three categories:
- Goal drift: as the context grows longer, the model gradually deviates from the initial constraints, producing inconsistent field naming and contradictory interface conventions.
- Loop spinning: repeatedly tweaking the same spot and rewriting equivalent implementations, so token consumption rises while output stays unchanged.
- Silent degradation: to “finish as quickly as possible,” skipping verification steps the model itself listed earlier and delivering a half-finished product that looks complete.
The engineering response is to split long tasks into acceptance-ready milestones and force artifacts and test conclusions to be persisted at each milestone. The illustrative orchestration logic is as follows:
milestones = ["schema", "repository", "service", "ui", "verify"]for stage in milestones:result = agent.run(stage, context=state.summary())artifacts = collect(result) # Collect artifacts uniformlyreport = run_tests(artifacts) # Validate at every stageif not report.passed:state.append_failure(report) # Feed failure info back into contextcontinuestate.commit(stage, artifacts) # Advance only after passing
This “stage gate” structure turns an uncontrollable one-shot long output into an observable, rollback-capable pipeline.
3. Dimension Two: Stability of Complex Reasoning
On logic puzzle tasks, models generally perform well because they can complete exhaustive reasoning within limited constraints. But on high-difficulty math problems and scenarios requiring multi-step abstraction, two issues appeared: getting stuck in prolonged ineffective reasoning, and producing conclusions that look plausible but are wrong.
The root cause of unstable reasoning is often not missing knowledge but a lack of self-checking mechanisms. Viable improvements include: requiring the model to explicitly list known conditions and the goal to prove; performing reverse verification on key steps; running a “conclusion-condition” consistency check before producing the answer; and setting a reasoning budget for problems that fail to converge, switching strategies or requesting human intervention once the budget is exceeded.
4. Dimension Three: Overthinking on Lightweight Tasks
A counterintuitive phenomenon: on extremely simple questions, more capable models are sometimes more likely to make mistakes, because they introduce unnecessary assumptions and complicate simple conditions, while lightweight models give direct answers with a higher hit rate. This suggests that model selection should consider not only the capability ceiling but also the task distribution.
The practical recommendation is to build a routing layer that splits traffic by task complexity:
def route(task):if task.estimated_steps <= 2 and task.verifiable:return light_modelif task.requires_long_horizon:return strong_model_with_orchestrationreturn default_model
Routing decisions can be based on whether tool calls are needed, whether cross-file changes are required, and whether an automatically verifiable criterion exists. Assigning simple, automatically verifiable tasks to lightweight models can significantly reduce latency and cost.
5. Dimension Four: Cost Structure and Caching Mechanisms
Bill growth for long-horizon tasks is often not linearly correlated with call volume. The reason is that repeated context accounts for a very high proportion: the same system prompt and the same batch of code files get carried in repeatedly. Services with context caching capability can amortize the cost of this repeated computation, so the total bill grows less than the per-unit price increase.
There are four general cost-control measures: compress the context, keeping only summaries and key fragments; move large static materials into searchable external storage and retrieve them on demand; cache reusable results locally; and set a hard budget cap for loop spinning. For monitoring, it is recommended to record token consumption, tool call counts, stage duration, and failure retry rates together, forming a baseline for sustainable comparison.
6. An Actionable Engineering Checklist
- Task breakdown: split open tasks into milestones with acceptance criteria; prohibit one-shot delivery.
- Artifact persistence: output structured files at each stage for easy diff and rollback.
- Automated verification: use unit tests, static checks, and interface connectivity checks as stage gates.
- Failure feedback: re-inject structured error logs into the context instead of letting the model guess blindly.
- Human-machine collaboration: high-risk operations require human confirmation; the model handles plans and implementation, humans handle boundaries and compliance.
- Observability: integrate logging services and monitoring alerts, with real-time alerts for abnormal loops and excessively long durations.
- Environment isolation: run generated code in a sandbox on a container platform, restricting network and file permissions.
7. Conclusion
The core conclusion from this ten-million-token test is that long-horizon agent capability has shifted from “whether it can write a correct snippet” to “whether it can reliably complete an engineering task.” Planning, verification, error correction, and cost control are the four pillars that determine real-world usability. For teams, rather than chasing a single leaderboard score, it is better to build your own task set and stage-gate system, using observable data to drive model selection and process optimization. To support this kind of workload, you can build evaluation and runtime environments on top of general capabilities such as the container platform, object storage, logging service, and monitoring alerts offered by Baidu AI Cloud.
