Long-Horizon Coding Agent Evaluation: The Engineering Tradeoffs Behind Pass Rates

    This article explains how AI coding benchmarks are shifting from minute-scale tasks like function completion and bug fixes to multi-hour, long-horizon engineering work that resembles real application delivery. It breaks down the four core metrics—task pass rate, average completion, average runtime, and per-run cost—and explains why pass rate and completion must always be read together. It then examines why long-horizon agents frequently show high completion but low pass rates, lays out a six-step method for building an in-house regression benchmark, discusses how to weigh cost against latency through tiered scheduling, and identifies which tasks are the best candidates for long-horizon agents. The central takeaway: treat any benchmark result as a single point on a tradeoff curve, and optimize for cost per delivered task rather than price per call.

    1. From “Writing Code” to “Delivering Applications”: Why Benchmarks Must Get Harder

    A notable signal in recent industry developments is that benchmarks for evaluating coding ability are shifting away from minute-scale tasks—completing a function, fixing a bug—toward long-horizon engineering tasks that require continuous work over several hours or even tens of hours. These tasks typically fall into four categories:

    • Application creation: Starting from an empty project and building the directory structure, build scripts, dependency management, and a basic UI skeleton.
    • Feature development: Understanding the conventions of an existing codebase, adding pages, data layers, and business logic without breaking existing behavior.
    • Code migration: Moving an implementation from an old interface paradigm, language version, or architectural style to a new one.
    • Application transformation: Porting a project from one platform to another while preserving functional equivalence.

    The reason benchmarks must get harder is that short tasks hide the core difficulties of real engineering. Completing a function comes with a clear context window and well-defined acceptance criteria. But “adding a complete business flow” means the model must decompose the problem on its own, maintain naming consistency across files on its own, discover compile errors and iterate on fixes on its own, and wrap up before exhausting its budget on its own. This is the capability teams are actually paying for.

    For developers and decision-makers, the value of reading these benchmarks lies not in memorizing a number but in understanding the structure of the metrics: the same “completion” can correspond to entirely different engineering realities, and the same “pass rate” can hide a tenfold difference in cost.

    2. The Four Core Metrics: What Question Does Each Answer?

    Public results for long-horizon coding benchmarks are usually composed of four metrics. They are not redundant; each illuminates a different dimension.

    Metric Definition Question it answers Bias when read alone
    Task pass rate Share of tasks meeting all acceptance criteria (binary) Can it actually deliver? Ignores near-success partial progress; insensitive to gradual improvement
    Average completion Mean partial score per task (continuous) How much did it understand, and how far did it get? Highly dependent on the scoring rubric; prone to optimistic “almost there” values
    Average runtime Mean wall-clock time from task start to termination How long must the team wait, and can it fit into a daily iteration? Long-tail tasks significantly inflate the mean; needs to be paired with percentiles
    Cost per benchmark run Total spend to run the full task set, normalized Is it affordable at scale? Often counts only model calls, ignoring sandbox, build, and human review costs

    A key conclusion is this: pass rate and completion must be read together. Suppose two approaches score 24% pass rate / 82% completion and 17% pass rate / 71% completion, respectively. The former’s lead cannot simply be equated with “40% stronger.” Pass rate is a binary judgment, so one model may have merely gotten the last few acceptance items right, while the other completed seventy to eighty percent of the correct changes across most tasks. Conversely, if completion is high but pass rate stays flat over time, it usually means the failures are concentrated in a few common stages—and that is the most valuable diagnostic signal.

    From the general magnitudes seen in public evaluations, top approaches on long-horizon tasks still sit in a pass-rate range of a few tens of percent, runtimes are measured in hours to tens of hours, and cost differences can span more than an order of magnitude. This distribution is itself a conclusion: long-horizon tasks are not yet “solved”; they sit at a fiercely divided technical frontier.

    3. Why “High Completion, Low Pass Rate” Happens

    This is the most worthwhile phenomenon to dig into in long-horizon evaluation. A completion of 80% with a pass rate of only about 20% means that a large number of tasks “got most of the way done but failed acceptance.” There are five common root causes:

    1. Last-mile failure. The bulk of the work in a long-horizon task lies in the middle—scaffolding, writing business logic, wiring up data flow. But acceptance is often concentrated at the finish: incomplete build-script configuration, missed resource references, null-pointer paths, leftover calls to old interfaces after a migration. The completion score is sensitive to the correctness of the main body but unforgiving of a single fatal leftover, so the score and the outcome diverge.

    2. Error accumulation and context rot. Every step of a long-horizon agent builds on the state produced by previous steps. An early, seemingly harmless naming or abstraction choice can trigger large-scale cascading changes dozens of steps later. As the context keeps growing, early design constraints are gradually “forgotten,” and the model begins producing implementations that conflict with its own prior decisions. The symptom: the slope of the completion curve flattens in the later stages while the number of rework rounds keeps rising.

    3. No executable verification loop. Without an automatic loop of “compile after editing, run tests after compiling,” the model can only judge correctness through textual reasoning. Such systems perform reasonably on short tasks but systematically overestimate their completion on long tasks—they believe they are done when there is actually no evidence.

    4. Long runtime comes from serial trial and error, not deep thinking. The hours-to-tens-of-hours runtime is largely consumed by a loop of “read files—guess a change—fail—guess again.” This points to an important distinction: reasoning depth and execution efficiency are two different things. An approach can explore multiple candidate paths in parallel, prune irrelevant code context early, and verify high-risk changes early, compressing the same accuracy into a fraction of the time.

    5. The “equivalence trap” in migration tasks. Migration and transformation tasks look the most rule-governed but are actually the most prone to “appearing complete.” Behavioral differences between old and new implementations often fall on boundary conditions: empty collections, time zones, error-code mapping, async ordering. Correctness of the main path inflates completion, while missed edge cases break through the pass rate.

    4. Building Your Own Long-Horizon Benchmark in Six Steps

    Do not rely solely on public leaderboards; teams should have their own small-scale regression set. The method is as follows.

    Step 1: Task set design. Select tasks along two dimensions—“workload × verifiability.” Start with 20–40 tasks covering all four categories (application creation, feature development, code migration, application transformation), and deliberately keep 3–5 difficult samples that clearly exceed the current capability ceiling. These are for observing capability boundaries, not for chasing scores.

    Step 2: Environment lockdown. Package each task as a standalone container image, pinning dependency versions, build-tool versions, and network policy (disable external network access by default, allowing only access to internal artifact sources). Route task artifacts, execution traces, and logs to object storage uniformly, so that any run can be fully replayed.

    Step 3: Layered acceptance criteria. Acceptance must be automatic and executable. Four levels are recommended:

    1. Build passes (compilation/packaging with no errors);
    2. Unit tests pass (no regression in existing tests);
    3. Integration acceptance passes (end-to-end cases specific to the task);
    4. Human review (code standards, architectural soundness, done on a sampling basis).

    Step 4: Budget and timeout constraints. Explicitly set three limits—maximum execution steps, maximum token consumption, and maximum wall-clock time—and uniformly record any breach as “task failed” rather than waiting indefinitely. This is critical for comparability of results: without limits, long-tail tasks will swallow the entire budget.

    Step 5: Metric aggregation. Beyond the four metrics of public benchmarks, be sure to add three custom metrics:

    • Stability: the proportion of runs that pass on all k repetitions of the same task (recorded as pass^k), measuring reliability rather than luck;
    • Cost per success: total spend ÷ number of passed tasks—the only metric that lets you compare “expensive but accurate” against “cheap but fast” on equal footing;
    • Human takeover rate: the share of tasks that require human intervention to finish.
    1. from dataclasses import dataclass
    2. @dataclass
    3. class TaskResult:
    4. task_id: str
    5. passed: bool
    6. completion: float # 0.0 ~ 1.0, per the scoring rubric
    7. wall_clock_s: float
    8. cost: float
    9. first_try_ok: bool # passed on the first attempt within budget, no rework
    10. def aggregate(results, k=3):
    11. n = len(results)
    12. passed = [r for r in results if r.passed]
    13. return {
    14. "pass_rate": len(passed) / n,
    15. "avg_completion": sum(r.completion for r in results) / n,
    16. "p50_latency_h": quantile([r.wall_clock_s for r in results], 0.5) / 3600,
    17. "p90_latency_h": quantile([r.wall_clock_s for r in results], 0.9) / 3600,
    18. # Key: combine "pass rate" and "cost" into a single comparable quantity
    19. "cost_per_pass": sum(r.cost for r in results) / max(1, len(passed)),
    20. "first_try_rate": sum(r.first_try_ok for r in passed) / max(1, len(passed)),
    21. }

    Step 6: Regression-ize it. Wire this process into continuous integration, so that a round runs automatically whenever the model or prompting strategy changes. The value of evaluation comes from continuous comparability, not a one-time score.

    5. Cost and Latency: Converting “Cheap and Fast” into Real Returns

    Public results often show a combination like this: one approach has a higher pass rate but takes tens of hours and costs hundreds of dollars per run; another has a pass rate lower by ten-plus percentage points but spends only a few hours and less than one-twentieth of the cost. This is not a simple “cost-effectiveness” comparison; it is a watershed between use cases.

    Converting cost into “the price of completing one task” makes the picture clearer: if the high-pass-rate approach has 1.4× the pass rate of the low-cost approach but costs more than 30× as much, the gap in cost per success is still on the order of twentyfold. For the following situations, this gap is decisive:

    • Tasks that need high-frequency repeated execution (such as thousands of dependency upgrades per day, or bulk interface migrations);
    • Tasks in an exploratory phase, where many samples are meant for trial and error and gathering information;
    • Delivery cadence on the scale of hours, where waiting tens of hours of wall-clock time is not viable;
    • Budgets hard-constrained per seat or per project, where tail tasks are not allowed to consume the overall spend.

    Conversely, when tasks are one-off, broad in impact, and costly to fail (such as architecture-level migration of a core module), the premium for a high-pass-rate approach is worth paying.

    The engineering-superior solution is usually not either-or but tiered scheduling: use a low-cost, fast approach to handle decomposition, retrieval, bulk boilerplate changes, and initial screening, and use a high-capability approach for high-risk changes and failure repair.

    1. async def run_tiered(task, budget):
    2. # 1. Low-cost approach: understand the task, retrieve relevant files, propose a change plan
    3. plan = await fast_agent.plan(task, budget=budget.plan_budget)
    4. # 2. Route by risk: run boilerplate changes directly, escalate core paths to the strong model
    5. engine = strong_agent if plan.risk_level == "high" else fast_agent
    6. patch = await engine.apply(task, plan)
    7. # 3. Executable verification loop: build + test, then repair on failure
    8. report = await verify(patch) # build / unit / e2e
    9. rounds = 0
    10. while not report.passed and budget.steps_left > 0 and rounds < MAX_REPAIR:
    11. patch = await strong_agent.repair(task, patch, report)
    12. report = await verify(patch)
    13. rounds += 1
    14. return Result(task, patch, report, budget.consumed())

    Four accompanying throttles cannot be omitted: a step limit (to prevent infinite loops), a token limit (to control tail cost per run), a wall-clock limit (to protect delivery cadence), and a concurrency limit (to balance sandbox resources). A failure fast path should also be implemented: when the same error recurs more than twice in a row, switch strategies immediately or escalate to a human rather than continuing the same attempt.

    Supporting this system are usually a few general cloud capabilities: a container platform provides elastic, isolated, and reclaimable execution sandboxes; object storage retains task artifacts and complete execution traces for replay; a message queue handles task distribution and peak shaving; and log and monitoring/alerting services provide step-by-step observability, turning “which step is it stuck on and how much budget has it burned” into queryable metrics. On platforms such as Baidu AI Cloud, these capabilities can be combined on demand to form a complete pipeline from evaluation to large-scale operation.

    6. Which Tasks Are Worth Giving to Long-Horizon Agents

    Combining the failure modes, we can draw fairly clear boundaries.

    Recommended for priority adoption: code migration and bulk interface upgrades, dependency governance and security patches, filling in test cases, formatting and standards cleanup, cross-platform transformation, and boilerplate page scaffolding. Their common traits are high degree of patterning, automatable acceptance, and controllable failure cost.

    Require strong constraints: changes involving production data and permissions, architecture and technology-selection decisions, new features with fuzzy requirement boundaries, and interface definitions spanning team collaboration. These scenarios should retain human review gates and adopt gradual rollout with fast rollback.

    Recommended rollout pace: first pilot in non-core repositories and build a small regression set → evaluate primarily on “human takeover rate” and “cost per success” → define a list of changes that must not be handed to the agent → gradually expand to routine task distribution. Control risk throughout with rollout percentages and rollback switches.

    7. Conclusion: Look at the Pareto Frontier, Compute Cost per Delivery

    When reading the results of any long-horizon coding benchmark, treat it as a point on a tradeoff curve, not a ranking. Three meaningful judgments follow:

    1. Look at structure, not rank. Read pass rate, completion, runtime, and cost together; high completion with a stalled pass rate is a signal of a common defect and worth prioritizing the verification loop for investigation.
    2. Convert to a common denominator. Replace “price per call” with “total cost per completed task,” and factor in sandbox, build, and human review costs.
    3. Use tiering and budgeting instead of single-point selection. Let the cheap, fast approach handle volume and exploration, let the strong approach handle key changes and repairs, and cap tail risk with the triple limits of steps, tokens, and wall-clock time.

    For engineering teams, the biggest change long-horizon agents bring is not that “some task no longer needs a human,” but that the human shifts from executor to designer of constraints and verifier of results. Whoever can define their tasks more clearly, write acceptance criteria that are more executable, and draw budget boundaries more precisely will be the first to convert this capability into stable delivery capacity.