LLM Long-Horizon Tasks Tested: Three Surprises and One Unexpected Result
This article reports on a large-scale hands-on test of long-horizon LLM agent tasks, covering autonomous planning, tool use, self-correction, caching costs, and reasoning stability. It shares practical engineering lessons on task contracts, verification checklists, execution feedback, task routing, and cost evaluation for teams building agentic coding workflows.
1. Test Background and Methodology
As AI agents evolve from “conversational tools” into “execution entities,” the criteria for evaluating a model are shifting. Accuracy on single-turn Q&A is no longer enough; what matters is whether a model can turn a vague requirement into an executable plan and stay on course across an execution chain that lasts tens of minutes or longer, without human intervention.
This test consumed tens of millions of tokens and focused on two workloads: long-horizon agentic coding tasks, and a comparison test involving reasoning and lightweight tasks. Model capability is tightly coupled with the engineering environment that hosts it, so this article does not target any specific product. Instead, it abstracts the findings into general engineering experience: the behavioral patterns of long-horizon tasks under a common technical stack of “a cloud provider’s LLM service + an AI coding tool + version control + logging and monitoring alerts.”
Four evaluation dimensions were used: completeness of task planning, continuity of execution, effectiveness of self-correction, and the trend in cost per task.
2. Surprise One: Long-Horizon Autonomous Planning and Execution Without Interruption
For a loosely constrained task such as database design, the model first produced a design covering 8 core functional modules and 6 data tables, including capabilities like bookkeeping and transaction statistics. It then filled in the development workflow on its own and added a 10-item post-development verification checklist. This closed loop of “plan first, execute next, self-verify last” is key to making long-horizon tasks work.
Once execution was handed over, the model worked continuously for nearly 60 minutes without interruptions or infinite loops, and without skipping critical steps. The engineering result looked somewhat plain from a frontend perspective, but the core flow was usable: adding records produced no errors, and custom operations such as adding, modifying, and deleting categories all worked.
Three engineering lessons are worth highlighting:
- Externalize planning. Have the model write modules, data tables, and verification items into a structured checklist first. This turns implicit intent into a checkable contract, giving every subsequent step a reference point.
- Put the verification checklist up front. Writing “how to verify when done” into the plan significantly reduces cases that “look complete but are actually unusable.”
- Redraw the human-machine division of labor. Developers shift from step-by-step instructions to “define the goal + accept the result,” concentrating human effort on requirement boundaries and acceptance criteria.
An illustrative task contract can be expressed like this:
goal: Build a usable bookkeeping systemmodules: [record entry, category management, transaction statistics, data export, permission checks, exception handling, logging, UI interaction]schema_tables: 6acceptance:- Adding a bookkeeping record produces no exception- Categories can be added/modified/deleted- Statistics match the detailed records- Invalid input is blocked with a prompt
3. Surprise Two: Tool Calling and Self-Correction Are Maturing Together
The real difficulty of long-horizon tasks is not “writing code” but “finding out it is wrong and fixing it.” In the test, when the model hit issues like unreachable interfaces or missing fields, it went back to the plan to locate the deviation and correct it, rather than repeatedly piling on patches. This relies on three capabilities working together: long-context retention, tool-call orchestration, and re-planning based on execution feedback.
In engineering practice, logging services and monitoring alerts can structure execution feedback so the model can “see” its own mistakes:
[step] Generate table definitions -> ok[step] Insert sample data -> fail: field not nullable conflict[action] Modify table default value -> retry ok[verify] Statistics API matches detailed records -> pass
4. Surprise Three: Caching Changes the Cost Structure of Long Tasks
Long tasks involve a large amount of repeated prefix context (requirements, specifications, existing code). With cache hits, the repeated portion is not billed again, so the total bill usually grows less than the unit price increase. Practical advice: keep the prefix stable, isolate the variable suffix, and place large reference materials at the front to improve hit rates. Cost evaluation should look at “cost per task,” not just unit price.
5. The Unexpected: “Overthinking” on Lightweight Tasks
On simple problems like the “car wash problem,” the more capable version sometimes gave wrong answers after repeated deliberation, while the lightweight version was more direct and efficient. The reason is that a long chain of thought amplifies the probability of deviation on small problems and raises latency and consumption.
The response is to split traffic: route by task complexity, sending simple tasks to a lightweight configuration and complex tasks to a strong reasoning configuration; also set step and timeout limits to avoid infinite loops.
def route(task):if task.estimated_steps <= 3 and task.ambiguity == "low":return lightweight_config # low latency, low costreturn strong_reasoning_config # long-horizon planning + tool calling
6. Reasoning Stability: Both Strengths and Weaknesses
The model performed well on situational reasoning problems, but on high-difficulty math problems and some lightweight tests, it fell into loops or reached wrong conclusions. The improvement direction is not “longer thinking” but “verifiable intermediate artifacts”: enforce step-by-step output, introduce self-checks and external validation, and double-confirm key conclusions.
7. Implementation Checklist
- Requirements side: write acceptance criteria as an executable checklist to serve as the model’s self-verification basis;
- Execution side: set maximum steps, timeouts, and rollback points to prevent infinite loops;
- Observability side: use logging and monitoring alerts to reconstruct every action for review;
- Cost side: optimize context structure to improve cache hits, and account by task cost rather than unit price;
- Architecture side: route tasks by tier, using different configurations for simple and complex workloads.
8. Conclusion
The core conclusion from a test at the tens-of-millions-of-tokens scale is that long-horizon agentic coding has moved from “demo” to “usable,” but stability and cost need engineering safeguards. Making planning contractual, structuring feedback, and tiering tasks is the path to reliably converting model capability into productivity; and the combination of general capabilities from Baidu AI Cloud, including model services, container platforms, and logging and monitoring alerts, provides a practical runtime foundation for such long-horizon tasks.
