Evaluating AI Agents at Million-Token Scale: Capability and Cost Boundaries in Agentic Coding

    This article examines what a cumulative observation of more than 10 million tokens reveals about AI agents in real development workflows. It shifts the focus from token consumption to verified engineering output and covers long-horizon autonomous coding, complex reasoning, lightweight-task routing, caching and cost accounting, and a reproducible evaluation process. Readers get a practical framework for measuring capability, reliability, latency, and total cost together.

    1. From “How Many Tokens Were Consumed” to “How Much Verified Work Was Completed”

    When AI agents enter real development workflows, evaluation should not stop at whether a single response is fluent. The more practical question is whether the agent can continuously complete verifiable engineering tasks within clear permissions and budgets.

    The source material describes an observation involving more than 10 million cumulative tokens across autonomous coding, logical reasoning, simple Q&A, and invocation cost. At this scale, problems that are hard to see in short demos can surface, such as error accumulation, tool-call failures, repeated revisions, and cost changes caused by long context. However, token consumption alone cannot prove that an evaluation is representative, and it certainly cannot directly establish reliability in other environments.

    If most tokens come from repeated attempts, the same type of task may be oversampled. If there are no predefined acceptance criteria, a long-running process may simply keep generating plausible content. A professional evaluation therefore needs to record task distribution, success rate, human intervention count, tool-call results, and actual spending together.

    From an engineering perspective, three positive directions are worth attention: long-horizon tasks can form execution closed loops; complex reasoning can be made more reliable through external verification; and repeated context may reduce some costs through caching. Alongside these is a counterintuitive phenomenon: systems that reason more thoroughly are not necessarily better at simple questions. Understanding these phenomena is more valuable than labeling a model as “strong” or “weak.”

    2. Long-Horizon Autonomous Coding: Closure Quality Matters More Than Runtime

    2.1 What Basic Steps Does Autonomous Execution Require?

    Long-horizon coding is not about extending a single code generation step. It is a continuous loop of understanding requirements, making plans, calling tools, observing results, and revising solutions.

    Consider a database design task. The agent first needs to identify business entities, data relationships, and consistency requirements. It then selects fields, constraints, and indexes, and later validates query and update behavior with test data. If tests fail, it must distinguish among a misunderstanding of requirements, a design defect, and a test-environment problem.

    Therefore, an execution time of more than one hour only shows that the system remained active. It does not by itself prove high-quality delivery. More important indicators include:

    • Whether all necessary requirements are covered;
    • Whether key tests pass;
    • Whether regressions are introduced into existing functionality;
    • Whether auditable and reproducible deliverables are produced;
    • Whether human correction of direction is required;
    • Whether the work is completed within the specified budget.

    These indicators should be defined before the task starts, so that the evaluation standard is not adjusted afterward based on the output.

    2.2 How to Control Error Accumulation in Long Tasks

    One major risk in long-horizon tasks is that an early misunderstanding gets amplified. For example, if the agent incorrectly judges a data uniqueness requirement, subsequent interfaces, tests, and migration logic may all be built around that assumption. As more content is generated, the cost of correction rises.

    A safer approach is to set staged acceptance points:

    The first stage confirms requirements, assumptions, and non-goals, and clarifies which information is settled and which still needs to be asked.

    The second stage produces a design draft and reviews module boundaries, data structures, and key constraints.

    The third stage delivers a minimal runnable version and validates the core path with a small number of end-to-end tests.

    The fourth stage completes exception handling, boundary cases, and necessary performance checks.

    The fifth stage organizes change notes, known limitations, and rollback steps.

    Staged acceptance does not always require human intervention. Items that can be judged by tests and rules can be checked automatically. Items involving business interpretation, permission changes, and irreversible operations should retain human confirmation.

    2.3 Autonomy Must Be Designed Together with Permission Boundaries

    Tool-calling capability expands what an agent can execute, and it also expands the impact of errors. Being able to read code does not mean the agent should automatically modify production configuration. Being able to run tests does not mean it should delete data to “fix” a failure.

    A recommended approach is to divide operations into read-only inspection, recoverable modifications, and high-risk changes. Read-only operations can be given a higher degree of autonomy. Recoverable modifications should be limited to isolated workspaces and retain change records. Operations involving important data, permissions, or external resources should require explicit approval.

    Valuable autonomous coding reduces repetitive work within controlled boundaries; it does not remove all human oversight.

    3. Complex Reasoning: Complete Expression Does Not Guarantee Reliable Conclusions

    3.1 Different Reasoning Tasks Require Different Evaluation Methods

    Open-ended logic puzzles usually allow the hypothesis space to be narrowed through questioning. The system needs to keep conditions consistent, detect contradictions, and revise explanations. Strict mathematical problems require every step of derivation to satisfy formal constraints; missing one condition can invalidate the entire conclusion.

    Both types are called “reasoning,” but their success mechanisms are different. A system that is good at proposing reasonable hypotheses is not necessarily able to complete rigorous proofs reliably. Being able to write a detailed derivation does not mean the derivation contains no hidden errors.

    Evaluation should therefore distinguish at least three task types:

    • Exploration tasks with incomplete information, focusing on question quality and hypothesis updates;
    • Well-specified solving tasks, focusing on answer correctness and constraint coverage;
    • Proof-required tasks, focusing on derivation validity and the scope of applicability of the conclusion.

    Mixing them into a single total score can easily hide real capability boundaries.

    3.2 Why Reasoning Can Fall into Loops

    Common loops include restating conditions repeatedly, retrying the same method, switching among multiple guesses, and ignoring counterexamples that have already appeared. These phenomena should not be reduced simply to “thinking too much.” The more specific problem is that the search process is not gaining new information, or the system is not using feedback correctly.

    The following control strategies can help:

    • Set budgets for total time, tokens, and tool calls;
    • Limit consecutive reasoning rounds that produce no new evidence;
    • Record attempted methods and failure reasons to reduce repeated search;
    • Require the current conclusion, evidence, and remaining obstacles at the end of a stage;
    • Stop after exceeding the budget instead of extending reasoning indefinitely.

    Stopping is not the same as failure. For problems that cannot be solved reliably, clearly reporting unverified steps is often more valuable in engineering than giving a confident but incorrect answer.

    3.3 Hand Reasoning Results to Independent Verification

    In coding tasks, output can be verified with tests, static checks, and runtime results. In numerical problems, units, orders of magnitude, and boundary conditions can be checked. In logic tasks, counterexamples can be sought or constraints can be checked for full satisfaction.

    Verification should preferably not consist only of asking the same system to re-explain its conclusion. Two similar answers may share the same incorrect assumption. A more reliable approach is to use independent check paths, such as recalculating from input conditions, testing boundary samples, or having a review step specifically look for counterexamples.

    One boundary must be retained: passing tests only proves behavior in covered scenarios; it does not automatically prove correctness in all cases. The scope of verification should be stated together with the final conclusion.

    4. The Surprise of Lightweight Tasks: Why More Reasoning Can Lower Accuracy

    4.1 Simple Questions Also Have Key Constraints

    Some everyday common-sense questions appear to be only about comparing distance or time, but the actual answer depends on the conditions necessary to complete the task. For example, when going to a nearby location for a vehicle-related service, it is not enough to consider how the person will get there; whether the vehicle itself needs to be present is also required.

    If the system ignores the core constraint but keeps expanding secondary factors such as weather, traffic, and physical effort, it may produce complex but incorrect advice. This phenomenon shows that response length is not the same as effective reasoning.

    For lightweight tasks, a reasonable process is usually: identify the goal, extract necessary conditions, determine whether ambiguity affects the answer, and then answer directly. Only when missing information would actually change the result should a follow-up question be asked.

    4.2 Use Task Routing Instead of Uniform High-Intensity Reasoning

    Using the same execution strategy for every request can increase latency and expose simple tasks to unnecessary assumptions.

    A layered routing approach can be established:

    • Format conversion, deterministic rule handling, and simple information extraction should prefer lower-overhead paths;
    • Multi-condition decisions, routine analysis, and general coding tasks can use a standard reasoning flow;
    • Long-horizon development, complex proofs, and high-risk decisions should use more thorough planning and verification.

    Routing can also fail, so an escalation mechanism is needed. When the system detects conflicting constraints, verification failures, or ambiguous requirements, it should move to a stricter process. The goal is not always to use the fewest resources, but to match resource investment to task difficulty and the cost of failure.

    5. Cost Accounting: Caching Reduces Fees but Does Not Replace Efficiency Management

    5.1 Distinguish Input, Output, and Cache Hits

    Long-horizon tasks often resend requirement descriptions, tool definitions, and historical context. If a service supports input caching and the request meets its hit conditions, the repeated portion may be billed differently from ordinary input.

    A general cost estimate is:

    Total call cost = uncached input tokens × unit price + cached input tokens × unit price + output tokens × unit price.

    Specific billing items should follow the actual service rules. Different services may define cache conditions, expiration periods, and billable scope differently, so caching should not be treated as a guaranteed discount.

    5.2 Cache Hit Rate Is Not Task Efficiency

    Even if the cost of repeated input falls, the agent may still consume large amounts of output tokens and occupy test environments and tool execution resources. If it repeatedly revises the same code without progress, caching only reduces part of the repeated cost; it does not solve ineffective work.

    A more useful metric is “cost per accepted task.” The calculation should include failed retries, external tool execution, runtime environment, and human review costs.

    Latency also needs to be recorded separately. A lower-cost task that takes a long time may not be suitable for interactive workloads. A higher-cost task that clearly reduces manual rework may still be economical.

    5.3 Control Context Growth

    As a task progresses, historical logs, old plans, and repeated explanations tend to accumulate. It is advisable to regularly organize a structured task state covering current goals, completed items, unresolved issues, key decisions, and necessary evidence.

    However, compressing context carries a risk of information loss. Full logs should be kept in separate records and retrieved when review is needed. Critical constraints, failure records, or acceptance evidence should not be deleted merely to save input costs.

    6. Build a Reproducible Evaluation Process

    First, build a layered task set covering simple Q&A, constrained reasoning, single-module coding, and multi-stage engineering tasks. Each task category should include normal cases, boundary cases, and invalid inputs.

    Second, fix the run conditions and record prompting method, tool permissions, context strategy, budget caps, and runtime environment. When conditions differ, result differences cannot be attributed simply to model capability.

    Third, define acceptance rules in advance. Coding tasks need checks on tests and change quality; reasoning tasks need checks on conclusions and constraints; lightweight tasks should focus on whether the core intent is captured accurately.

    Finally, classify failures into requirement misunderstanding, knowledge gaps, planning errors, tool failures, insufficient verification, and budget exhaustion. Different failure causes require different improvements; they should not all be handled by increasing reasoning time.

    Conclusion: Evaluate Agents by Verified Effective Output

    The value of large-scale usage observation lies in discovering how systems succeed, how they fail, and whether they can recover after failure. Long-horizon execution, complex reasoning, lightweight-task response, and caching costs should be brought into the same engineering governance framework rather than discussed in isolation.

    For developers, the most important goal is not to make an agent run longer. It is to give every stage a clear objective, every high-risk operation a boundary, and every output a verification path. Only by measuring capability, reliability, latency, and total cost together can we judge whether autonomous execution reduces work or simply shifts it into later review and rework.