Long-Horizon AI Coding Agents Under Test: How MobileLab Benchmarks Trade High Scores Against High Costs
Long-horizon AI coding agents are now judged not by whether they can autocomplete the next line of code, but by whether they can deliver a working application end to end. Drawing on real-world engineering benchmarks from MobileLab, this article breaks down the four core metrics that govern long-horizon task scores—pass rate, average completion, average runtime, and cost per benchmark run—and explains why a model with higher average completion can still take nearly a full day and tens of times the cost to run. It walks through the engineering tradeoffs behind "high completion, long runtime" versus "fast and cheap" agents, shows how to build a reproducible internal evaluation with pinned environments, deterministic scoring, and confidence intervals, and offers practical guidance on routing tasks by scenario, adding verification loops, and applying security and cost guardrails in CI.
1. From “Completing a Code Snippet” to “Delivering an Application”
In the code-completion era, the metric for AI coding ability was simple: “is the next line correct?” Once agents entered the picture, the standard shifted to “can it finish an entire requirement?”—scaffolding a new project, implementing features, adjusting dependencies, getting the build to pass, fixing compilation errors, and finally delivering a runnable application.
Mobile development is an especially demanding test of long-horizon capability, for four reasons:
- Complex project structure: An app is often split into multiple modules (such as
app,core,feature-xxx), alongside resources, manifest files, obfuscation rules, and signing configuration. - Long build and verification chains: Compilation, unit tests, instrumentation tests, and packaging must each pass in sequence; a failure at any single step can make a task impossible to mark as complete.
- Large context spans: One task may touch dozens of files and require understanding module dependencies, version constraints, and platform compatibility requirements.
- Heavy feedback loops: Locating a compilation error often means repeating “modify → build → read logs → modify again,” and every round carries a time cost.
For these reasons, the industry has begun using benchmarks oriented toward real engineering tasks to measure AI coding agents. Such evaluations typically center on app creation, feature development, code migration, and platform conversion, having the agent complete tasks end to end in an isolated environment and judging the results automatically from build outcomes and automated tests. Two new model scores were recently added to the relevant leaderboards: one ranked in the upper-middle tier with a higher average completion, longer runtime, and higher cost per evaluation; another had a lower pass rate but ran in a fraction of the time and cost.
This raises the question at the heart of this article: A high average completion that still needs nearly a full day to finish a single evaluation round—what engineering tradeoff does that reflect?
2. Four Core Metrics: Reading Long-Horizon Task Scores
To read a scorecard, first understand four metrics:
| Metric | Meaning | The question it answers |
|---|---|---|
| Pass rate | Share of tasks that fully pass acceptance (denoted p in this report) | The probability that a task is “truly finished” |
| Average completion | Mean across tasks of completed checkpoints divided by total checkpoints (denoted c) | How far it got on average |
| Average runtime | Mean end-to-end execution time for a single task | How long until you see a result |
| Cost per benchmark run | Total cost of running the full evaluation suite | How much trial-and-error and scaling will cost |
1. Pass rate is the “hard gate”
Only when an app builds successfully and all acceptance tests pass does a task count as passed. Partial completion earns no credit, so pass rate best reflects end-to-end delivery capability.
2. Average completion is the “progress bar”
A task is broken into several verifiable checkpoints (e.g., “the project compiles,” “the target page opens,” “core-logic unit tests pass”), each worth a partial score. High completion means the agent understood most of the requirement and built the skeleton; low completion may mean it got stuck at step one.
3. The relationship between pass rate and completion
Suppose each task has N checkpoints, each independent, with a per-checkpoint success probability of s. Then a single task’s pass rate is roughly s^N, and pass rate decays exponentially with N. Conversely, under a uniform distribution the completion is c ≈ s, which gives:
p ≈ c^N (derivation: s = c, p = s^N = c^N)
For example, at N = 10, a completion of 80% corresponds to a pass rate of only about 11%; raising completion to 90% lifts the pass rate to about 35%.
Note: The formula above is an illustrative derivation under a uniform-independence assumption. In real tasks, dependencies exist between checkpoints, and a single mistake often drags subsequent checkpoints down with it; this correlation effect can push the true pass rate even lower. But the underlying pattern still holds: the closer a marginal completion gain sits to the “last mile,” the more leverage it exerts on the pass rate.
| Average completion | Task 1 | Task 2 | Task 3 | Average | Pass rate (all 10 items correct) |
|---|---|---|---|---|---|
| Model A (illustrative) | 100% | 70% | 70% | 80% | 0% |
| Model B (illustrative) | 80% | 80% | 80% | 80% | 0% |
| Model C (illustrative) | 100% | 80% | 80% | 87% | 0% |
Although the three example models differ in average completion, all have a 0% pass rate: as long as every task has at least one failing item, no task can pass completely. This shows that a high average completion does not equal a high pass rate—an even, solid distribution of capability is more valuable than “maxing out” on a handful of tasks.
4. Runtime and cost
- What makes up runtime: Reasoning and generation, tool calls, build and test execution, and retries after failures. The more complex the task and the more branches it attempts, the longer it takes.
- What makes up cost: This grows mainly with the total volume of tokens processed—files read, accumulated context, and output produced through repeated trial-and-error.
- A practical metric: “Average cost per task passed” = total evaluation cost ÷ number of tasks passed, which directly measures the cost per unit of effective output.
3. The Engineering Tradeoffs Behind “High Completion, Long Runtime”
Comparing the two models side by side (values below are illustrative, used for discussion):
| Dimension | Model A | Model B | Ratio (A/B) |
|---|---|---|---|
| Pass rate | ~24% | ~17% | ~1.4x |
| Average completion | ~82% | ~71% | ~1.16x |
| Average runtime | ~27.4 hours | ~12.0 hours | ~2.3x |
| Cost per evaluation run | ~$317 | ~$10 | ~32x |
| Cost per task passed (example) | ~$1323 | ~$58 | ~23x |
These numbers say it plainly: a slightly higher pass rate comes at the price of several times the runtime and tens of times the cost. The tradeoff can be understood on five levels.
1. Completion is bought with “deep search,” and deep search has marginal costs
Failures on long-horizon tasks are often not “can’t write the code” but “didn’t find the right problem.” For example:
- A third-party library’s minimum system version doesn’t match the project configuration;
- The manifest file is missing a permission declaration;
- Obfuscation rules strip out a class that is invoked via reflection, causing a runtime crash.
Diagnosing these problems requires reading through logs, tracing dependencies, and repeated trial-and-error, and both time and token consumption climb quickly. The jump from 80% to 90% is usually the process of cracking these “long-tail problems.” Whether that’s worthwhile depends on the business cost of a single task failing.
2. Different agent forms have different capability focuses
- Agents optimized for coding: a lean toolchain and efficient context management, with fast per-step decisions that push more progress per unit of time.
- General-purpose agents: broader tool coverage (terminal, files, browser, and so on) and more room to maneuver on unfamiliar problems, but each step may carry extra overhead, making the whole run slower.
The “high completion, long runtime” combination often corresponds to a strategy that leans toward “explore repeatedly until it succeeds”; “low runtime, low cost” corresponds to “less trial-and-error, faster output,” at the cost of a lower probability of cracking complex problems.
3. The pass-rate gap and the cost gap are disproportionate
The pass rate is about 1.4x, but the cost is about 32x. Measured by “average cost per task passed,” the advantage narrows to about 23x—yet the order-of-magnitude gap remains. This tells us:
- On high-difficulty, long-horizon tasks near the capability frontier, gaining a single percentage point of pass rate may demand a multiple of the investment;
- Part of the cost gap is not spent directly on “solving the problem” but is consumed by exploration, backtracking, and repeated verification;
- Agents with a “self-check → correct” step are especially prone to this, where quality gains often come at the price of hours of extra runtime.
4. Time itself is a cost
Nearly 27 hours means one full evaluation round runs across days. For day-to-day iteration:
- Feedback delay: Problems surface a day later, by which time developers have already switched context, raising the cost of fixing them.
- Resource occupation: Build environments, devices, or emulators stay occupied for long stretches, affecting other tasks in the queue.
- Parallel amplification: As task count grows, total machine time grows roughly linearly. Estimating by number of tasks n:
total time ≈ average time per task × n ÷ concurrencytotal cost ≈ cost per evaluation run × n
5. Economics depends on task value, not a single metric
A simple break-even judgment:
task value (hours) = (manual time − agent time) × success probability × unit labor cost − run cost
- When task value is clearly greater than 0: a high-capability, high-cost approach pays off—for example, core-module refactoring, platform migration, and other work that takes days and involves expensive labor.
- When run cost exceeds the labor cost saved: switch to a low-cost, low-latency approach, or just hand the work to humans.
It’s worth stressing that benchmark scores are only a reference. Real projects differ in dependency composition, code scale, and acceptance standards, so a leaderboard rank cannot be equated directly with gains for your team.
4. Building Reproducible Evaluations: Bringing “Leaderboard Thinking” Inside the Team
Rather than asking “which model scores higher,” ask a better question: “On my codebase, at a cost I can accept, which approach achieves the best completion?” The steps below outline how to build an internal evaluation.
1. Build a task set
- Cover typical scenarios: new module creation, feature development, dependency upgrades, defect fixes, and platform version adaptation;
- Grade by difficulty: include both simple tasks (single-file changes) and long-horizon tasks (cross-module delivery);
- For each task, specify the requirement description, an initial code snapshot, a verification script, and an estimated manual time;
- Example format (YAML; commands use Gradlew):
- id: migrate-json-parsercategory: Dependency upgradesnapshot: repos/migrate-json-parser@base # immutable initial code snapshotprompt: Replace the JSON parsing library in the project with the current mainstream option, keep the external interface unchanged, and pass all tests.verify:- ./gradlew :app:assembleDebug # compiles and packages- ./gradlew :app:testDebugUnitTest # all unit tests pass- bash checks/public_api_unchanged.sh # external interface unchangedhidden_tests: checks/hidden/ # hidden tests, to prevent overfitting to public casesmanual_minutes: 240 # estimated manual completion time, for cost conversion
2. Fix the environment and budget
- Pin SDK/build-tool versions, dependency versions (via lock files), base-image digests, and task prompts to keep results reproducible;
- Set a maximum step count, a timeout, and a cost ceiling for each task to keep the agent from looping forever;
- Prefer internal mirrors or caches for dependency repositories so that external network fluctuations don’t disrupt the build.
3. Define the scoring criteria clearly
- Base “pass” on deterministic checks (build succeeds + all tests green), avoiding subjective judgment;
- Also record completion, runtime, token usage, and cost to enable side-by-side comparison;
- If code quality needs to be assessed, add static checks and manual spot checks as supplementary dimensions.
4. Repeat runs and quantify variance
- Agent output is stochastic, so run each task at least 3 times;
- The 95% confidence interval for a pass rate p is approximately
p ± 1.96 × √[p(1-p)/N]. For example, with 30 tasks and 8 passing, the pass rate is about 26.7%, with an interval of roughly 12.3%–41.1%; - When reporting conclusions, include the interval and the sample size; if the gap falls within the interval, you cannot claim “who is stronger”;
- Summary example (Python):
import mathimport statisticsdef summarize(runs):"""runs: list[dict], each item contains passed, completion, seconds, cost"""n = len(runs)passes = sum(r["passed"] for r in runs)p = passes / nci = 1.96 * math.sqrt(p * (1 - p) / n) # 95% confidence interval half-widthreturn {"pass_rate": p,"pass_rate_ci95": (p - ci, p + ci),"avg_completion": statistics.mean(r["completion"] for r in runs),"avg_seconds": statistics.mean(r["seconds"] for r in runs),"cost_per_pass": sum(r["cost"] for r in runs) / max(passes, 1),}
5. Bring in cost and timeliness perspectives
- Core metrics: average cost per task passed, and average task runtime;
- Auxiliary metric: task value = (manual time − agent time) × pass rate × unit labor cost − run cost;
- Present conclusions as “approach–scenario–metric” triples, avoiding generic rankings.
5. From Evaluation to Deployment: Combining Approaches by Scenario
The ultimate purpose of evaluation isn’t ranking—it’s making sure the right approach works in the right scenario.
1. Scenario layering: not every task is worth “deep reasoning”
| Task type | Focus | Suggested strategy |
|---|---|---|
| Simple changes (copy, styling, single-file fixes) | Response time, cost | Low-cost, low-latency approach, with human fallback when needed |
| Feature development and defect fixes | Balance of pass rate and runtime | Medium budget, with an automated verification loop |
| Dependency upgrades, platform migration, architecture refactoring | Completion quality | High-capability approach + human review |
| Long-tail problems like build-failure diagnosis | Diagnosis ability | Allow multiple rounds of exploration, with time and cost limits |
2. Routing: decide first, then dispatch
def route(task):"""Choose an execution strategy based on complexity and risk; thresholds must be calibrated with internal evaluation data"""if task.risk_level == "high" or task.est_steps > 30:return "deep" # multiple rounds of exploration + automated verification + human reviewif task.est_steps > 10:return "balanced" # step limit + automated verificationreturn "fast" # single or few rounds of execution
3. Trade a “verification loop” for stability
Whatever approach you use, have the agent automatically run builds and tests before submitting, feed logs back on failure so it can keep fixing, and set a maximum retry count. This effectively adds a “gatekeeper” layer around the coding agent, trading a controllable amount of extra runtime for a noticeably higher pass rate.
4. Use agents in a tiered way within CI
- Merge-request stage: automatically run static checks, unit tests, and low-risk small tasks;
- Nightly or weekly pipelines: run long-horizon tasks such as dependency upgrades and test backfill, because when nobody is waiting, several hours of runtime barely affects the delivery cadence;
- Example snippet (GitHub Actions-style workflow; commands use Gradlew):
# .github/workflows/agent-gate.yml (illustrative)name: agent-gateon: [pull_request]jobs:agent-assisted-fix:if: contains(github.event.pull_request.labels.*.name, 'ai-assisted') # explicitly enabled by a humanruns-on: ubuntu-latesttimeout-minutes: 60 # prevent a long-horizon task from running indefinitelysteps:- uses: actions/checkout@v4- name: Build and testrun: |./gradlew :app:assembleDebug :app:testDebugUnitTest
5. Security and cost guardrails
- Sandbox isolation: Run in containers or isolated build environments; prohibit access to production credentials and real user data.
- Network control: Allow access to dependency repositories via a whitelist, and review the source and license of new dependencies.
- Least privilege: Grant only the minimum permissions a task requires, with critical operations requiring human confirmation.
- Cost quotas: Set daily/monthly budgets per team or project, automatically downgrading to a low-cost approach or pausing when a threshold is approached.
- Observability: Collect run logs, token usage, and build times centrally, wire them into monitoring and alerting, and notify owners promptly of anomalies.
- Platform support: Evaluation and nightly tasks typically rely on elastic support from build environments, code hosting, and pipelines; general cloud capabilities such as cloud container platforms, object storage, and log services can provide environment isolation, dependency caching, and usage auditing—for example, Baidu AI Cloud offers such general-purpose cloud product capabilities.
6. Conclusion
The core fact that long-horizon AI coding evaluations reveal is this: capability, time, and cost cannot all be optimal at once. A high-completion, long-runtime approach suits high-value, high-complexity tasks; a low-runtime, low-cost approach suits high-frequency, low-risk daily development.
For teams, the more pragmatic path is:
- Establish your own evaluation baseline with an internal task set;
- Use “average cost per task passed” and “task value” as the basis for decisions;
- Use routing and verification loops to let different approaches each play to their strengths.
Leaderboard rankings will keep shifting. What delivers truly sustainable competitiveness is a reproducible, measurable, cost-controlled engineering system for AI-assisted development.
