Evaluating Coding Agents on Long-Horizon Mobile Development Tasks: Benchmarks and Engineering Practice

    As coding agents move beyond single-point tasks like code completion and unit test generation, long-horizon programming tasks have become the new proving ground, and mobile app development is one of the most representative scenarios. This article breaks down what these benchmarks measure (task pass rate, average task completion, wall-clock time, and cost), derives two practical metrics (cost per successful task and effective throughput), and explains why long-horizon tasks are hard (error accumulation, context degradation, sparse feedback, and dense platform rules). It then shows how to build a trustworthy evaluation harness with layered task sets, reproducible environments, and layered scoring, and how to engineer agents that go the distance through context engineering, structured tooling, and a plan-execute-verify loop. Finally, it covers cost and efficiency optimization, cloud architecture patterns, security and compliance, and a four-phase adoption roadmap.

    1. Introduction: Long-Horizon Tasks Are the New Test for Coding Agents

    Over the past two years, generative AI has kept improving on single-point tasks such as code completion, function generation, and unit test writing. Leading models have nearly saturated the scores on function-level benchmarks, and the gap between models is hard to translate directly into engineering gains. As a result, industry attention has shifted to long-horizon tasks: starting from a requirement description or a bug ticket, an agent must autonomously search the codebase, locate the relevant modules, make changes across multiple files, run builds and tests, and debug iteratively based on error output, ultimately delivering a mergeable change. These tasks typically involve dozens or even hundreds of steps, and a single run can take hours or days.

    Mobile app development is a particularly representative long-horizon scenario, for three reasons:

    • Complex engineering structure: Modularization, multi-resolution resources, permission configuration, and third-party dependencies are intertwined, so a single change often ripples across multiple modules.
    • Long build pipelines: Compilation, resource packaging, signing, and obfuscation are chained together, and a failure in any one step breaks the whole pipeline.
    • Heavy verification: Beyond unit tests, teams must verify UI rendering, interaction logic, and compatibility on simulators or real devices, and the cost of validating a single scenario is noticeably higher than in a pure backend project.

    For these reasons, benchmarks in the mobile development domain can comprehensively reflect a coding agent’s overall capability in a real engineering environment. Updates to these leaderboards are essentially a redrawing of the capability map: can a new generation of coding agents, within a limited budget and time, turn “understands the code” into “finishes the task and gets it right”?

    Three key signals emerge from recent public benchmark updates:

    1. Clear generational improvement: The new generation’s task pass rate is roughly twice that of the previous one, with an average task completion above 80%. At the same time, average per-run time and cost both dropped. In engineering terms, “faster and cheaper” and “stronger” are not mutually exclusive.
    2. A clear gap at the top: The leading agents reach a pass rate of around 40%, more than 60% higher than the mid-tier. At the long-horizon level, the gap between “can complete” and “can complete reliably” is even more pronounced.
    3. Wide spread on efficiency: A low-cost agent with a mid-tier pass rate of about 17% finishes a run in only about 12 hours at a cost under 10 USD. Measured by actual spend per successful task, its per-task cost is roughly one-sixtieth of the previous flagship’s.

    This article systematically reviews the evaluation methodology behind such leaderboards, the core difficulties of long-horizon tasks, and the engineering practices development teams should focus on when adopting coding agents.

    2. Reading the Leaderboard: What Metrics Long-Horizon Coding Benchmarks Report

    2.1 Four Core Metrics

    A mature coding-agent leaderboard typically reports these four categories of metrics:

    • Task pass rate: The share of tasks that fully satisfy all verification conditions within a given budget. It measures end-to-end delivery capability and serves as an upper-bound estimate of the proportion of manual work that can be automated. Most evaluations apply strict judgment: a task counts as passed only when the build succeeds, all test cases pass, and static checks report no blocking issues.
    • Average task completion: Tasks that do not fully pass are scored by degree of completion, for example “analysis and localization only,” “compiles but tests fail,” or “feature implemented but regressions exist.” This answers “how far off is it?” and suits collaborative modes that need a human to finish the work.
    • Average wall-clock time: The actual elapsed time from task dispatch to final output. This directly determines the feedback cycle and how many tasks a fixed pool of compute can process per unit time.
    • Average cost: The model-call expense to complete one run. It determines whether a solution can scale, and it matters especially for team-level and enterprise-level batch use.

    2.2 How the Metrics Relate

    The four metrics are related but must never substitute for one another.

    • Pass rate reflects the capability ceiling: A 40% pass rate means 6 of every 10 tasks still need human intervention or a rollback. If tasks are complex and human fallback is expensive, teams care more about pass rate; if tasks are relatively simple and the appetite for automation is high, efficiency metrics carry more weight.
    • Completion reflects collaboration potential: An agent with high completion can still produce a “high-quality first draft” even when it doesn’t fully pass, letting engineers refine and finish it. The key precondition is that the output is reviewable, revertible, and clearly structured.
    • Time and cost reflect the scaling threshold: Algorithmic complexity, retrieval strategy, retry counts, and per-call context length all significantly change time and cost.

    It’s worth stressing that a 4-hour run and a 40-hour run are not necessarily based on the same task set. When comparing across leaderboards, you must first confirm that task difficulty, verification strictness, and budget settings are comparable; otherwise, you’ll easily draw the wrong conclusion.

    2.3 Two Derived Metrics: Turning Leaderboard Numbers into Engineering Decisions

    A single metric is easy to misread. In practice, two derived metrics work better:

    • Cost per successful task: Average per-run cost ÷ task pass rate, i.e., the average expense to successfully complete one task.
    • Effective throughput: Task pass rate ÷ average per-run time, i.e., the number of tasks a single execution slot can reliably deliver per unit time.

    Using this recent benchmark update as an example, here is an illustrative conversion:

    Solution Pass Rate Per-Run Time Per-Run Cost Cost per Success (approx.) Relative Throughput
    New-generation flagship 24% 27.4 hours 317 USD 1,322 USD ~4.8x
    Previous-generation flagship 12% 66.2 hours 418 USD 3,486 USD baseline
    Low-cost solution 17.3% 12.0 hours 9.9 USD 57 USD ~8.0x

    The values above are illustrative, provided to show the calculation method; they don’t represent any specific product.

    Three conclusions follow:

    1. Focus on delivery ratio, not per-run price: Although the new-generation flagship still costs hundreds of dollars per task, its cost per success dropped about 62% versus the previous generation, while effective throughput rose about 4.8x, a significant overall improvement in value.
    2. The low-cost solution fits pipelines, not hard problems: Its cost per success is under 5% of the flagship’s, making it suitable for large-scale handling of batch tasks and low-risk changes. But its completion is comparatively limited, so complex tasks still need a higher-capability solution as a fallback.
    3. Hybrid routing is often the better answer: Use the low-cost solution for the bulk of routine tasks and the flagship for hard ones. Combined this way, you can balance delivery rate under a controllable total cost. Under this strategy, the solution with the highest pass rate is not necessarily the one with the lowest overall cost.

    3. What Makes Long-Horizon Tasks Hard

    3.1 Error Accumulation: Success Decays Exponentially with Step Count

    A long-horizon task is a sequence of interdependent decisions, and the agent judges each step based on the current code state. Once a step goes wrong, later steps may build on a false premise, and the error amplifies along the task chain.

    Assume the agent’s probability of a correct decision at each step is p, the task has n mutually independent steps, and there is no error-correction mechanism. Then the task’s overall success rate is roughly p to the nth power. This simple snippet makes it intuitive:

    1. def estimate_success(per_step_accuracy: float, steps: int) -> float:
    2. """Roughly estimate the overall success rate of a long-horizon task with no error correction."""
    3. return per_step_accuracy ** steps
    4. if __name__ == "__main__":
    5. for accuracy in (0.95, 0.90, 0.80):
    6. for steps in (10, 20, 40):
    7. rate = estimate_success(accuracy, steps)
    8. print(f"Per-step accuracy {accuracy:.0%}, steps {steps:>2}: "
    9. f"overall success rate ~ {rate:.2%}")
    10. # Illustrative output:
    11. # Per-step accuracy 95%, steps 10: overall success rate ~ 59.87%
    12. # Per-step accuracy 95%, steps 20: overall success rate ~ 35.85%
    13. # Per-step accuracy 95%, steps 40: overall success rate ~ 12.85%
    14. # Per-step accuracy 90%, steps 10: overall success rate ~ 34.87%
    15. # Per-step accuracy 90%, steps 20: overall success rate ~ 12.16%
    16. # Per-step accuracy 90%, steps 40: overall success rate ~ 1.48%
    17. # Per-step accuracy 80%, steps 10: overall success rate ~ 10.74%
    18. # Per-step accuracy 80%, steps 20: overall success rate ~ 1.15%
    19. # Per-step accuracy 80%, steps 40: overall success rate ~ 0.01%

    The output shows that raising per-step accuracy from 90% to 95% (only a 5-percentage-point gain) lifts the 40-step overall success rate from about 1.5% to about 13%, nearly an 8x increase. This means that in long-horizon settings, shortening the effective step count, raising per-step reliability, and introducing timely error correction are often more effective than simply switching to a stronger model.

    3.2 Context Degradation: The Longer the History, the Easier Information Is Lost

    The conversation history of a long-horizon task may contain dozens of tool-call records, large amounts of code, and lengthy build logs. As the context keeps growing, several problems emerge:

    • Key information gets drowned out: The original requirement constraints and coding conventions are pushed far away by mountains of logs, the model gradually forgets them, and the work “drifts off course.”
    • Attention dilution: As irrelevant content grows, retrieval precision drops and the model is more likely to reference outdated or incorrect code.
    • Context overflow: When the context-length limit is exceeded, early information is truncated or compressed, possibly losing critical details.
    • Context pollution: Abandoned attempts that failed earlier linger in the history and lure later steps into repeating the same mistakes.

    3.3 Sparse Feedback: Long Verification Chains, Hard-to-Locate Errors

    • Verbose build failures: A single error may interleave logs from dependency resolution, resource merging, and code generation, easily burying the key clue.
    • Large test suites: A full regression can take tens of minutes to hours, so the agent can’t run the entire suite at every step and must decide with partial information.
    • Ambiguous failure causes: UI rendering glitches, crashes, and compatibility issues are often hard to pinpoint from logs alone.
    • Unstable environments: Some cases depend on network, device state, or execution order, so occasional failures get misread as code defects, prompting the agent into unnecessary “fixes.”

    3.4 Dense Rules: Platform Constraints Throughout

    Mobile development involves many explicit rules and implicit constraints:

    • Explicit constraints include target OS versions, permission declarations, screen-adaptation rules, and build-configuration standards.
    • Implicit constraints include the team’s existing architecture layering, naming conventions, and state-management patterns.

    Ignoring any single constraint can leave a feature “implemented” yet impossible to ship, or trigger large-scale rework during code review.

    4. Building a Trustworthy Long-Horizon Evaluation System

    To judge whether a coding agent can truly fit into a team’s development workflow, simply copying a public leaderboard isn’t enough. A more reliable approach is to build an evaluation set from the team’s own real tasks.

    4.1 Task Set Design: Real, Layered, Contamination-Resistant

    • Stay close to real scenarios: Prioritize pulling already-delivered historical requirements and bug tickets from your internal issue tracker. They carry real acceptance criteria and code context, making them more representative than hand-written problems.
    • Layer by difficulty: At minimum, split tasks into three tiers: “single-module change,” “cross-module change,” and “end-to-end change involving build and runtime verification,” and report pass rates separately to reveal capability gaps.
    • Prevent data contamination: If you directly use historical issues from public codebases, the training data may already contain the answers, inflating the score. Prefer new issues published after the model’s training cutoff, or issues from a private codebase.
    • Scale and updates: Don’t chase sheer volume. A few dozen carefully selected tasks with clear acceptance criteria are usually more informative than hundreds of vague ones. Update the set regularly to avoid “teaching to the test.”

    4.2 Environment and Reproducibility

    • Containerized runtime: Run each task in an isolated container, pin the image and build-tool versions, and pre-seed dependencies into a cache before the task starts to avoid network jitter.
    • Fixed build settings: Keep compiler options, obfuscation rules, and target OS versions consistent.
    • Pinned dependencies: Use a lock file to fix all dependency versions so that any evaluation run is reproducible.
    • Consistent verification environment: Use the same OS version and resolution simulator image for UI verification to reduce environment-induced noise.
    • On-demand network access: Block external access by default, allow only necessary addresses like dependency repositories, and log all outbound requests for later audit.

    4.3 Scoring Function: Layered Verification, Process and Result Scored Separately

    The scoring function is the core of the evaluation system. Use layered verification, and record a “process metric” and a “result metric” for each task:

    1. from dataclasses import dataclass, field
    2. @dataclass
    3. class TaskResult:
    4. task_id: str
    5. score: float = 0.0 # Weighted completion, 0~1
    6. passed: bool = False # Whether all verification passed
    7. wall_time_sec: float = 0.0 # Actual elapsed time
    8. cost: float = 0.0 # Cost of this run
    9. stages: dict = field(default_factory=dict) # Detail per verification stage
    10. trace: list = field(default_factory=list) # Tool-call trace
    11. def grade_task(result: TaskResult, rules: dict) -> TaskResult:
    12. """Grade a task using layered rules; rules define weights and blocking relationships per stage."""
    13. score = 0.0
    14. for stage, rule in rules.items():
    15. passed, detail = run_stage(stage, result) # Illustrative: run the matching verification script
    16. result.stages[stage] = {"passed": passed, "detail": detail}
    17. if passed:
    18. score += rule["weight"]
    19. elif rule.get("blocking", False):
    20. # Blocking stage such as build failure: skip remaining stages and fail the task outright
    21. result.score, result.passed = score, False
    22. return result
    23. result.score = min(score, 1.0)
    24. result.passed = result.score >= 1.0
    25. return result
    26. GRADING_RULES = {
    27. "build": {"weight": 0.20, "blocking": True}, # Build and package succeed
    28. "static_check": {"weight": 0.10, "blocking": True}, # Static checks report no blocking issues
    29. "unit_tests": {"weight": 0.30, "blocking": True}, # All relevant unit tests pass
    30. "integration": {"weight": 0.25, "blocking": False}, # Integration tests pass
    31. "ui_smoke": {"weight": 0.15, "blocking": False}, # Key screens start and interact normally
    32. }

    Three points to keep in mind when designing the scoring function:

    • Coverage: Beyond verifying the new functionality, cover regression tests for existing functionality to prevent “fixing one, breaking three.”
    • Human-score calibration: For dimensions that are hard to judge automatically, such as UI fidelity and interaction quality, bring in human scoring or model-assisted scoring, and periodically calibrate against human results for consistency.
    • Test reliability: Cases with unstable run counts or order sensitivity should be fixed or isolated first; otherwise, test noise will pollute the final conclusion.

    4.4 Controlling Variables and Statistical Significance

    • Fix the budget ceiling: Give all candidate agents the same step limit, time limit, and cost limit; otherwise you’re comparing “budgets,” not “capabilities.”
    • Run multiple times: Repeat each task at least 3 times. Because coding-agent output is stochastic, a single run can’t reflect true capability; report the median or mean with a confidence interval.
    • Cost consistency: The cost of long-running solutions often comes from growing context that increases input consumption, while a low-cost solution’s time and cost advantage partly stems from its context-management strategy. The two shouldn’t be simply ranked by “value” without accounting for this.

    4.5 Example Evaluation Run Configuration

    The following configuration is illustrative, showing which variables a long-horizon evaluation needs to pin down:

    1. # Long-horizon coding agent evaluation config (illustrative)
    2. task_set: mobile_long_horizon_v1 # Task set name and version
    3. repeats: 3 # Repeat count per task
    4. random_seed: 42 # Fixed random seed for reproducibility
    5. environment:
    6. runtime: container # Each task runs in an isolated container
    7. image_digest: sha256:<fixed image digest> # Pin the image version
    8. build_cache: warm # Pre-seed dependency cache to reduce network jitter
    9. network: restricted # Allow only necessary addresses like dependency repos
    10. verification: emulator # Unified UI verification environment
    11. task_timeout_sec: 14400 # Max 4 hours per task
    12. agent:
    13. max_steps: 100 # Max steps per task
    14. max_input_tokens: 500000 # Cumulative input cap to control context growth
    15. max_output_tokens: 200000 # Cumulative output cap
    16. max_cost: 5.0 # Cost cap per task (USD)
    17. max_retries: 5 # Max retries after verification failure
    18. recording:
    19. trace: full # Record all tool calls and timing in full
    20. cost_per_call: true # Record cost of each call
    21. snapshot_on_failure: true # Save the scene on failure for root-cause analysis

    5. Making Agents Go the Distance: Engineering Practice for Long-Horizon Tasks

    5.1 Context Engineering: Structured Retrieval + Rolling Summaries

    High-quality context is the key to whether long-horizon tasks succeed or fail. A layered strategy of “repository index + on-demand retrieval + rolling summary” is recommended:

    • Structured repository index: Beyond semantic vector search, combine symbol indexes, call graphs, and dependency graphs. For example, when “modifying a public interface,” first find all callers via the call graph, then assess the impact. This is more precise than plain keyword matching.
    • On-demand expansion: Have retrieval first return file summaries and key snippets; only read full files after the agent confirms relevance, avoiding dumping large amounts of irrelevant code at once.
    • Rolling summary: Every few steps, compress the history into a structured summary covering “current objective,” “changes completed,” “options ruled out,” and “open problems,” replacing the raw verbose logs.
    • Constraints always visible: Keep acceptance criteria, coding conventions, and a list of files that must not be modified in a fixed, always-visible location to reduce the chance of drift.

    Here’s an illustrative snippet:

    1. def build_context(task, repo_index, budget_tokens, summary=None):
    2. """Assemble this round's context: constraints + rolling summary + on-demand retrieved code."""
    3. sections = [
    4. ("Task constraints", task.requirements), # Acceptance criteria and coding conventions, always visible
    5. ("Do not modify", task.forbidden_paths), # Make change boundaries explicit
    6. ]
    7. if summary:
    8. # Rolling summary: completed changes, ruled-out options, current open problems
    9. sections.append(("Execution summary", summary.render()))
    10. # Structured retrieval: symbol index + call graph, not plain keyword matching
    11. hits = repo_index.search(task.objective, strategy="hybrid")
    12. sections.append(("Relevant code", hits.render(budget=budget_tokens * 0.7)))
    13. return sections

    5.2 Tool Interface Design: Small Verifiable Steps, Revertible Changes

    Tools are the only channel through which the agent interacts with the engineering environment, and interface design directly shapes behavior quality:

    • Structured edit interface: Require edits to be submitted as exact “original snippet + replacement snippet” matches, and automatically verify the snippet matches uniquely, reducing format errors and unintended changes.
    • Minimize changes: Handle one small goal at a time, and run the relevant checks immediately after each change, instead of “editing ten files then verifying all at once.”
    • Log denoising: Preprocess build logs before returning them: extract key errors, annotate file and line numbers, group by category, and compress tens of thousands of lines into a structured summary of a few hundred words.
    • Controllable and revertible actions: Base all changes on version control and create a checkpoint after each small goal. On verification failure, roll back to the nearest checkpoint to prevent errors from accumulating in later steps.
    • Second confirmation for sensitive actions: Operations like deleting files, modifying build configuration, or changing dependency versions should require the agent to explain its reasoning, subject to rule-engine or human approval.

    5.3 Plan-Execute-Verify Loop

    A work mode of “plan first, execute in small steps, verify each step, review periodically” is recommended:

    1. Task understanding and planning: The agent first restates the task objective, lists acceptance criteria, outputs a step-by-step plan, and annotates the verification method for each step.
    2. Impact analysis: Using the call graph and dependency graph, list the modules and test cases that may be affected.
    3. Small-step implementation: Complete changes one at a time as planned, running the corresponding lightweight check after each, such as compiling that module or running the relevant unit tests.
    4. Stage verification: After a phase goal is complete, run integration tests, and start UI verification when necessary.
    5. Self-review: Check each item against the acceptance criteria, and explicitly flag risks for anything not yet verified.
    6. Failure rollback: When consecutive failures hit a threshold, pause the current approach, roll back to a checkpoint, try a different implementation path, or proactively request human intervention.

    5.4 Illustrative Agent Main Loop

    The following code shows a main-loop framework with budget control and failure rollback (illustrative only):

    1. import time
    2. def run_agent(task, env, budget):
    3. workspace = env.create_workspace(task.repo_snapshot)
    4. # The first round carries full context; later rounds pass only summaries and new information
    5. messages = [{"role": "user", "content": build_context(task, env.repo_index,
    6. budget.context_tokens)}]
    7. plan = env.model.plan(task, messages) # Generate a step-by-step plan and acceptance criteria
    8. messages.append({"role": "assistant", "content": plan.render()})
    9. summary = env.summary.new(plan)
    10. while not budget.exhausted():
    11. # Adjust dynamically by budget: switch to a low-cost, concise mode when budget runs low
    12. response = env.model.act(messages, tools=env.tools,
    13. style=budget.recommended_style())
    14. budget.add(response.usage)
    15. for call in response.tool_calls:
    16. result = env.tools.execute(call, workspace) # Restricted execution, fully logged
    17. summary.add(call.name, result.brief()) # Record in the rolling summary
    18. verdict = env.run_checks(workspace, plan.current_step_check)
    19. if verdict.passed:
    20. workspace.checkpoint(plan.current_step) # Create a checkpoint
    21. summary.mark_done(plan.current_step)
    22. if plan.finished():
    23. break
    24. plan.advance()
    25. # Compress long history into a summary to avoid unbounded context growth
    26. messages = compact(messages, summary)
    27. else:
    28. workspace.rollback() # Roll back to the nearest checkpoint
    29. summary.add_attempt(verdict.diagnose()) # Record the ruled-out option
    30. messages.append({"role": "user",
    31. "content": verdict.diagnose()}) # Feed back structured error
    32. if summary.consecutive_failures >= budget.max_retries:
    33. # Trigger a path switch or human handoff to avoid wasting budget on futile retries
    34. return env.escalate(workspace, summary)
    35. report = env.evaluate(workspace, task.acceptance)
    36. return {"score": report.score, "passed": report.passed,
    37. "cost": budget.spent, "duration_sec": time.time() - env.started_at}

    This framework embodies four design points:

    • Budget awareness: The main loop checks the budget before each iteration, and the agent adapts its behavior strategy to the remaining budget.
    • Externalized state: The execution summary is stored separately, and history is compressed on demand, easing context degradation.
    • Controlled failure: Error logs are fed back as structured diagnoses, and when consecutive failures hit a threshold, the agent automatically rolls back or escalates.
    • Full traceability: Every tool call, every unit of spend, and every checkpoint is recorded, aiding retrospective analysis and root-cause attribution.

    6. Cost and Efficiency: Optimizing the Economics of Long-Horizon Tasks

    6.1 Budget Control: Deciding “When to Stop”

    The easiest place for a long-horizon task to spiral out of control is endless trial and error. Budget control should cover at least four dimensions:

    • Step budget: Limit the maximum number of actions the agent can take.
    • Time budget: Set a task-level timeout that forces the current result to be produced when exceeded.
    • Cost budget: Accumulate call cost per task, and automatically switch to a low-cost, concise output mode as the limit approaches.
    • Retry budget: When consecutive verification failures hit a threshold, stop the current approach and switch paths or escalate to a human.

    A companion question that’s often overlooked: how should the “sunk cost” of failed tasks be allocated? If an agent burns several times the average budget on one complex task and still fails, that spend should count toward the overall cost per success, not be excluded by averaging only successful tasks.

    6.2 Model Tiering and Cache Reuse

    • Tiered routing: Route high-difficulty steps like requirement understanding and solution planning, or complex defect localization, to high-capability models; route relatively deterministic tasks like code retrieval, formatting cleanup, and unit test writing to low-cost, low-latency models.
    • Prefix caching: Place fixed content such as system prompts, coding conventions, and project structure notes at the very front of the context, using model services with caching to reduce repeated input cost.
    • Semantic compression: Pass retrieval results through a summarization model before sending them to the main model; filter build logs with rules before feeding them into the context.

    6.3 Parallelism and “Generate Multiple Candidates, Pick the Best”

    • Task-level parallelism: Independent tasks can run concurrently, so effective throughput scales roughly linearly with the number of concurrent slots.
    • Candidate generation and selection: Have the agent produce multiple candidate solutions for the same objective, then use objective signals like compilation and tests to keep the best. This effectively trades a small extra cost for a higher per-step accuracy, which is especially effective at easing error accumulation.
    • Small-step verification over long-chain reasoning: Break a big task into smaller ones, each with a clear verification signal. The overall success rate is markedly higher than a one-shot long-chain reasoning attempt.

    6.4 Build Caching and Incremental Verification

    • Layered caching: Manage dependency caches, build-artifact caches, and test-report caches separately to avoid redundant compilation.
    • Impact analysis: Use the call graph to determine affected modules, and compile and test only the relevant scope, compressing a single feedback cycle from tens of minutes to a few minutes.
    • Async long verification: Run time-consuming integration tests and UI verification in the background while the agent proceeds to the next subtask, handling results together once they return.

    6.5 Building Cost Observability

    Cost optimization rests on observability. Every run should record: total cost, input and output consumption, per-stage timing, tool-call counts, and failure-retry counts. On that basis, two key ratios can be computed:

    • Retry cost share: The proportion of total cost attributable to failure retries.
    • Per-task cost distribution: Identify the few “budget black holes,” which often correspond to capability gaps in the evaluation system.

    7. Cloud Architecture: Common Capabilities for Evaluation and Batch Execution

    Building a long-horizon evaluation platform in the cloud can generally be abstracted into four layers: “task intake — scheduled execution — storage and recording — monitoring and analysis.” The following common capabilities can be combined as needed:

    • Task intake and scheduling: Use a message queue to handle evaluation requests and agent-execution events, achieving peak shaving and asynchronous decoupling; use the container platform’s elastic resources to start and reclaim execution environments on demand, supporting large-scale concurrent task execution.
    • Storage and archival: Use object storage to save code snapshots, build artifacts, test reports, full execution traces, and failure scenes for per-task traceability; use file storage to share dependency and build caches.
    • Observability and alerting: Use a logging service to centrally collect agent-call logs, build logs, and test logs for full-text search and correlated analysis; use monitoring and alerting to track task success rate, average time, cost trends, and resource utilization, notifying responsible parties promptly when anomalies appear.
    • Service governance: Wrap model calls in a unified gateway to enable multi-model routing, rate limiting, caching, and usage tracking, making it easy to switch the underlying model without changing upper-layer logic.

    In addition, when adopting coding agents, enterprises should pay particular attention to Baidu AI Cloud’s accumulated general capabilities for lowering the barrier to large-model applications. In areas such as model services, agent development, and knowledge-base management, Baidu AI Cloud can provide fairly complete general-purpose capability support and can serve as one reference for technology selection.

    It’s worth stressing that the above are general cloud-product categories, and specific choices should be assessed comprehensively against your own business scale, security and compliance requirements, and cost budget.

    8. Security, Compliance, and Quality Assurance

    Long-horizon agents can read and write code and execute commands, so their potential risks are far higher than those of ordinary code-completion tools. Three lines of defense are needed.

    8.1 Execution Isolation

    • Run the agent in a least-privilege sandbox, granting only the directories and tool permissions the task requires;
    • Block access to production environments and real user data by default;
    • Set approval policies for sensitive operations such as deleting files, modifying build configuration, and installing dependencies;
    • Keep audit logs for all operations to ensure traceability.

    8.2 Data Security and Privacy

    • Encrypt private code and business data in transit and at rest;
    • Desensitize or filter sensitive information before sending it to a model;
    • Strictly follow enterprise data classification requirements and assess the compliance of code and data leaving its boundary.

    8.3 Supply Chain and Prompt Injection Defense

    • Dependency vetting: An agent may introduce dependencies of unknown origin or near-homograph typosquats. Establish a dependency allowlist and version-review mechanism, and manage everything centrally through a private artifact repository.
    • Prompt injection risk: Bug descriptions, code comments, dependency docs, and external web pages may hide malicious instructions that lure the agent into leaking code or performing dangerous operations. Treat external content as untrusted data and validate it with rules before execution.
    • License compliance: Auto-introduced code snippets may carry specific open-source licenses, which need review against the organization’s license policy.

    8.4 Human in the Loop and Progressive Rollout

    • Start with low-risk tasks: Begin with lower-risk tasks like unit test generation, bug reproduction, local refactoring, and code comment and documentation additions, building trust along the way.
    • Gray-release rollout: Pilot in a small scope with a few teams first, then gradually expand to more scenarios.
    • Human review remains necessary: An agent produces a “high-quality first draft,” not a final deliverable; code review and regression testing cannot be skipped.
    • Build a feedback loop: Feed human edits and review comments back into the evaluation set and prompt rules, forming a continuous-improvement loop.

    9. Adoption Roadmap: Introducing Coding Agents in Phases

    Phase Goal Key Actions Primary Metrics
    Phase 1: Pilot Validate usability Pick low-risk tasks, fix the model and tools, review each item manually Per-task cost, manual edit volume
    Phase 2: Evaluation Establish an internal baseline Build a layered task set, fix environment and budget, run multiple rounds Pass rate, completion, confidence interval
    Phase 3: Scaling Batch automation Integrate into the CI pipeline, task-level parallelism, hybrid model routing Effective throughput, cost per success
    Phase 4: Continuous optimization Dual control of quality and cost Failure attribution, evaluation-set iteration, process and prompt optimization Retry cost share, delivery cycle

    After entering the scaling phase, also track the impact of introducing coding agents on overall R&D effectiveness, such as requirement delivery cycle, code review duration, defect escape rate, and build success rate. Only when these metrics improve together does AI-assisted development truly create value.

    10. Conclusion

    The benchmark update for long-horizon coding agents sends a clear signal: to measure a coding agent, don’t just look at “can it write a piece of code,” but at “can it reliably deliver a mergeable change in a real engineering environment.”

    • For individual developers: Prefer applying agents to repetitive, low-verification-cost tasks such as unit test completion, local refactoring, and initial defect triage, freeing up time for architecture design and key decisions.
    • For R&D teams and enterprises: First build an evaluation system tailored to your own business, then use derived metrics like “cost per successful task” and “effective throughput” to guide selection, and combine hybrid routing, budget control, context engineering, and security isolation to reliably turn an agent’s capability into gains in development efficiency.

    The capabilities of coding agents are still evolving rapidly, and leaderboard rankings are only a snapshot in time. What truly determines long-term returns is whether a team has the engineering capability to measure, verify, and continuously optimize.