Hands-On Testing of Long-Horizon LLM Agents: Lessons from 10 Million Tokens
Single-turn benchmarks only show how well a model performs in a short context; they rarely reveal what happens during long, multi-step work. This article reports on hands-on testing of long-horizon LLM agents at a scale of roughly 10 million tokens, focusing on three observable signals: whether tasks are fully closed-loop, whether the agent detects and fixes its own errors, and whether the cost per unit of useful output stays under control. It covers autonomous planning and execution, the stability of complex reasoning, overthinking on simple tasks and model tiering, how context caching offsets higher API prices, and a reusable evaluation checklist. You will also find a sample acceptance script and practical cost-control patterns.
1. Why Burning Tokens Is Still a Necessary Way to Test Agents
A single-turn Q&A benchmark only reflects a model’s expressive ability in a short context. It does not expose how the model actually behaves in long-chain tasks. When a task spans tens of minutes, dozens of tool calls, and multiple rounds of self-revision, the model truly starts acting as an engineering participant. That is why spending tokens at the scale of tens of millions to observe long-horizon behavior is currently the most direct way to evaluate agent capability.
One point needs emphasis: token consumption is not a metric in itself. It is only a sampling cost. What really matters are three observable signals: whether the task is fully closed-loop, whether errors are detected and fixed autonomously, and whether the cost per unit of effective output stays controllable. This article is organized around these three points.
2. Observation 1: Long-Horizon Autonomous Planning and Execution Is the Core Dividing Line
Given a task without excessive constraints, a mature agent should first produce a structured plan and then move into execution. The typical behavior chain observed in testing was:
- Break down the requirements and output a functional module breakdown and data table design;
- Provide a development workflow, making the build order of each component explicit;
- Proactively generate an acceptance checklist, defining “done” as “verifiable”;
- Execute continuously for tens of minutes without interruption or drift, following the established plan;
- Self-test after completion, for example by writing one row of data to verify that the pipeline works end to end.
This behavior chain matters because it upgrades “generating code” into “delivering an engineering result.” Four things deserve close attention during evaluation:
- Planning completeness: whether the modules and data structures are self-consistent and whether there are obvious gaps;
- Execution fidelity: whether the agent deviates from the initial plan or skips steps;
- Self-correction ability: whether it can locate and fix an error when one occurs, rather than repeating the same output;
- Result usability: whether the core path actually runs, rather than only having a complete-looking UI.
A simplified acceptance script can be organized like this, turning subjective impressions into a repeatable experiment:
checks = [("schema_created", check_tables_exist),("write_path", check_insert_one_row),("read_path", check_query_returns_row),("aggregation", check_stats_correct),("error_handling", check_invalid_input_rejected),]def run_acceptance(env):report = {}for name, fn in checks:try:report[name] = "pass" if fn(env) else "fail"except Exception as e:report[name] = f"error: {type(e).__name__}"return report
The engineering implication is clear: an agent’s output must be included in a continuous-integration-style acceptance process instead of being eyeballed through the UI. UI polish is a secondary dimension. The main paths — data writes, queries, aggregations, and invalid-input rejection — are the actual criteria.
3. Observation 2: Stability of Complex Reasoning Matters More Than Peak Intelligence
On logic puzzles, models often perform well because they can converge within a limited number of reasoning steps. But on hard math problems and some scenarios requiring precise calculation, two typical failures appeared: getting stuck in a loop of repeated derivation, and producing conclusions that look plausible but are wrong.
This suggests that reasoning ability cannot be judged only by “did it solve the hardest problem.” You need to look at the distribution:
- Convergence: whether it reaches a conclusion within a finite number of steps, and whether there are tautological loops;
- Verifiability: whether the conclusion can be independently checked, for example by substituting it back into the original expression or by regression with numerical samples;
- Consistency: whether repeated sampling of the same question yields stable answers.
In practice, giving the agent an “external judge” works better than simply increasing the thinking budget. Assigning another call to verify results, run tests, and do numerical comparisons turns unreliable single-point reasoning into a convergent closed loop. Hard limits on step count and time should also be set to avoid wasted consumption.
4. Observation 3: Overthinking on Lightweight Tasks and Model Tiering
A counterintuitive finding: on extremely simple questions, the more capable version sometimes takes a detour, complicating a question that could be answered directly, and even getting it wrong. The lightweight version is often more direct and more efficient.
The reason is not mysterious. Long-chain training and reasoning habits push the model to expand more branches and assume more constraints, introducing noise into small problems. The engineering response is tiered routing:
if task.complexity == "low" and task.risk == "low":route -> lightweight model, low thinking budgetelif task.chain_length > N or task.tool_calls > M:route -> strong reasoning model, enable caching and checkpointselse:route -> general-purpose model, standard budget
Two supporting rules apply. First, set a “shortest path” prompt for simple tasks that explicitly forbids unnecessary expansion. Second, include “answer conciseness” in the regression test set to prevent the model from degrading on small tasks.
5. Unexpected Finding: Price Increases Are Partly Offset by Caching and Execution Efficiency
The API unit price of a new-generation model is usually higher than that of the previous generation, but the actual bill for long tasks does not rise proportionally with unit price. Long-horizon agents have highly repetitive context: the system prompt, tool definitions, and prior trajectory are read again at every step. When the platform provides a context caching mechanism, the repeated prefix portion can be billed at a lower cost, significantly amortizing the total over long tasks.
Common ways to control cost include:
- Stable prefix: put the unchanged system prompt and tool descriptions at the front to improve cache hit rate;
- Checkpoint compression: summarize completed trajectory history to reduce the redundant content carried at each step;
- Budget guardrails: set token and duration limits for a single task, and pause to request confirmation when exceeded;
- Persist results: write intermediate artifacts to external storage to avoid repeatedly passing large blocks of content through the context.
6. A Reusable Evaluation Checklist
| Dimension | Key question | Basis for judgment |
|---|---|---|
| Planning | Does it produce a plan before executing | Whether modules and data structures are self-consistent |
| Execution | Does it stay on track for a long time | Step-to-plan agreement rate |
| Correction | Can it self-heal after an error | Whether the same type of error recurs |
| Reasoning | Is it convergent and verifiable | Loop count, verification pass rate |
| Efficiency | Does it take detours on small tasks | First-answer accuracy and token usage |
| Cost | Is caching effective | Repeated-prefix ratio and billing curve |
7. Conclusion
Progress in long-horizon agentic coding is substantive: autonomous planning, continuous execution, and self-verification can now cover engineering deliveries of moderate complexity. But reasoning stability and task tiering remain weak spots, and over-expansion on simple tasks harms both accuracy and cost. For users, the pragmatic approach is to treat the agent as an engineering collaborator that needs to be accepted, budgeted, and judged, and to use repeatable tests and tiered routing to convert its capability into output reliably. If you run this kind of workload on general-purpose cloud capabilities, you can store intermediate artifacts in object storage, decouple long tasks with a message queue, host execution sandboxes on a container platform, and build a complete observability loop with logging services and monitoring alerts.
