How to Evaluate Long-Horizon Coding Agents: Metrics, Benchmarks, and Engineering Practice
This article explains how to read long-horizon coding agent benchmarks and reproduce similar evaluations in your own environment. It breaks down four core metrics—end-to-end task pass rate, average task completion, average per-run latency, and average cost—and shows how to interpret them together rather than in isolation. It also covers building a layered, reproducible evaluation set, designing a controllable perceive-decide-act execution loop with retrieval, tool orchestration, and self-healing, and optimizing cost and efficiency on general cloud infrastructure such as Baidu AI Cloud. The goal is a practical methodology for moving from "generating correct code snippets" to reliably completing long-horizon tasks.
1. What the Benchmark Update Means: From “Writing Code” to “Delivering Tasks”
A well-known industry AI development benchmark platform recently updated its long-horizon task leaderboard for Android development, adding results for several coding models. The leaderboard shows that top models achieve an end-to-end task pass rate of roughly 40%, while some newer versions have doubled their pass rate compared with the previous generation, with noticeably lower per-run latency and cost. Other models trade a medium pass rate for very low cost and short runtime.
The value of this information for developers is not which model ranks first, but what it reveals about the real difficulty of long-horizon agent evaluation: a task is not a single question-and-answer exchange, but a closed loop of reading code, modifying files, running builds, inspecting logs, and iterating. As a result, evaluation metrics must shift from “single-point accuracy” to a three-way balance of “task-level success rate + process efficiency + cost.”
Note that this article does not recommend or compare any specific model. Instead, it abstracts the leaderboard into a reusable engineering methodology that helps teams reproduce similar evaluations in their own environments and apply them to real development workflows.
2. How to Read the Four Core Metrics
2.1 Task Pass Rate: End-to-End Is the Hard Metric
Pass rate measures whether a task is actually completed—for example, adding a new screen, fixing a class of crashes, or completing permission adaptation and passing the build. It is stricter than code snippet accuracy, because any single failed step causes the whole task to fail. Doubling-style improvements typically come from three areas: stronger long-context retrieval, more stable tool-call orchestration, and better self-recovery after failures.
2.2 Average Task Completion: Distinguishing “Correct” from “Finished”
Completion reflects the proportion of the task that was advanced, and is used to diagnose whether a model is “heading in the wrong direction” or “failing at the finish line.” If pass rate is low but completion is high, the model is often close to success and gets stuck in the final build or test stage. If both are low, prioritize improving task decomposition and context localization.
2.3 Average Per-Run Latency: The Engineering Bottleneck of Long-Horizon Tasks
Compressing runtime from tens of hours to just over twenty indicates that scheduling, caching, and parallelism optimizations are effective. Latency depends not only on model inference speed, but also on the number of builds, dependency resolution, emulator startup, and log retrieval efficiency.
2.4 Average Cost: Evaluate “Cheap” Within Constraints
Low-cost approaches often rely on shorter reasoning chains, fewer tool calls, or more aggressive caching. They suit batch, low-risk, rollback-friendly tasks; high-cost approaches are better for complex refactoring and cross-module changes. Cost must be evaluated jointly with pass rate to avoid “saving money but reworking.”
3. Building Your Own Evaluation Set: Making Results Reproducible
It is recommended to draw tasks from historical requirements and form a layered evaluation set:
- L1 single-file change: e.g., add a utility method and add tests.
- L2 cross-file feature: e.g., add a settings screen and wire it into navigation.
- L3 build-level fix: e.g., resolve build failures caused by dependency conflicts or missing resources.
- L4 long-horizon refactoring: e.g., modularization splits or permission system adaptation.
Each task should fix the initial code snapshot, dependency versions, and build commands to avoid environment drift. An illustrative configuration is shown below (it only expresses structure and does not point to any specific tool):
task:id: L2-settings-pagerepo_snapshot: sha256:ab12...build_cmd: "./gradlew assembleDebug"test_cmd: "./gradlew testDebugUnitTest"timeout_hours: 24budget_usd: 5success_criteria:- build_pass- unit_test_pass- nav_route_reachable
4. Agent Execution Framework: Retrieval, Tool Calls, and Self-Healing
The key to long-horizon tasks is a controllable “perceive-decide-act” loop:
- Context retrieval: locate relevant files and call chains first, avoiding full-repo scans that introduce noise.
- Tool orchestration: reading and writing files, running builds, fetching logs, and running tests should have whitelists and timeouts.
- Failure self-healing: feed structured build errors back to the model and cap retries to prevent infinite loops.
- State persistence: write intermediate artifacts to object storage to enable resume-from-checkpoint and auditing.
for step in range(max_steps):ctx = retriever.query(goal, k=8)action = planner.decide(ctx, history)result = executor.run(action, timeout=600)if result.build_pass and result.tests_pass:return resulthistory.append(structured_error(result.log))
5. Cost and Efficiency Optimization: General Practices on Baidu AI Cloud
Without relying on any proprietary interfaces, you can build a cost-effective evaluation and development pipeline using general cloud capabilities:
- Container platform hosts builds and emulators, scaling elastically per task;
- Object storage keeps code snapshots, logs, and artifacts for reproducibility;
- Message queues decouple task dispatch from result collection and smooth out peaks and troughs;
- Log service + monitoring and alerting track latency, failure rate, and budget consumption;
- Cache layer reuses dependencies and build intermediates, significantly compressing per-run latency.
For strategy, a “tiered routing” approach is recommended: low-risk tasks go to low-cost models with mandatory test gates; high-risk tasks are escalated to higher-capability models with human review. Budget caps and timeout circuit breakers prevent long-horizon tasks from running out of control.
6. Adoption Recommendations and Risk Control
- Evaluate before going live: run regressions on your own task set to avoid being misled by a single leaderboard.
- Gates are non-negotiable: builds, unit tests, and static checks serve as hard gates.
- Rollback-ready design: give each change an independent branch and snapshot, and discard failures automatically.
- Data and permission isolation: access the code repository with least privilege, and desensitize sensitive information.
- Human-AI collaboration: set stage confirmation points for long-horizon tasks, with humans owning key decisions.
7. Conclusion
The real takeaway from the leaderboard is that Android coding agents have moved from “generating correct snippets” to “reliably completing long-horizon tasks.” Developers should focus on the combined balance of pass rate, completion, latency, and cost, build a reproducible evaluation system and a controllable execution framework, and achieve elastic, observable, and rollback-ready engineering implementation on general cloud infrastructure such as Baidu AI Cloud.
