Evaluating Agentic Coding at Tens of Millions of Tokens: Engineering Practices for Reliable Delivery
Large token budgets and extended autonomous runs do not, by themselves, demonstrate software delivery quality. This article explains how to evaluate agentic coding through acceptance criteria, evidence-driven debugging, persistent task state, reasoning safeguards, and context management. It also outlines a practical evaluation workflow for measuring reliability, cost, and human intervention across repeated runs.
As large language models enter software development workflows, evaluation is shifting from “Is the answer correct?” to “Can the task be delivered?” A model may quickly generate an attractive interface without ensuring data consistency. It may also keep calling tools for an extended period without resolving the underlying fault. Consuming tens of millions of tokens and running autonomously for hours therefore indicates the scale of a test—not the quality of its outcome.
This article uses the engineering challenges of large-scale agentic coding as a starting point, focusing on general methods rather than individual products. The source material does not include a complete task set, execution logs, billing records, or independent replication results. It cannot support broadly applicable performance rankings. The more useful questions are how to assess long-horizon task execution, recognize reasoning breakdowns, and connect spending to business value.
1. Establish an Evaluation Baseline: Consumption Is Not Delivery Capability
An agentic coding system typically combines a model, a task controller, a tool execution environment, and a feedback mechanism. The model analyzes the task and proposes actions. The controller manages execution state. Tools perform file operations, tests, and builds, while the feedback mechanism returns results to the model.
The final outcome reflects the entire system, not the model alone. The same model can deliver substantially different results under different permissions, context arrangements, and testing conditions.
Before evaluating a system, record at least four categories of conditions:
- Task conditions: Requirements, the initial codebase, dependency constraints, acceptance criteria, and time budget.
- Execution conditions: Available tools, permitted network access, file permissions, and rules for human intervention.
- Inference conditions: Context capacity, output budget, history retention, and retry strategy.
- Measurement conditions: Input and output tokens, tool calls, failed attempts and retries, elapsed time, and cost.
“Worked continuously for an hour” demonstrates some ability to sustain execution, but it does not establish engineering quality. More meaningful measures include the number of acceptance criteria satisfied, defects introduced, human repairs required, and consistency across repeated runs.
2. From Code Generation to Closed-Loop Delivery
One of the most important advances in agentic coding is the ability to sustain a plan–implement–test–repair cycle around a goal, rather than merely produce a code draft.
Consider a bookkeeping application. The task involves more than creating a few tables and an entry form. A complete implementation must address account management, transaction entry, category-based reporting, record updates, search and filtering, and error handling. A multi-user application must also handle authentication and data isolation.
Autonomous Planning Must Produce a Verifiable Structure
An effective plan is not a lengthy to-do list. It identifies dependencies between modules and defines what completion means at each step. For example:
Requirements clarification → Data modeling → Core write logic → Queries and summaries → User interface → Automated validation → Delivery documentation
Data modeling shapes the APIs and interface that follow. If a model starts generating frontend code before deciding how to represent money, interpret timestamps, or associate records with accounts, later rework becomes more likely.
For bookkeeping, monetary values should generally not be stored or calculated directly using binary floating-point numbers. Fixed-precision numeric types or integers representing the smallest currency unit are alternatives, with explicit currency and rounding rules. These seemingly small modeling decisions determine whether aggregated totals are reliable.
Self-Correction Must Rely on External Evidence
A model’s claim that “the issue is fixed” cannot replace test results. A reliable feedback loop follows this sequence:
Execute an action → Observe the result → Compare it with expectations → Identify the discrepancy → Modify the implementation → Verify again
If adding a transaction fails, first distinguish among input validation, business logic, database constraints, and permission problems. Changing several modules at once makes diagnosis harder. Ideally, each repair should address a clear hypothesis and be confirmed by a targeted test.
Long-Horizon Tasks Need Persistent State
As execution continues, historical logs grow and important decisions can become buried. The current goal, completed work, failure causes, and unresolved verification questions should be maintained as structured task state.
A state summary should record more than “database completed.” It should preserve key constraints such as monetary units, deletion policy, uniqueness rules, and tests already passed. Otherwise, later changes may overturn an earlier correct design.
3. Turning Complex Reasoning into Engineering Value
Complex reasoning helps development primarily by identifying implicit constraints, tracing failure chains, and coordinating multi-step dependencies—not simply by solving abstract problems.
An incorrect financial total, for example, may involve duplicate submissions, transaction boundaries, time filters, and rounding rules. A model that develops causal hypotheses and tests them individually can reduce speculative changes.
However, longer reasoning does not necessarily mean greater accuracy. Additional analysis may expose an omission, but it may also amplify an incorrect initial assumption.
Convert Reasoning Conclusions into Tests
The most dependable engineering approach is to turn key judgments into executable checks. A bookkeeping application might enforce the following invariants:
- Submitting the same business request repeatedly must not create duplicate transactions.
- Updating a record must update the relevant summaries.
- Users must not be able to access one another’s data.
- Invalid amounts and incomplete fields must not be accepted as valid records.
- Deletion must follow the agreed data-retention policy.
These constraints provide stronger evidence than an interface that appears to work. One successful entry validates one path, not the reliability of the entire system.
Define Stop Conditions for Reasoning Breakdowns
An agent may repeatedly edit the same location, rerun failing commands, or restate the same explanation without gathering new evidence. Increasing its token budget at that point may not produce progress.
A task controller can monitor signals such as:
- Repeated failures without new diagnostic information.
- Multiple execution rounds without satisfying any acceptance criterion.
- Recurrence of the same action and error.
- An expanding scope of changes without improved test results.
When a stop condition is triggered, pause execution and preserve the current state. The next step may be to narrow the task, provide additional evidence, or hand it to a human. Thresholds should depend on the task type; no fixed retry count should be treated as universally appropriate.
4. Improving Cost Structure with Caching and Context Management
Long-running development tasks often reread requirements, project documentation, directory structures, and foundational code. If the service supports prefix caching and requests meet its cache-hit requirements, some repeated input may be billed at a different rate.
Caching does not mean all historical input automatically becomes cheaper. Cache granularity, expiration, minimum length, and request organization affect actual reuse. Consult the service’s official documentation for the applicable rules.
A general cost calculation is:
Total call cost = Uncached input volume × applicable rate + Cached input volume × applicable rate + Output volume × applicable rate + Other explicitly billed items
Two distinctions matter: caching may change the cost of processing some input, but it does not automatically improve answer quality. A cache hit also does not guarantee that the model will use the relevant information correctly.
Separate Stable and Changing Context
Long-lived development constraints and project documentation can occupy a relatively stable portion of the request, while current errors, recent changes, and new requirements go in a dynamic section. Where the service supports the relevant caching mechanism, this arrangement can help reuse stable content.
Do not retain obsolete instructions merely to improve cache-hit rates. Stale context may lead the model to reuse outdated interfaces, incorrect assumptions, or abandoned designs. Repairing those mistakes may cost more than the cache saves.
Do Not Return Every Log Verbatim
Long build logs, repeated errors, and unrelated files increase input volume and dilute useful information. A better approach is to retain error summaries, relevant call chains, key diffs, and necessary local code, while preserving raw logs for further inspection.
Compression must remain traceable and must not omit error details that could change the diagnosis.
Measure Cost per Accepted Task, Not Just Token Price
The real optimization target is the total resource cost of a deliverable that passes acceptance:
Cost per accepted task = (Model-call costs + Execution-environment costs + Human-review costs) ÷ Number of tasks that pass acceptance
Cheaper calls can produce higher total costs if they require more retries and rework. More expensive calls may be more economical for certain tasks if they reduce human intervention.
5. A Common Pitfall: Overcomplicating Simple Tasks
Strong reasoning capabilities do not guarantee better results on every simple problem. When a task depends on a clear real-world constraint, unnecessary assumptions can pull the model away from the goal.
For example, taking a vehicle to a car wash requires the vehicle to be present, even if the destination is nearby. An analysis focused only on walking distance can miss the actual object of the task.
The same failure mode matters in software development. A requirement to check whether a field is empty can become an elaborate data-compatibility framework, introducing unnecessary dependencies, branches, and maintenance costs.
The solution is not to reduce reasoning everywhere, but to allocate computation according to task risk and complexity:
- Use short workflows for highly deterministic tasks that are easy to verify.
- Use planning and staged checks for tasks with more dependencies or broader impact.
- Add verification and human confirmation for tasks involving money, permissions, or irreversible actions, even when they appear simple.
Task routing should not depend on text length alone. More relevant dimensions include ambiguity, dependency count, the cost of errors, reversibility, and verification difficulty.
6. A Practical Workflow for Evaluating Agentic Coding
Enterprise pilots can use the following steps to turn hands-on experience into engineering evidence.
Step 1: Select a Representative Task Set
Include feature development, bug fixes, missing-test coverage, and localized refactoring. Avoid evaluating only interface-generation tasks that are easy to demonstrate.
Step 2: Define Acceptance Criteria in Advance
Specify checks for functional correctness, permission isolation, data consistency, and build outcomes. Do not adjust the evaluation standard after seeing the output.
Step 3: Fix the Environment and Preserve the Process
Save the initial codebase, requirements version, tool permissions, change history, and test logs. Failures should be diagnosable, and successes should be reproducible.
Step 4: Add Stage Checkpoints
Validate after design, after core logic implementation, and before delivery. Detecting a faulty assumption earlier usually limits the scope of rework.
Step 5: Apply Least Privilege
Agents should operate in isolated environments and should not have production credentials by default. Data deletion, external publishing, and permission changes require explicit approval and rollback mechanisms.
Step 6: Repeat Runs and Examine Distributions
Track not only success rates but also elapsed time, cost, human interventions, and defect categories. A single run provides a case study; repeated runs provide evidence of stability.
Conclusion
The central question raised by large-scale token consumption is not how long a model can keep producing output. It is whether the system can turn reasoning into verified results at a reasonable cost.
Long-horizon planning, correction driven by external feedback, and sound context management can make agentic coding more useful. Reasoning breakdowns on complex tasks and excessive analysis on simple ones also show why a single capability metric cannot represent every scenario.
For developers and enterprises, the most reliable approach is to establish acceptance criteria first, then configure tools, permissions, budgets, and stop conditions. Distinguishing autonomous execution from reliable delivery is what moves agentic coding from a demonstration into a manageable engineering workflow.
