Evaluating AI Agent Task Success Rates and Model Routing in Practice
Abstract: This article explains why evaluating a model's ability to drive AI agents requires more than single-turn Q&A accuracy, and how to turn agent support capability into measurable metrics. It covers building realistic, layered task sets with automated acceptance criteria, tracking success rate, token usage, step counts, and failure types, and ensuring reproducibility through containerized environments. It then outlines engineering principles for different task types, a practical architecture combining task decomposition, model routing, and verification loops, state-machine constraints, observability and cost control, plus common failure modes and improvements. The goal is to turn occasional success into stable, deliverable results under real business constraints.
1. Background: Why “Can a Model Drive an Agent?” Needs Its Own Evaluation
A typical general-purpose agent works like this: it receives a natural-language goal, and a large model handles intent understanding, step decomposition, tool selection, action execution, result checking, and retrying or rerouting on failure. In this chain, the model is not just “answering questions”—it acts as the controller. So evaluating whether a model is suitable for driving an agent cannot rely on single-turn Q&A accuracy alone; it must measure closed-loop capability across multiple turns, multiple tools, and multiple constraints.
The phenomenon described in the source material is common: on relatively structured tasks such as document generation and batch processing, all models achieve high success rates. But on tasks requiring long-chain planning and precise action execution—software control, large-file analysis, database analysis, tool creation, device control—success rates drop significantly, and the gap between models widens quickly. The reason is that long-chain tasks are cumulative with respect to errors: a wrong parameter at step 3 prevents convergence at step 7; a skipped check at step 5 makes the final result look complete while actually being wrong.
Therefore, the evaluation should focus on two keywords: scenario and step by step.
- Scenario: the business environment, system interfaces, data shapes, and constraints differ by task, and so do model capability boundaries.
- Step by step: the output of each step becomes the input of the next, errors propagate, and stability matters more than being “smart at a single point.”
2. Evaluation Design: Turning “Agent Support Capability” into Quantifiable Metrics
2.1 Build Task Sets Close to Real Work, Not Toy Problems
Build the task set in layers by task type, with each layer having acceptance criteria that can be judged automatically:
- Documents and reports: template filling, batch generation, format conversion, content extraction and summarization.
- Data processing: medium-scale table cleaning, field alignment, outlier handling, statistical-definition validation.
- Large files and long context: structured extraction from very long text/logs, cross-section consistency checks.
- Database analysis: table creation, querying, aggregation, definition explanation, result review.
- Software and UI control: cross-application operations, form filling, workflow approval, handling unexpected dialogs.
- Tool creation: generating a small tool from requirements and packaging it as an executable.
- Device and protocol control: issuing commands and reading back state in a controlled experimental environment.
Prepare at least three kinds of samples per task: normal samples, boundary samples (null values/overlength/encoding anomalies), and adversarial samples (UI changes, abnormal API responses). Only boundary and adversarial samples can distinguish “works in a demo” from “works in production.”
2.2 Metrics Must Go Beyond Success Rate
Record at least four dimensions:
- Task success rate: whether the acceptance script passes.
- Average token consumption: measures cost and context pressure.
- Average steps and tool calls: measures planning efficiency and redundant actions.
- Failure type distribution: parameter errors, skipped checks, infinite loops, permission/environment errors, unverifiable results.
Example result table structure (pseudocode):
task_id, task_type, model, success(bool), tokens, steps,fail_reason(enum), need_human(bool)
Only with fail_reason can you do routing later: some models may have mediocre success rates, but their failures concentrate on “environment errors” that engineering retries can recover; others fail mostly on “planning errors,” where retries are useless and you must switch models or change the task decomposition strategy.
2.3 Make Evaluation Reproducible: Fixed Environment and Fixed Acceptance
Agent tasks are highly sensitive to the environment. Containerize the runtime, and fix dependency versions, network policies, permission boundaries, and test-data snapshots; base acceptance on scripted assertions rather than subjective human judgment. Run each task multiple times, record mean and variance, and avoid treating occasional success as capability.
3. Engineering Implications of the Key Findings: Choose Different Strategies for Different Tasks
Without referring to any specific vendor or product, the patterns in the material can be abstracted into three engineering principles:
- Structured tasks can default to a low-cost path: documents and batch processing have high success rates, so use more economical models or stricter templated workflows, and reserve budget for high-risk steps.
- Long-chain control tasks must reinforce “checks and fallback”: software control, database analysis, and device control should introduce state machines, precondition checks, postcondition result validation, and failure rollback.
- Model capability varies by scenario; build capability profiles: tag each task type with evaluation data to form a “task type → model strategy” mapping instead of using one model globally.
4. Implementation Architecture: Task Decomposition + Model Routing + Verification Loop
4.1 Decompose the Task First, Then Choose the Model
Decompose the user goal into a staged pipeline, with each stage defining input, output, and acceptance conditions. For example, “fetch data from an external source → clean and analyze → generate a report” can be split into:
plan(goal decomposition)-> fetch(retrieve and persist)-> transform(clean and validate)-> analyze(statistics and explanation)-> report(templated output)-> verify(assertions and spot checks)
Each stage selects its own model and tools, transparent to the end user. The benefits: a single-stage failure can be retried locally without redoing everything, and you can choose different cost/capability combinations per stage.
4.2 Routing Strategy: Based on Capability Profiles and Risk Budget
Start routing with simple rules, then make it data-driven:
def route(stage, task_type, risk):if task_type in ("doc", "batch") and risk == "low":return "economy_model"if stage in ("plan", "transform", "verify"):return "strong_reasoning_model"if task_type in ("db", "device", "gui"):return "strong_reasoning_model_with_tools"return "balanced_model"
An advanced approach is to maintain success rate, average tokens, average steps, and failure-type distribution per stage, select models by weighted score, and set a “budget cap + mandatory validation” for high-risk stages.
4.3 Use a State Machine to Enforce “Step by Step”
Do not let the model decide everything freely. Write the flow as an explicit state machine where the model only produces the next action’s parameters for a given state:
- Every action has preconditions (e.g., file exists, connection available, sufficient permissions).
- Every action has postcondition assertions (e.g., row count, primary-key uniqueness, amount totals match).
- Stop and escalate once consecutive failures reach a threshold, to avoid infinite loops burning tokens.
Example:
STATE FETCH:require: target is reachableaction: download and verify hash/sizeassert: file is parseable, encoding is correctSTATE TRANSFORM:require: field mapping table existsaction: clean and standardizeassert: null rate/anomaly rate below threshold
4.4 Observability and Cost Control
Production systems should log each step’s input summary, action, output summary, latency, and tokens, with sensitive data masked. Use monitoring and alerts to detect “success rate dropping for a task type” or “abnormal step growth,” and roll back the model strategy or add validation rules promptly. For cost, use tiers: economical models for low-risk stages, strong reasoning models for high-risk stages, with hard caps on retries and context length.
5. Common Failure Modes and Improvements
- Parameter hallucination: the model invents nonexistent fields or interfaces. Fix: provide a structured schema and enum whitelists; reject illegal parameters outright and feed the error back.
- Unverifiable results: the task “looks done.” Fix: every write operation must have read-back validation or an assertion.
- Context bloat: large-file analysis causes token explosion. Fix: extract an index and summary first, process in segments, then aggregate and cross-check.
- Environment drift: UI or response structures change. Fix: prefer stable interfaces; when UI operations are unavoidable, add retries for element-location failures and keep screenshots as evidence.
- Over-planning: many steps but ineffective. Fix: set a step budget and stage-level goal checks to trigger “converge or reroute.”
6. Conclusion
Evaluating a large model’s support for agents is essentially answering an engineering question: under real business constraints, how to obtain verifiable closed-loop results at controllable cost. Making tasks scenario-based, metrics multi-dimensional, flows state-machine-driven, and model routing data-driven is what turns “occasional success” into “stable, deliverable” outcomes.
