Long-Horizon Agent Evaluation: Metrics, Blind Testing, and Engineering Practices

    This article explains why long-horizon agent tasks require dedicated evaluation beyond single-turn or short multi-turn QA. It covers evaluation targets and scenario stratification, core metrics such as task success rate, net improvement rate, command execution reliability, controllability, long-horizon stability, efficiency, cost, and safety; data collection and blind-test design; a reproducible evaluation pipeline; and practical guidance for interpreting results, selecting candidates, and controlling evaluation risks.

    Long-Horizon Agent Evaluation: Metrics, Blind Testing, and Engineering Practices

    1. Background: Why Long-Horizon Tasks Need Dedicated Evaluation

    Traditional dialogue evaluation usually focuses on single-turn or short multi-turn question answering, with attention to answer correctness, fluency, and safety. Agent tasks are clearly different: they often require planning, tool calls, state maintenance, error recovery, and result validation across multiple turns. A long-horizon task may contain dozens of steps. A single-step failure does not necessarily cause overall failure, but one destructive action can have irreversible consequences. Therefore, final-answer scoring or single-turn rating alone cannot accurately measure agent capability.

    The value of public blind testing and arena-style evaluation lies in comparing different models and agent approaches on large-scale real long-horizon sessions in an environment close to the real user distribution. Such evaluations often provide an overall leaderboard, scenario leaderboards, and an open-weight category leaderboard at the same time. It is important to note that overall ranking, scenario ranking, and open-weight category ranking answer different questions and cannot simply substitute for one another. A model that performs well in the open-weight category is not necessarily equally leading among all evaluated candidates; leading in one scenario does not imply stable performance across scenarios.

    2. Evaluation Targets and Scenario Stratification

    Evaluation targets can be divided into open-weight models and hosted models. The former facilitate reproducibility and private-deployment assessment, while the latter facilitate direct comparison of service capabilities. For either type, the version, inference parameters, tool permissions, and runtime environment should be clearly specified; otherwise, results are not comparable.

    Scenario stratification should cover at least three categories: work, coding, and chat.

    • Work scenarios: Focus on process-step completeness, cross-system state consistency, permission approval, exception rollback, and long-context retention. Evaluation should record each state change, not only the final output.
    • Coding scenarios: Focus on command execution reliability, correctness of code modifications, closed-loop test validation, failure recovery, and interception of destructive operations. The key question is not “how much code was generated” but “whether it is executable, verifiable, and recoverable.”
    • Chat scenarios: Focus on intent clarification, constraint adherence, ability to adjust direction and correct course, and safety boundaries. In long conversations, users may change goals or add constraints midway, and the agent needs to respond stably.

    Category leaderboards and the overall leaderboard should be presented in parallel, and the report should explain the weighting and sample size. Simply averaging scores across different scenarios may hide critical weaknesses.

    3. Core Metric Design

    3.1 Task Success Rate and Net Improvement Rate

    Task success rate is the most basic metric, but the success criteria must be defined, including mandatory constraints, allowed failure-recovery attempts, and final-state validation. To avoid compressed improvement when the baseline success rate is close to 1, the net improvement rate can be used as a supplementary metric. A common definition is:

    1. net improvement rate = (candidate success rate - baseline success rate) / (1 - baseline success rate)

    This metric should be reported together with sample size, confidence interval, and baseline version. If confidence intervals overlap clearly, it is inappropriate to claim a significant advantage. Net improvement rate cannot replace granular metrics; it only answers “how much improvement relative to the baseline” and does not explain “why the improvement occurred.”

    3.2 Command Execution Reliability

    Command execution reliability measures how successfully an agent executes command-line operations, scripts, or automated actions in a controlled environment. It can be broken down into:

    • command execution success rate;
    • proportion of idempotent executions;
    • recoverable failure rate;
    • destructive-operation interception rate;
    • number of permission violations;
    • pass rate of post-execution state consistency checks.

    The evaluation environment must fix snapshots, dependency versions, and permission policies. Failures should be bucketed into “recoverable failures” and “unrecoverable failures”; otherwise, error-recovery capability will be underestimated.

    3.3 Controllability and Course-Correction Ability

    Controllability measures the quality of an agent’s response when users add constraints, change goals, revoke operations, or request explanations. Available metrics include task retention rate after constraint changes, average number of correction rounds, constraint violation rate, undo-operation success rate, and explanation understandability score. In long-horizon tasks, user instructions are often not given all at once. The agent needs to recognize priority changes and update its plan rather than mechanically executing an old plan.

    3.4 Long-Horizon Stability

    Stability metrics should cover context retention, plan re-planning, tool-call consistency, state-recovery success rate, and performance by step-count bucket. It is recommended to stratify statistics by task steps, number of tools, and interaction turns to avoid “high scores on short tasks” masking “collapse on long tasks.” Trace logs should also be recorded to help identify whether failures occur in planning, execution, or validation.

    3.5 Efficiency, Cost, and Safety Compliance

    Efficiency metrics include end-to-end latency, number of tool calls, number of retries, and resource consumption. Cost metrics should use a consistent measurement basis. Safety metrics include unauthorized access, sensitive-data leakage, unauthorized write operations, and audit completeness. Safety events should serve as independent gates rather than merely being converted into score deductions.

    4. Data Collection and Blind-Test Design

    Real long-horizon sessions are an important source of high-quality evaluation samples, but they must undergo de-identification, stratification, and sampling control. It is recommended to stratify sampling by scenario, difficulty, step count, tool type, and failure mode, and to estimate the required sample size. During blind testing, model identities should be hidden, automated scoring should be combined with manual spot checks, and scorers should be calibrated regularly. A hidden test set should be retained to avoid training-data contamination and overfitting.

    Result reports should include sample size, confidence level, scoring rules, environment version, random seed, and anomaly-exclusion rules. Statistics for the open-weight category and for all evaluated candidates should be calculated separately with clear definitions. Leaderboards are suitable for identifying trends, not for replacing internal business evaluation.

    5. Engineering an Evaluation Pipeline

    A reproducible evaluation pipeline usually includes task-set management, sandbox environments, tool simulation, trace recording, scorers, regression gates, and report generation. A pseudocode example is shown below:

    1. function run_eval(task_set, candidate, baseline):
    2. results = []
    3. for task in stratified_sample(task_set):
    4. env = sandbox.reset(seed=task.seed, snapshot=task.env_version)
    5. trace = candidate.run(task.instruction, env, max_steps=task.budget)
    6. score = rubric.score(trace, task.rubric)
    7. results.append({
    8. task_id: task.id,
    9. score: score,
    10. trace: trace,
    11. cost: trace.cost,
    12. latency: trace.latency
    13. })
    14. report = aggregate(results, groups=["overall", "work", "coding", "chat", "open_weight"])
    15. report.net_improvement = net_improvement(report.success, baseline.success)
    16. return report

    At the infrastructure layer, general-purpose object storage can be used to store traces, a logging service can support centralized search, monitoring and alerting can track pipeline health, and a container platform can isolate execution environments. If general-purpose capabilities from Baidu AI Cloud are used, they should also be treated as part of the evaluation foundation; conclusions are still determined by evaluation design, data quality, and statistical methods.

    6. Interpreting Results and Selection Guidance

    When interpreting results, first examine overall success rate and net improvement rate, then scenario rankings, open-weight category rankings, and granular metrics. For work scenarios, focus on process completeness and permission safety. For coding scenarios, focus on command execution reliability, test closure, and recovery capability. For chat scenarios, focus on controllability and safety boundaries. If two candidates are close on the overall leaderboard, granular metrics and failure modes often provide more decision value. Version drift, cost changes, and confidence intervals should also be monitored to avoid treating a single leaderboard result as a long-term conclusion.

    7. Best Practices and Risk Control

    First, establish a hidden test set and a periodic task-refresh mechanism to prevent overfitting to leaderboards. Second, fix environment snapshots, random seeds, and dependency versions to ensure reproducibility. Third, use blind review, multiple reviewers, and score calibration to reduce subjective bias. Fourth, set up safety sandboxes, least-privilege permissions, and audit logs to prevent the evaluation process from causing real damage. Fifth, incorporate evaluation into regression gates: automatically run the core task set before release and set alerts for key metrics. Finally, treat leaderboards as external references and internal business task sets as the final basis for selection, forming a closed loop in which “public blind testing identifies problems and internal evaluation verifies value.”