AI Coding Agent Evaluation: How to Read Pass Rates and Cost

    AI coding benchmarks have shifted from function-level code completion toward long-horizon autonomous tasks, which changes how engineers should evaluate agents. This article explains how to read the leaderboard: what pass rate actually measures, why average task completion is a useful process metric, and how average time and cost decide whether an agent can scale. It covers the engineering factors behind rising pass rates and falling cost, how to build a correct cost model while avoiding traps like Simpson's paradox, and how to stand up an in-house evaluation pipeline built on a representative, isolated, and layered task set. It closes with selection advice and common pitfalls, from the "leaderboard champion" bias to the non-linear crossover between cost and capability.

    1. A New Signal from the Leaderboard: From Code Completion to Long-Horizon Autonomous Tasks

    A recent revision of an AI coding benchmark published a new round of results for code agents on long-horizon tasks. The leaderboard shows a notable structural shift: within the same generation family, agents roughly doubled their task pass rate versus the previous version, while average per-task time dropped noticeably and average cost fell as well.

    The core message is that the yardstick for measuring code agents is moving away from “is the next line of code correct” toward “can the agent independently carry a complete engineering task from start to finish without human intervention.”

    To understand this shift, it helps to trace how task shapes have evolved. Early code-generation benchmarks were mostly function-level completion: given a signature and a docstring, fill in the function body, then judge correctness with a handful of unit tests. These tasks have clear boundaries, short context, and can be done in a single turn, so they cannot really test a model’s long-range planning or self-correction abilities.

    Under the long-horizon paradigm, benchmark items look more like a real work ticket. Typical forms include:

    • Fixing a bug that only reproduces reliably under a specific combination of configurations;
    • Adding a cross-module feature in a repository of hundreds of thousands of lines while keeping all existing tests green;
    • Completing a dependency upgrade, an API migration, or a large-scale mechanical refactor;
    • Locating an issue and producing a mergeable change in an unfamiliar project, working from a requirements doc and existing conventions.

    Tasks like these often require an agent to make dozens to hundreds of tool calls, looping through “read code → form a hypothesis → modify → run tests → read errors → modify again.” As a result, the leaderboard’s “average time per task” is not the time of the model’s own inference — it is the total wall-clock time to complete a single task end to end. In essence, it measures the agent’s autonomy, convergence speed, and execution efficiency.

    When the evaluation target changes like this, selection logic changes too. When engineers evaluate a code agent, what they care about is no longer just “can it write correct code,” but four questions: Can it complete tasks reliably? What counts as “done”? How long does it take? How much does it cost? The rest of this article breaks these down one by one.

    2. Reading the Leaderboard: Four Core Metrics and Their Derived Measures

    2.1 Pass Rate: The Strictest Metric, and the Most Easily Misread

    The pass rate (also called resolution rate or task success rate) is the share of tasks that satisfy all acceptance conditions, typically judged on an all-or-nothing basis: the code must build, must not break any existing test, and must pass all hidden acceptance cases to count as passed.

    Its strengths are that it is objective, reproducible, and hard to fudge. Its weakness is that it is too rigid — it cannot distinguish “just missed” from “way off,” and it can easily hide the real cause, such as a failed dependency install or a flaky test. Moreover, if unit tests are the only criterion, a model may still write “special-cased solutions that target the tests” — satisfying the assertions without actually implementing the intended business logic. So beyond automated runs, it should be complemented with manual spot checks and semantic review.

    2.2 Average Task Completion: A Process Metric That Measures How Far the Work Got

    Completion reflects how far a task was pushed. Common definitions include:

    • The share of acceptance cases passed out of all cases;
    • The share of planned subtasks confirmed complete;
    • A weighted score combining code checks, build, static scanning, and test results.

    This metric distinguishes “slightly missed” from “badly off course” and is a key input for locating where to improve. For example, two approaches may both have a 24% pass rate, but if their average completion rates are 85% and 62% respectively, the former is closer to a usable state and only needs to shore up capability on the long-tail hard cases, whereas the latter may reveal systematic flaws in planning or tool use. For engineering adoption, completion has an extra benefit: a high-completion artifact that did not fully pass can often serve as a starting point for a human to take over, significantly lowering the overall marginal cost.

    2.3 Average Time and Average Cost: What Determines Whether You Can Scale

    The former is the wall-clock time for a single task from start to finish, affected by the number of model calls, tool execution time, test run time, and queueing and retry policies. The latter is the resource cost of completing a task, mainly the input/output cost of model calls plus the compute and storage overhead of tool execution.

    Together they determine how many tasks you can produce per unit of time. Whether a team can integrate a code agent into its daily workflow usually does not depend on whether it is “the most capable,” but on whether, at an acceptable quality level, it can support enough concurrency and a budget the team can afford.

    2.4 Derived Metrics: Turning Raw Data into Decisions

    Metric How it is calculated What it tells you
    Cost efficiency (pass rate per unit cost) pass rate ÷ average cost How much effective output you get per unit of budget
    Cost per completed task total cost ÷ number of passed tasks The real cost of each successful delivery, after excluding failed tasks
    Effective throughput concurrency × pass rate ÷ average time Effective task output per unit of time
    Stability (pass rate variance) standard deviation of results across repeated runs of the same task How reproducible the results are

    In practice, it is best to present both “pass rate” and “cost per completed task” in a report. Looking only at pass rate can lead you to pick an “expensive but works” option; looking only at cost can lead you to pick a “cheap but barely works” option.

    3. The Technical Paths Behind Rising Pass Rates

    Doubling the pass rate while lowering both time and cost — this “more capable and more efficient” combination is not a coincidence. It comes from several engineering factors working together.

    3.1 From Single-Pass Generation to Multi-Turn Closed Loop

    A single forward generation pass struggles with cross-file changes. Modern code agents generally use a tool-calling loop: retrieve and read relevant code, propose modification hypotheses, apply changes, run build and tests, read failure output, then revise. The longer the generate-execute-verify loop, the more chances the agent has to self-correct, so pass rates rise naturally. At the same time, reads and retrievals that can run in parallel reduce serial waiting, shortening end-to-end time.

    3.2 Context Management Decides Whether the Model “Sees Everything” or “Drowns”

    The hard part of long-horizon tasks is often not the code itself but locating the right place. Effective engineering practices include:

    • Prioritizing code symbol indexes and dependency relationships over brute-force whole-repo search;
    • Layered summarization of very long context, with key snippets available for recall;
    • Compressing historical interactions in long sessions to avoid repeatedly carrying irrelevant content.

    The more precise the context, the less ineffective exploration, and the lower the input consumption.

    3.3 Verifiable Feedback Is the Cheapest Quality Signal

    Passing build, test, and static-check results back to the agent in a structured way is like giving it an objective evaluation function. Compared with self-assessment, this feedback hardly ever “self-deceives.” The prerequisite is that the evaluation environment must be highly reproducible: locked dependency versions, controllable build caches, and a clean execution environment.

    3.4 Diminishing Returns of Search and Sampling Strategies

    Sampling a task multiple times and picking the best does raise pass rates, but cost grows several-fold and marginal returns diminish. The mature approach is usually layered execution: lightweight tasks use single-pass generation with fast validation; only high-difficulty tasks enable multiple attempts and fallback strategies, balancing cost against pass rate.

    3.5 Cost Reductions Usually Come from “Structural Optimization,” Not “Lower Unit Prices”

    Specific means include: reusing repeated system prompts and repository context through prefix caching; using smaller-parameter models for auxiliary work like retrieval, classification, and summarization while reserving larger-parameter models for key decisions and code generation; and setting budget limits on tool calls and output length to terminate clearly ineffective attempts early.

    4. Calculating Cost: You May Have Been Doing It Wrong

    The “average cost” in a leaderboard looks intuitive, but the actual definitions vary widely. One common mistake is counting only model-call costs while ignoring tool-execution and storage overhead. Another is counting only successful tasks, spreading the cost of failed tasks outside the “cost per successful delivery” figure.

    A cost model like the one below is recommended (units are up to you):

    1. # Illustrative cost breakdown; unit prices are examples only.
    2. # Actual pricing follows the official billing of whichever model service you use.
    3. unit_cost =
    4. input_tokens * price_input # input tokens that miss the cache
    5. + cached_input_tokens * price_cached_input # input tokens that hit the prefix cache, usually discounted
    6. + output_tokens * price_output # generated code and reasoning output
    7. + tool_calls * price_per_tool_call # tool execution and sandbox compute overhead
    8. + sandbox_hours * price_per_sandbox_hour # occupancy time of the isolated environment
    9. + retry_count * overhead_per_retry # hidden cost of failed retries and rollbacks

    One algorithmic trap worth emphasizing is Simpson’s paradox: if two approaches are evaluated on different task mixes, their overall costs cannot be compared directly. Suppose approach A is good at simple tasks and approach B is good at complex ones, and the evaluation set is mostly simple tasks — then A’s “lower average cost” may come entirely from task composition and have nothing to do with which approach is actually better. The correct method is to fix the same batch of tasks, bucket statistics by difficulty, then aggregate and compare.

    On that basis, compute “cost per completed task” as well:

    1. # Count only passed tasks, excluding failed samples
    2. cost_per_passed = sum(unit_cost for all runs) / count(passed tasks)

    This metric answers a very practical question: how much extra did you pay to push a task that would otherwise have failed into success? If an approach doubles its pass rate but its cost per completed task rises fivefold, its real-world usability in production may actually drop.

    5. Building Your Own Evaluation: Key Steps for In-House Adoption

    A leaderboard can only answer “who is stronger,” not “who fits your codebase.” If a team plans to bring code agents into its development workflow, it is worth building a lightweight evaluation pipeline.

    5.1 Three Principles for Building the Task Set

    • Representative: Tasks should come from real business scenarios, such as historical bug tickets, real change requests, or modules awaiting migration;
    • Decidable: Each task must have a clear acceptance method, ideally driven mainly by automated tests or structured checks;
    • Contamination-resistant: Avoid using problems from public benchmarks, so that model training data does not already cover those samples and inflate results.

    5.2 Isolated Execution and a Reproducible Environment

    Evaluation containers should follow a “least privilege, no external network, read-only credentials” principle: no access to real production data, no exposure of internal credentials, and snapshots plus restoration of the codebase before and after each run. Dependency versions, runtime versions, and toolchains must be pinned, otherwise results cannot be reproduced.

    5.3 Layered Execution to Control Cost

    A three-tier strategy works well:

    • Smoke tier: run on every model iteration or prompt change, with a small number of tasks of varying duration;
    • Regression tier: run daily on a schedule, covering the main business modules;
    • Difficulty tier: run weekly, focused on cross-module, long-horizon tasks that require deep reasoning.

    5.4 Track the Core Metrics and Set Gates

    Continuously record pass rate, completion, time, cost, and stability, and use pass rate as one of the release gates: block the change if it falls below a threshold. Also watch for metric drift — when a model’s pass rate on a fixed evaluation set stalls over the long term, it means the set has been “gamed” and needs fresh tasks.

    5.5 Using General Cloud Capabilities to Host the Pipeline

    If a team wants to run evaluation in the cloud, it can combine general-purpose capabilities from cloud platforms (for example, Baidu AI Cloud): a container platform to host isolated sandboxes and parallel tasks, object storage to hold task data and evaluation artifacts, a logging service to record tool calls and failure reasons, monitoring and alerting to set thresholds for cost and failure rate, and a message queue to distribute tasks and aggregate results. This gives you elastic compute while keeping the evaluation process observable and traceable.

    6. Selection Advice and Common Pitfalls

    6.1 Decide the Task Distribution First, Then Talk Metrics

    If a team’s tasks are mostly simple fixes and adding tests, cost efficiency often matters more than absolute capability; if tasks are cross-module refactors and complex bug localization, the weight on pass rate and completion should rise significantly.

    6.2 Beware the “Leaderboard Champion” Trap

    A leaderboard is a public sample, and both model vendors and users may optimize against it. Real-world gains depend on performance on your own codebase, which is exactly why building your own evaluation is not optional.

    6.3 Watch the “Crossover Point” Between Cost and Capability

    A typical pattern: the cost growth from rising capability is usually non-linear, and the last few percentage points of pass rate may cost several times more. The sensible approach is to plot a “pass rate vs. cost” curve and find the inflection point where marginal returns start to fall clearly, rather than blindly chasing the top of the leaderboard.

    6.4 Human-AI Collaboration Remains Irreplaceable

    A code agent’s output should be treated as a “candidate solution,” not a “final delivery.” Before merging, it should at minimum pass code review, security scanning, and automated tests of critical paths. Security boundaries matter too: limit tool permissions, prohibit access to real production credentials, and validate the provenance of generated dependencies and commands.

    7. Conclusion

    The signal from this round of benchmarks is clear: code agents are no longer demo tools that “can write code” — they are entering the engineering stage of “can complete tasks.” The evaluation dimensions have expanded as well, from a single pass rate into a four-dimensional system of pass rate, completion, time, and cost.

    For developers, the question worth more attention than “who ranks first” is: on my own codebase and task distribution, how can I get stable, usable output at an affordable cost? The answer can only come from building your own evaluation: a fixed task set, an isolated environment, layered execution, continuous tracking, and process constraints built around human-AI collaboration. Get these solid, and leaderboard data can genuinely translate into development productivity rather than staying a one-off moment of attention.