10-Million-Token Evaluation: Surprises and Pitfalls of Agent-Based Coding
A large-scale evaluation consuming more than 10 million tokens examined agent-based coding, complex reasoning, lightweight tasks, and invocation cost. Newer open-source models show clear gains in planning, long-horizon execution, and tool use, but still struggle with stability, overthinking, and unclear stopping conditions. This article recaps three practical surprises, one important failure mode, and engineering practices to turn demos into reliable workflows.
10-Million-Token Evaluation: Surprises and Pitfalls of Agent-Based Coding
In a deep evaluation of large-model agent capabilities, we consumed more than 10 million tokens and observed four dimensions: agent-based coding, complex reasoning, lightweight tasks, and invocation cost. Overall, a new generation of open-source models has made clear progress in autonomous planning, long-horizon execution, and tool collaboration. On consecutive engineering tasks, they can already approach the working style of a junior developer assistant. On some simple tasks and hard reasoning tasks, however, they still show insufficient stability, overthinking, and unclear stopping conditions. This article does not target a specific product. From a general technical perspective, it reviews the evaluation, extracts three surprises worth attention, one unexpected issue that must be taken seriously, and practical engineering recommendations.
Why a 10-Million-Token Lens for Agent Capability
Traditional LLM evaluation often relies on single-turn Q&A, fixed question banks, or short-text generation. Those methods can measure basic language ability quickly, but they rarely reflect performance in real development work. Agent-based coding is not ordinary code generation. It requires multi-step planning, context retention, tool use, error localization, result verification, and continuous correction. The focus shifts from “can it write a snippet” to “can it independently complete an engineering goal.”
This evaluation therefore raised token consumption to the 10-million scale and used several task types: long-horizon engineering work such as database design and application prototypes; complex logical reasoning; and lightweight tasks that look simple but actually test instruction following and stop decisions. We also watched cache reuse, context compression, and cost changes on long tasks. That design is closer to real business: developers care not only whether a model can answer, but whether it can keep producing usable results at a controllable cost.
Surprise 1: Long-Horizon Tasks Improved, Continuous Autonomous Execution Became Real
The most obvious surprise was autonomous execution on long-horizon tasks. We gave a relatively open goal—for example, “design a database that supports bookkeeping, category management, and transaction statistics, and complete basic functional verification”—without step-by-step prompts or human intervention at every step. The model first produced an overall plan, including modules, table structure, development order, and a verification checklist, then kept executing.
The hard part is not writing one piece of code, but keeping long-context consistency. The model must remember the goal, constraints, completed steps, and items still to verify. If it forgets requirements or repeatedly edits the same module, the task falls into an inefficient loop. In this evaluation, the model could run continuously for nearly an hour without obvious interruption, dead loops, or missing key steps, showing improved task decomposition and state tracking.
From an engineering view, this capability can be abstracted into three layers:
- Task planning: produce architecture and module split first, rather than dumping code immediately.
- Execution control: follow the plan and try to correct errors when they appear.
- Result verification: generate test cases or checklists instead of delivering only surface results.
A schematic task prompt:
Goal: build a minimum viable bookkeeping system.Requirements:1. First output module breakdown and table design;2. Then implement core features step by step;3. After completion, generate at least 10 verification items;4. If execution fails, locate the cause and fix it;5. Do not skip verification.
The point of such prompts is not “make the model write code,” but to turn an agent task into a traceable workflow. For enterprise developers, this means models can evolve from code-completion tools toward task-execution agents. That does not mean fully unattended operation. A more reasonable approach is stage confirmation, with human review at architecture design, database changes, permission-related logic, and pre-release checks.
Surprise 2: Complex Reasoning and Tool Collaboration Improved, but Stability Remains the Key Variable
The second surprise came from complex reasoning. On tasks that need multi-step reasoning, condition transformation, and identification of hidden assumptions, the model showed stronger logical decomposition. On structurally complex logic puzzles, it could list known conditions, eliminate conflicts, and then conclude. Compared with earlier models that often “guessed the answer,” this process is closer to explainable reasoning.
Complex reasoning is not the same as stable reasoning. On hard math problems or heavily constrained tasks, two issues still appeared: reasoning chains that grew too long and drifted from the goal, and repeated attempts along the same path without leaving a wrong branch. Stronger reasoning still needs external constraints and checks.
In practice, “externalize the reasoning process” can reduce risk:
- Split a hard problem into subproblems, one goal per step.
- Require intermediate conclusions, not only a final answer.
- Add rule checks or code execution for critical steps.
- Set a maximum retry count to avoid infinite loops.
- Review high-risk conclusions a second time.
For math or logic tasks, require variable definitions, constraints, and a derivation path before the answer. If the answer involves calculation, verify it in code. That turns internal model reasoning into an observable, verifiable, and rollback-capable process.
Surprise 3: Long-Task Cost Does Not Grow Strictly Linearly; Caching and Context Reuse Create Headroom
The third surprise was about cost. Long tasks usually mean more tokens, but in continuous coding and repeated-context scenarios, reasonable caching can reduce the overhead of repeated computation. Overall call prices may still change, but the growth of a long-task bill is not fully equal to linear growth in token count.
Agent tasks typically contain a large amount of repeated context: system prompts, project structure, historical code, error logs, and completed steps. Reprocessing the full context every time drives cost up quickly. Reusing existing context or caching intermediate results can cut that waste.
Developers can optimize cost in several ways:
- Trim context: keep only information strongly related to the current step; do not dump all historical logs.
- Execute in stages: split large work into design, coding, testing, and repair, with independent context per stage.
- Structured summaries: replace long history with a short recap, such as “module A is done, current error is B, next fix is C.”
- Cache reuse: reuse stable system instructions, API specs, and project structure.
- Budget control: set token and retry caps per task type to avoid runaway spend.
A schematic context summary:
Project goal: bookkeeping systemDone: table structure, category module, transaction entry moduleCurrent issue: stats API returns empty dataNext: inspect query conditions and date-filter logicConstraint: do not change existing tables unless a migration plan is provided
This structured context uses fewer tokens than raw long text and helps the model stay aligned with the goal.
The Unexpected Issue: Lightweight Tasks Can Fail; Overthinking Is a New Problem
In contrast with long-horizon tasks, lightweight tasks produced surprises of a different kind. On simple questions that should be answered directly, the model sometimes over-analyzed, repeatedly confirmed conditions, and even continued reasoning after a clear answer already existed, then produced a wrong conclusion. This is not lack of ability, but a mismatched strategy: the model treats a simple task as a complex one, lengthens the chain, and leaves the minimum viable answer.
If a everyday simple question keeps expanding assumptions and adding unnecessary variables, a clear answer becomes complicated. A lighter model or a more direct answering strategy can be more efficient. Not every task needs deep thinking. Agent systems need difficulty judgment and strategy switching.
Three mitigations:
- Task grading: first decide whether the task is simple Q&A, code generation, or complex planning, then choose reasoning depth.
- Clear stop conditions: state in the prompt, “if conditions are sufficient, give the conclusion directly.”
- Limit reflection: for example, at most one self-check, to avoid endless review.
Schematic prompt:
This is a simple question. Answer directly from the given conditions.If the information is already sufficient, do not add extra assumptions.Perform at most one self-check, then output the final answer.
These constraints look simple, but they can improve stability on lightweight tasks. For productized applications this matters, because users usually want fast, accurate, low-cost answers to simple questions, not a long thinking process.
Engineering Recommendations: Turn Surprises into Stable Productivity
Taken together, the 10-million-token evaluation supports a clear conclusion: agent-based coding already has real productivity, but moving from impressive demos to stable delivery still needs engineering governance.
1. Constrain behavior with task templates
Do not let the model run critical work in a fully open state. Provide goal, scope, constraints, output format, and acceptance criteria. The more complex the task, the more a structured template is needed.
2. Build a verification loop
The most common agent failure is not inability to write, but “it looks finished.” Introduce verification: unit tests, API checks, log analysis, and human sampling. The model can generate the checklist, but the engineering system should execute it.
3. Add circuit breakers and rollback
Long-horizon tasks need maximum runtime, maximum retries, and an exception exit. If the model loops or makes destructive changes, it should roll back quickly to the last stable state.
4. Differentiate reasoning depth
Use a light strategy for simple tasks and a deep strategy for complex ones. This can be done with a pre-classifier, rules, or explicit user choice. Do not cover all scenarios with one reasoning mode.
5. Treat cost governance as a design default
Token budgets, cache strategy, context compression, and stage summaries should be default capabilities of an agent system, not after-the-fact optimizations. Long tasks especially need cost dashboards and alerts.
Conclusion: Agent Coding Is Stronger, but Boundaries Remain
This 10-million-token evaluation shows clear progress in long-horizon planning, autonomous execution, tool collaboration, and complex reasoning. Models can complete database design, feature development, and a verification loop with relatively little human intervention, and they can decompose complex logic tasks. Caching and context reuse also open new room for cost control on long tasks.
The unexpected issues still matter: overthinking on lightweight tasks, instability in hard reasoning, and goal drift on long tasks all show that agents still need external constraints and engineering control. Future competition is not only about parameter count or single-answer quality, but about who can package model ability into controllable, verifiable, auditable, and optimizable workflows.
For developers and enterprise users, the practical path is not blindly chasing full automation, but a human–machine agent architecture: let the model plan, generate, and do first-pass repair; let the engineering system constrain, verify, and roll back. Only then can large models move from demos to production, and from surprise to stability.
