Long-Context AI Agents: 10 Million Tokens of Testing Reveal Three Breakthroughs and One Notable Weakness
We ran continuous agent tests spanning more than 10 million tokens across coding, database design, logic reasoning, math, Q&A, and long-task cost analysis. The results show clear progress in autonomous planning and sustained execution, along with meaningful gains from context caching—yet a surprising failure mode appeared: strong reasoning models can overthink simple questions and reach the wrong answer. This article breaks down the findings and offers practical recommendations for building reliable long-horizon AI agent workflows.
As large language models shift from answering single questions to autonomously completing tasks, the criteria for evaluating them are changing. Developers used to focus on whether a single response was accurate; today they care more about whether a model can understand vague requirements, decompose complex goals, call external tools, execute many steps in sequence, and correct itself after errors.
To observe this behavior in realistic conditions, we conducted continuous testing of general-purpose LLMs on agentic programming and reasoning, totaling more than 10 million tokens. The tests were not limited to isolated prompts; they spanned engineering development, database design, logical reasoning, math problems, simple Q&A, and the cost profile of long-running tasks.
The overall findings can be summarized as follows: long-horizon agentic capability has improved markedly, with autonomous planning and continuous execution performing impressively; complex reasoning remains strongly task-dependent; greater model scale and reasoning effort do not guarantee better answers on simple problems; and caching mechanisms can mitigate the cost pressure of long contexts.
The analysis below follows the order of capability gains, anomalies, engineering implications, and practical recommendations.
Finding 1: Long-Horizon Programming Tasks Now Show Strong Autonomous Execution
For this test, we designed a relatively open-ended database application development task. The prompt did not prescribe a complete table schema, page layout, or implementation steps. It stated only the business objectives, leaving the model to handle requirement analysis, database design, feature development, and verification on its own.
This differs significantly from code completion. Code completion typically requires generating a function or a module, whereas a long-horizon agent task requires the model to maintain a global objective continuously, handle dependencies across multiple files, and adjust its plan based on runtime results.
Upon receiving the task, the model did not immediately start generating code. Instead, it decomposed the requirements first. It planned core functional modules—including transaction recording, category management, ledger queries, statistical analysis, and data maintenance—and then designed the corresponding data tables.
From an engineering perspective, this step is critical. A working application is not a collection of isolated pages; the data model, business logic, and frontend interactions must stay consistent. If the model does not establish an overall structure first, several problems tend to arise:
- Page fields do not match database fields.
- Create, delete, and update operations use inconsistent data formats.
- Statistics pages fail to read historical records correctly.
- Features appear complete but lack error handling.
- Later changes to one module break other modules.
In this task, the model also produced a post-development verification checklist—for example, checking data creation, deletion, editing, category switching, statistics results, and page interactions. This shows it no longer treats a task as “write code and finish,” but incorporates testing and acceptance into the workflow.
Notably, the model was able to execute continuously for nearly 60 minutes without visible interruption, without losing the task context due to an error, and without abandoning the overall goal. It modified files based on execution results, reran the program, and continued advancing subsequent steps.
The practical value of this capability for developers is mainly threefold.
1. Reduced manual task decomposition
Traditionally, a user must break a large requirement into many small tasks and hand them to the model one by one. A long-horizon agent can take on part of the project management work: building a task list first, then executing the items in dependency order.
2. Better cross-file collaboration
Real projects contain configuration files, data models, interface layers, page components, and test code. If a model can only handle the current file, it cannot deliver complete features. Continuous-task capability allows it to maintain a longer engineering context.
3. A closed loop of execute–observe–correct
Generating code alone does not prove a program works. A model that can read error messages, locate the problem, fix the implementation, and verify again is much closer to a genuine automated development assistant.
That said, this does not mean the model can fully replace developers. In our tests, the application’s core features worked, but UI polish, interaction details, and exception handling still required human review. For production systems, permission control, data backup, audit logging, concurrency handling, and security testing remain essential.
Finding 2: Multi-Step Reasoning on Complex Logic Problems Has Improved
Beyond programming, we tested the model on complex logical reasoning. One class of problems required the model to progressively eliminate assumptions across multiple rounds of information, establish causal chains, and ultimately recover hidden conditions.
For such problems, the model typically organizes the known facts first, distinguishes “certain information” from “possible information,” and then validates candidate hypotheses one by one. Compared with jumping straight to a conclusion, this process suits problems requiring multi-step deduction.
A reasonably stable reasoning flow looks like this:
- Extract the entities, constraints, and conditions in the problem.
- Identify which information is factual and which is merely narrative.
- Build candidate hypotheses.
- Check whether each hypothesis is consistent with all conditions.
- Eliminate paths that produce contradictions.
- Deliver a conclusion with the key reasoning explained.
In testing, the model handled well-structured problems with clear constraints, maintaining long reasoning chains and returning to an earlier step to re-analyze when it detected a contradiction.
However, reasoning capability is not an absolutely stable metric. For problems requiring extensive precise computation, rigorous proof, or complex symbolic manipulation, the model can still produce outputs where “the process looks plausible but the conclusion is wrong.”
This failure mode deserves particular caution, because the model often explains an incorrect conclusion in fluent, well-structured language, which creates a strong impression of reliability. For high-stakes tasks in math, finance, and engineering computation, you cannot judge answer quality by how fluent the explanation is.
A safer approach is to require the model to output verifiable intermediate results, for example:
- Explicitly list the formulas used.
- Explain the meaning of each variable in every step.
- State boundary conditions.
- Perform reverse verification of key results.
- Cross-check with an independent program or manual calculation.
Finding 3: Context Caching Can Mitigate Cost Growth in Long Tasks
Long-horizon tasks repeatedly carry large amounts of context. As a conversation grows, each request may include the project description, historical code, execution logs, and prior decisions. If these contents are processed from scratch each time, token consumption climbs quickly.
The core idea of context caching is to reuse context that recurs within a short window and has not changed. In continuous development tasks, the following content typically has high reuse value:
- Overall project requirements
- Database table schemas
- Coding standards
- File directory descriptions
- Confirmed API contracts
- Historical execution results
- System prompts that rarely need modification
Caching does not eliminate new consumption entirely, because each turn may include new code, error messages, and tool outputs. But it reduces the extra processing caused by repeated context, so the actual cost growth of a long task can be lower than an estimate based purely on input length.
For enterprise users, the significance is not limited to cost savings; it also improves the sustainability of long workflows. If a task runs for dozens of minutes and every step resends the complete project background, costs rise and the probability of context conflicts increases.
When designing agentic workflows, context can be organized into three tiers:
- Stable context: project background, coding standards, fixed constraints—suitable for long-term reuse.
- Phase context: current module goals and recent modifications—updated as the task progresses.
- Transient context: error logs, command output, temporary reasoning—compressed or archived once the issue is resolved.
This layering reduces context redundancy and helps the model maintain focused attention.
The Unexpected Weakness: Overthinking Causes Failures on Simple Questions
The most notable phenomenon in our testing was that models were sometimes less stable on very simple questions.
Intuitively, a stronger model should handle basic questions easily. In practice, this is not always the case. When a model runs with a strong reasoning process enabled, it may overanalyze simple problems, repeatedly guess at hidden conditions, and keep constructing elaborate explanations even when the situation is already unambiguous.
This phenomenon can be called “overthinking.” It typically manifests as:
- Repeatedly re-interpreting the question.
- Continually introducing conditions not present in the problem.
- Switching back and forth between several similar answers.
- Analyzing for a long time without reaching a conclusion.
- Producing a final answer that departs from the most direct common-sense judgment.
For example, on simple everyday questions requiring only a basic conditional judgment, the model may overemphasize edge cases and ignore the most basic semantic relationship. Conversely, models with lower reasoning intensity and more direct response paths can sometimes give the correct answer faster.
This shows that model capability is not monotonic: more reasoning does not guarantee a better result. Different tasks call for strategies matched to their complexity.
A tiered approach works well:
- Simple Q&A: require a direct answer with minimal elaboration.
- Structured tasks: require listing steps first, then executing.
- Complex reasoning: require key evidence and a verifiable process.
- Engineering development: allow tool calls and set acceptance checkpoints.
- High-risk tasks: mandate human review or introduce independent verification programs.
Implications for Development: Evaluate the Complete Loop, Not Just the Answer
The greatest value of this evaluation is not proving that one model is “absolutely stronger,” but showing that model evaluation must move from single-turn answers to complete task loops.
An evaluation framework closer to real usage should include at least the following metrics:
1. Task completion rate
Whether the model actually achieves the goal, rather than merely producing plausible code or explanations.
2. Continuous execution stability
During long runs, does it interrupt, forget the goal, loop indefinitely, or repeatedly modify the same part?
3. Self-correction capability
When facing runtime errors, failing tests, or conflicting requirements, can it locate the cause and take effective corrective action?
4. Output verifiability
Does the model provide enough intermediate information for developers to judge whether the result is trustworthy?
5. Cost and latency
How many tokens, interaction rounds, and how much time are needed to complete the same task—and is that viable at scale?
6. Human intervention frequency
If a human must correct the model every few minutes, its automation value drops sharply.
Therefore, when enterprises introduce AI-assisted programming, they should not rely on a few demo-style Q&A sessions. Instead, they should use test projects resembling real business work—internal management systems, data-processing scripts, API services, or automated operations workflows—and record the full process data.
Practical Recommendations: Making Long-Horizon Agents More Reliable
To reduce the risks of long-running tasks, incorporate the following mechanisms into your workflow:
First, plan before executing. Require the model to output the task decomposition, file list, data structures, and acceptance criteria; confirm the overall plan before allowing code changes.
Second, set phase checkpoints. After each module is completed, run its tests, so errors don’t accumulate and surface only at the end.
Third, limit unproductive loops. If the same error recurs, require the model to summarize the approaches already tried and switch to a different troubleshooting path rather than repeating itself indefinitely.
Fourth, retain human approval gates. Changes involving database schemas, permissions, security configuration, and production releases must be confirmed by a developer.
Fifth, separate exploration from production environments. The agent may freely create files, run tests, and modify code in an isolated environment, but must not directly touch real data or perform high-risk operations.
Sixth, maintain traceable logs. Record the requirements the model received, the tool calls it made, the files it modified, and test results, to support audits, rollbacks, and problem localization.
Conclusion
Our testing across more than 10 million tokens shows that current large models have made significant progress in long-horizon agentic programming: they can understand open-ended requirements, plan complex tasks, continuously call tools, and self-correct to a meaningful degree. At the same time, complex reasoning remains inconsistent, and overthinking on simple problems reminds us that model capability cannot be measured solely by parameter count or reasoning length.
The more sensible approach is to select reasoning strategies dynamically based on task difficulty, and to build a complete engineering loop around testing, logging, caching, and human review. For developers, the real goal is not to make the model “think more,” but to make it think enough on the right tasks, execute continuously, produce verifiable results, and remain under control at all times.
