Coding Agent Evaluation and Scheduling Guide for Long-Horizon Development

    This guide breaks down how to evaluate and select coding agents for long-horizon development tasks. It defines four core metrics (pass rate, completion level, runtime, and per-run cost) and explains how to measure them, compares two execution routes—long-horizon/high-completion versus low-cost/fast-response—and shows which task types each fits. It then introduces task grading (S/A/B/C) with matched scheduling policies, budget and timeout control, quality and security gates, a composite eight-dimension evaluation framework, a method for building an internal development benchmark, an engineering rollout checklist, and common pitfalls with fixes. The takeaway: long-horizon capability can't be judged by pass rate alone, and the real payoff comes from combining task grading, budget control, quality gates, human review, and observability into a single scheduling mechanism.

    Key Takeaways

    • Don’t judge long-horizon capability by pass rate alone. Pass rate must be tied to acceptance criteria and read alongside completion level, runtime, and cost. When acceptance criteria shift from “it compiles” to “compiles + tests + behavior + security,” the pass rate can drop noticeably—and that is actually closer to real delivery requirements.
    • Split the two routes by task, not by strength. The long-runtime, high-completion route fits cross-module, high-risk, strictly validated tasks; the low-cost, fast-response route fits well-bounded, low-risk, fast-iteration tasks—provided quality gates are in place.
    • Turn “pick an agent” into a scheduling problem. Grade tasks S/A/B/C by business impact, change scope, rollback difficulty, and validation strictness, then match budget, timeout, verification, and human-intervention policies.

    1. Background: Mobile development is moving from “code completion” to “engineering delivery”

    Early coding benchmarks mostly looked at whether syntax was correct, whether function completion was efficient, and whether a single snippet could be used directly. But in mobile app development, a real task is rarely an isolated script—it is a full engineering process: understand the requirement, read the existing project structure, design screens and modules, generate data models, wire up network requests, handle local storage, fill in permission requests, adjust lifecycle logic, then build, run tests, fix failures, and finally deliver a committable change.

    These tasks are clearly long-horizon: many steps, long context, complex dependencies, long feedback cycles. Whether they can be delivered depends on multiple stages working together. Agent benchmarks for the mobile-app-development direction have recently been updated too, extending tasks from “single-file edits” toward real app-engineering delivery. This article does not cite specific leaderboard numbers from any single benchmark; instead it breaks down metric definitions, route trade-offs, and scheduling methods. For concrete data, refer to the version notes and leaderboard on the official release page.

    This shift in what gets evaluated means the focus moves from point capability to systematic capability: planning, tool use, error localization, test verification, and the ability to complete complex tasks within limited time and budget.

    2. How are the four core metrics defined and measured?

    Metric Definition Engineering significance Measurement Common misreading
    Pass rate Share of tasks that ultimately meet acceptance criteria End-to-end delivery capability Clear acceptance checklist: compile, package, static checks, tests, key behaviors, code style, no critical defects Acceptance criteria set too low inflates results
    Average completion level Progress of unfinished tasks measured against milestones (0–1) Depth of handling and sustained fixing ability Assign weights by stage (read code → change → compile → test → fix), and report the distribution, not just the mean High completion doesn’t mean high quality
    Average runtime Total time from task start to finish Affects dev cadence and pipeline occupancy Split into “pure execution time” and “end-to-end time (including queue wait and failed retries)”; report median and P90 Long-runtime tasks slow the whole cadence
    Per-run cost Total overhead of one task run Whether it can be used at scale Includes tokens, retrieval/build/test machine time, log and artifact storage, failed retries, and human review effort Low cost may come with high rework

    Two additions:

    1. Means get skewed by extreme tasks. For runtime and cost, use the median as the primary figure, and also report failure rate, timeout rate, rework rate, and cost distribution.
    2. The multipliers and thresholds that appear later in this article are example values, meant to convey the scheduling idea. Real values need to be calibrated by each team against its own task distribution. When citing others’ data, first confirm whether their runtime and cost definitions match your own accounting.

    3. Which tasks fit the long-horizon, high-completion route?

    This route invests more reasoning, retrieval, tool calls, and verification during execution: first build a task plan and break it into subtasks, then search code, read logs, run builds and tests, and repeatedly correct based on failure feedback. It is more like depth-first engineering execution, aiming for a complete closed loop rather than the fastest response.

    Suitable scenarios:

    • Cross-module refactoring: understanding multiple files, interfaces, data flows, and call relationships at once.
    • Version migration: handling old and new interfaces coexisting, deprecated fields, and compatibility strategies.
    • Legacy code changes: missing docs, messy naming, insufficient test coverage.
    • Multi-step bug fixes: locating root causes after a build fails, then verifying repeatedly.
    • High-risk features: payment, permissions, security, compliance, or core user flows.

    The costs are equally clear:

    • Slower feedback: a single task may run from tens of minutes to hours, hard to wait on in an interactive session, so it usually goes into an asynchronous queue.
    • High resource usage: multiple long tasks in parallel compete for build machines and test devices.
    • More expensive rework: once an intermediate step goes off track, later verification and fixes must be redone.

    Recommended supporting mechanisms:

    • Keep code snapshots, build logs, and test results at each stage for traceability.
    • Run in a sandbox with network and filesystem permissions restricted.
    • Set checkpoints; when a stage’s verification fails, retry from the checkpoint first rather than redoing the whole task.
    • Keep human review at key nodes, especially the final diff before release.

    4. When does the low-cost, fast-response route apply, and where are its limits?

    This route doesn’t push tasks to maximum complexity. Instead it uses limited resources to produce a verifiable first result. Typical scenarios:

    • Prototype screens: screen structure, lists, forms, basic interactions.
    • Boilerplate code: common modules, template files, initialization config.
    • Simple features: a single interface, a single screen, or local logic.
    • Tests and docs: baseline unit tests, interface descriptions, change logs.
    • Low-risk bulk changes: uniform renaming, replacing fixed fields, adjusting style templates.

    Where are the limits? Once a task involves complex state management, async concurrency, permission control, data consistency, or cross-module calls, “generated fast” doesn’t equal “usable as a whole.” An implementation that looks locally correct but fails end to end is exactly what plants hidden technical debt when there are no tests and no quality gates.

    So the low-cost route must be bound to automated gates:

    1. # Baseline quality gate
    2. Code formatting check (team-wide rules, cannot be skipped during generation)
    3. Static analysis and type checking
    4. Baseline unit tests + smoke tests for critical paths
    5. Module compilation / packaging check
    6. API contract validation (request/response models match the API spec)
    7. # Security gate
    8. Hardcoded secrets scan (AK/SK, tokens, private keys, DB connection strings)
    9. Dependency vulnerability and license check (known CVEs, protocol compatibility, maintenance activity)
    10. Privacy and permission check (are permission requests necessary, is PII collected/reported minimally)
    11. Logging/telemetry check (are sensitive fields logged, is user data sent externally)

    For tasks like “low-risk bulk changes,” add extra guardrails:

    • Back up or create a branch before running; never run the batch directly on the mainline.
    • Submit changes in batches, each batch one-click rollback-able.
    • Make change scripts as idempotent as possible so re-running produces no second change.
    • After the batch completes, sample a human review of the diff, focusing on whether there are collateral edits beyond expectations.

    5. How should tasks be graded, and how should each level map to a scheduling strategy?

    Grade tasks on four dimensions: business impact (does a failure directly hit a core flow or revenue), change scope (single file or cross-module), rollback difficulty (one-click rollback? any data migration?), and validation strictness (does it require security/compliance review?).

    Level Key criteria Typical tasks Recommended strategy Budget/timeout suggestion (example, needs calibration) Focus
    S Hits core flow, hard to roll back, strict validation Payment, permissions, security, compliance High-completion priority + checkpoints + human final review 2× baseline, 2× timeout Correctness, security, traceability
    A Hits a business function, cross-file, can be canaried Business features, module refactoring Automatic verification + human review 1× baseline Test coverage, regression risk
    B Local impact, easy rollback, baseline validation Screen prototypes, boilerplate, docs Low-cost fast-response priority 0.2×, 0.5× timeout Speed, cost, baseline quality
    C Mechanical change, idempotently replayable Formatting cleanup, bulk replacement Automated batch + branch isolation 0.1×, 0.3× timeout Idempotency, rollback ability

    The pseudocode expresses a scheduling idea, not a specific library. timeout_base_seconds is the baseline timeout in seconds (excluding queue wait), and cost_cap is the cost ceiling, set separately from the token budget. Every branch must pass the quality gate; when budget or timeout is exhausted, handle it as “fall back and retry → hand off to a human / requeue.”

    1. from dataclasses import dataclass
    2. class BudgetExceeded(Exception):
    3. """Raised when budget or timeout is exhausted; the scheduler decides whether to fall back, hand off to a human, or requeue."""
    4. @dataclass
    5. class Budget:
    6. token_cap: int # Token ceiling for this run (not cost)
    7. cost_cap: float # Cost ceiling for this run, including amortized tool machine time
    8. timeout_base_seconds: int # Baseline timeout in seconds, excluding queue wait
    9. def execute_task(task, level, agents, budget: Budget, quality_gate):
    10. """Allocate budget, timeout, and verification strength by task level; multipliers are example values."""
    11. try:
    12. if level == "S":
    13. return agents["deep"].execute( # Deep route: still must pass the quality gate
    14. task,
    15. token_cap=budget.token_cap * 2,
    16. cost_cap=budget.cost_cap * 2,
    17. timeout_seconds=budget.timeout_base_seconds * 2,
    18. checkpoint=True,
    19. quality_gate=quality_gate,
    20. manual_review=True,
    21. )
    22. if level == "A":
    23. return agents["balanced"].execute(
    24. task,
    25. token_cap=budget.token_cap,
    26. cost_cap=budget.cost_cap,
    27. timeout_seconds=budget.timeout_base_seconds,
    28. quality_gate=quality_gate,
    29. )
    30. return agents["fast"].execute( # B / C level: small budget, short timeout
    31. task,
    32. token_cap=budget.token_cap * 0.2,
    33. cost_cap=budget.cost_cap * 0.2,
    34. timeout_seconds=budget.timeout_base_seconds * 0.5,
    35. quality_gate=quality_gate,
    36. )
    37. except BudgetExceeded as exc:
    38. return schedule_fallback(task, level, agents, budget,
    39. quality_gate, reason=str(exc))
    40. def schedule_fallback(task, level, agents, budget, quality_gate, reason):
    41. """Fall back and retry -> hand off to a human / requeue, so long tasks don't silently exhaust their budget."""
    42. retry = agents["fast"].execute(
    43. task,
    44. token_cap=budget.token_cap * 0.1,
    45. cost_cap=budget.cost_cap * 0.1,
    46. timeout_seconds=budget.timeout_base_seconds * 0.3,
    47. quality_gate=quality_gate,
    48. allow_partial=True, # Allow delivering partial output + a failure-reason report
    49. )
    50. if retry.status == "passed":
    51. return retry
    52. if level in ("S", "A"):
    53. return human_review_queue.submit(task, reason=reason)
    54. return task_queue.requeue(task, delay_seconds=300, max_attempts=2)

    A few implementation points:

    • Keep two separate books for budget. The token budget controls reasoning scale; the cost budget controls billing overhead (including build machine and test machine time). Exceeding either triggers a fallback; otherwise the “tokens weren’t over but the bill doubled” case can’t be caught.
    • Timeout counts only execution time. Track queue time separately, or a peak-period slowdown gets misjudged as “the agent is slow” when it’s really “the queue was long.”
    • Retries must have a cap. If max_attempts is unset, failed tasks get requeued indefinitely and clog the queue.
    • Falling back doesn’t mean loosening gates. Code produced after a fallback still has to pass the quality gate; only “partial completion + a reason note” is allowed as the deliverable.

    6. How should you build a composite evaluation system?

    Cover at least these eight dimensions:

    1. Functional correctness: does it satisfy the interface definition, screen interactions, and business rules.
    2. Build stability: can it compile, package, and pass static checks reliably, with no intermittent failures.
    3. Test quality: are the necessary unit/integration/regression tests present and do they cover critical paths.
    4. Maintainability: the proportion of naming, layering, temporary logic, and duplicate code.
    5. Security (focus): beyond permission requests, data validation, and handling of bad input, look hard at common issues in agent-generated code—

      • hardcoded keys, tokens, connection strings;
      • introducing insecure, outdated, or unmaintained dependencies;
      • logging/telemetry printing sensitive info like phone numbers, tokens, ID numbers, and sending it externally;
      • over-requesting permissions (e.g., a plain utility screen requesting location or contacts);
      • storing credentials in plaintext locally, disabling certificate validation, exposing debug endpoints.

      These items should map directly to the security gate in Section 4 as auto-executable checks, not things you eyeball during review.

    6. Rework cost: how much human editing is needed after one generation, whether redesign is required, and the average number of reruns.
    7. Runtime cost: the combined cost of tokens, tool calls, log storage, human review, and failed retries.
    8. Traceability: whether inputs, execution steps, code diffs, test reports, and failure reasons are recorded.

    7. How should you build an internal development benchmark?

    External leaderboards are only good for initial screening; long-term selection should be based on your own codebase and acceptance criteria.

    1. Task sampling: pick representative tasks from bug tickets, feature requests, refactoring tasks, migration tasks, and test-supplementation tasks, covering different complexity levels—don’t pick only easy tasks or extreme ones.
    2. Task desensitization: remove real business data, internal domains, and keys, but keep key features (module relationships, interface contracts, directory structure), or the task becomes distorted.
    3. Acceptance criteria definition: write them as an executable checklist (compile, test, static checks, key behaviors, security gate). The clearer the criteria, the more comparable the results.
    4. Isolated execution environment:
      • Pin the base image digest and lock language versions, SDKs, and dependency versions (commit lockfiles) to avoid “environment drift” making results non-reproducible;
      • Grant least-privilege network access, allow only the dependency source and necessary services, and block access to production and sensitive internal addresses by default;
      • Run under a separate, low-privilege account, with no long-lived production credentials attached;
      • Define clear retention for artifacts and logs (e.g., intermediate artifacts 7 days, evaluation reports 90 days) with automatic cleanup on expiry.
    5. Multiple runs and statistics: run key tasks 3–5 times to check stability, and look at median, failure rate, timeout rate, rework rate, and cost distribution—not just the mean.
    6. Continuous dashboard: compare trends by task type, agent strategy, and quality-gate dimension, instead of one-off reports.

    8. Engineering rollout checklist (checkable)

    • Clear requirement boundaries: goal, directory structure, dependency limits, interface contracts, prohibited actions, acceptance criteria, and test commands all present.
    • Executable acceptance criteria: not “it runs,” but compile + tests + gates all green.
    • A verification loop exists: output with no verification loop only counts as assisted generation, not an independently deliverable result.
    • Budget and timeout under control: token, cost, execution time, max retries, and fallback strategy all configured.
    • Human nodes preserved: requirement confirmation, solution design, risk judgment, final review, and release decisions still owned by people.
    • Rollback plan ready: branch isolation, stage snapshots, one-click rollback, and backups for data changes.
    • Complete observability fields: task status, stage artifacts, tool calls, error logs, code diffs, test reports, and final score.
    • No chasing a single metric: high-risk tasks prioritize correctness; only low-risk tasks prioritize efficiency and cost.

    9. Common mistakes and how to fix them

    Common mistake Consequence Fix
    Using “code can be generated” as the acceptance criterion Inflated pass rate, distorted selection conclusions Put compile, tests, behavior, and security gates in the acceptance checklist
    Looking only at pass rate and average cost Ignoring maintainability and rework; total cost actually rises Use the eight-dimension evaluation + rework-effort statistics
    No budget or timeout on long tasks Pipeline occupied for a long time, bill out of control Set token/cost/timeout ceilings and max retries by level
    Bulk code changes with no gate Hidden technical debt, key leakage, over-privileged permissions Attach a security gate, branch isolation + batching + one-click rollback
    Letting the agent commit to the mainline directly High regression risk, hard to assign blame Branch output + human final review + archived diffs
    Vague task descriptions Uncertainty amplified, higher failure rate Use a structured task template describing inputs and acceptance

    10. Conclusion: From capability comparison to engineering selection

    Benchmark updates in the mobile-development direction reflect that coding agents are moving from “generating code” to “completing engineering tasks.” The long-runtime, high-completion route wins on completeness and depth, fitting complex, high-risk, long-horizon tasks; the low-cost, fast-response route wins on response speed and cost control, fitting well-bounded, fast-iteration tasks—but it must be backstopped by tests and security gates.

    What really determines the payoff isn’t the route itself, but whether the team has combined task grading, budget control, quality gates, human review, and observability into a single scheduling mechanism. When a given agent has a low S-level rework rate on your internal benchmark and acceptable B-level throughput and cost, it’s the right choice for the current stage—and that conclusion will change as the task distribution shifts, so it needs continuous re-evaluation.