Long-Running AI Agents: Capability Variability and Evaluation Methods
A single successful demo is not enough to validate an AI agent. This article presents a practical framework for evaluating agentic systems across instruction following, readability, long-task completion, and cost. It explains why long workflows become unstable and outlines task contracts, reproducible evaluation pipelines, heartbeat logging, routing strategies, failure handling, and human oversight for production use.
When enterprises adopt large language models, they are often misled by a single polished demonstration. The same system may produce well-structured presentations, spreadsheets, and formal documents, with noticeably better visual quality than previous generations. But when assigned an open-ended task that runs for several hours, it may generate excessive explanations, bury key conclusions under defensive language, fail to make completion status clear, or push decisions back to a human whenever information is missing.
This contrast—reliable structured work but unstable long-horizon autonomy—is not an isolated user experience. It is a risk that must be modeled explicitly in agent engineering.
1. Separate Capabilities Instead of Using a Single Score
A general intelligence benchmark can provide a useful point of comparison, but it cannot replace business acceptance testing. At a minimum, evaluation should be divided into four independent capability dimensions.
Instruction Following and Template Alignment
In finance, legal, sales, and similar scenarios, value often comes less from elegant writing than from strict adherence to the required template, terminology, citation boundaries, and industry conventions.
Evaluation should include samples with explicit formatting constraints:
- Fixed sections
- Required fields
- Prohibited or fabricated data sources
- A rule requiring unknown information to be labeled as unknown
Readability of the Final Output
Overly long explanations, sudden conversational language, and excessive disclaimers all increase review costs.
Use both human review and automated indicators, including:
- The proportion of actionable information
- Where the first clear conclusion appears
- Whether assumptions and open questions are presented in a scannable list
- Whether internal reasoning noise has leaked into user-facing text
Long-Task Closure
Every task should define its completion conditions in advance, such as an artifact path, a validation command, or an acceptance checklist.
If a model stops midway to ask about internal details that the execution environment should be able to determine, record this as a responsibility handoff, not as normal clarification. Clarification should occur only when the business objective is genuinely ambiguous.
Per-Task Cost
Lower prices do not necessarily mean lower total costs. Track all of the following:
- Input and output volume
- Cache-hit rates
- Retry counts
- Time spent on human intervention
When a provider or third-party benchmark reports “cost per task,” its task definition must be reconstructed before the result can be applied to your own workload.
2. Why Long Tasks Become Unstable
Long workflows connect planning, tool calls, state management, and final delivery. A failure in any one of these components can be amplified across the entire process.
Invisible State Is a Primary Problem
If an executor returns only a large block of text at the end, users cannot tell whether it is still calculating, blocked by permissions, or has already produced an unusable result.
A practical engineering requirement is to enforce heartbeats. At every step, the agent should report:
- The current subgoal
- Artifacts that have been changed
- The next step
- The reason for any block
These updates should be written to a logging service so that the run can be replayed later.
Missing Completion Criteria
A model may work for a long time without producing a usable deliverable. A task description should therefore be written as a verifiable contract rather than as a broad request such as “build a new feature.”
The contract should specify:
- Required inputs
- Output files or interfaces
- Tests that must pass
- Conditions under which failure is acceptable and execution should stop
Without such a contract, the model may substitute more explanation for actual delivery.
Unclear Tool Boundaries Encourage Responsibility Handoffs
A model should not have to guess which internal file contains a video or a log. Facts about the execution environment should be returned through read-only queries or stated explicitly through predefined artifact conventions.
Asking the model to remember environmental facts encourages it to stop and ask a human for help.
Defensive Writing Can Override Task Goals
Excessive defensive language often indicates that alignment objectives have overtaken the task objective.
System constraints should distinguish between two types of content:
- User-facing conclusions must be short and actionable.
- Risk notes should appear in a separate section with a length limit.
During review, prioritize whether the output answers three questions:
- Is the task complete?
- Where is the deliverable?
- What remains unfinished?
3. A Reusable Evaluation Process
Evaluation should not depend solely on manual testing in a chat window. It should be implemented as a repeatable pipeline.
Build Three Classes of Tasks
Prepare at least three task groups:
Short tasks
Rewriting, extraction, and template-based document or spreadsheet generation.Medium tasks
Multi-file modifications and small features with an acceptance script.Long tasks
Workflows requiring multiple tool calls and involving real intermediate blockers.
Each group should include both information-sufficient and information-deficient samples. This makes it possible to distinguish between situations where the agent should ask a question and situations where it should continue independently.
Fix the Environment, Not Just the Prompt
Use a container or isolated workspace, read-only code and data where appropriate, clearly defined object-storage paths, consistent timeouts, and a fixed maximum step count.
Run each task multiple times. Report:
- Success rate
- Median step count
- Tail failures
Do not rely on a single attractive result.
Record the Process, Not Only the Final Output
For every run, preserve:
- The initial prompt
- The sequence of tool calls
- Hashes of intermediate artifacts
- The final deliverables
- Points of human intervention
- Total execution time
Monitoring alerts should focus on abnormal patterns, such as:
- Repeated follow-up questions
- Repeatedly reading the same file
- Unusually large output volume
Use Checklists Instead of General Impressions
Example evaluation dimensions include:
- All required template fields are present
- No citations or references have been fabricated
- Code passes the predefined checks
- The document or interface has navigable structure
- Explanations are easy to scan
- The task finishes within the step budget
For research and analytical tasks, also evaluate:
- Whether assumptions are stated
- Whether insufficient data is explicitly acknowledged
- Whether conclusions go beyond the available evidence
A task contract can use a structure like the following without being tied to a specific platform API:
task:goal: Generate an analysis brief using the provided templateinputs:- template_ref- source_notesdone_when:- output_path exists and passes schema validation- unknown items are labeled as unknown and no numbers are fabricated- user-facing explanations stay within the specified lengthescalate_only_if:- business objectives conflict- required authorization is unavailabledo_not_ask:- paths and filenames that the execution environment can already query
4. Use Each Capability Where It Fits Best
Structured Office Work
Structured office work is a good primary use case when templates are explicit, acceptance checks are mechanical, and rework is inexpensive.
In these scenarios, alignment and stability matter most. If a general-purpose model performs nearly as well as a flagship model on recurring tasks while consuming fewer resources, it should be the default route. Reserve the flagship model for problems with greater uncertainty.
Programming and Interface Tasks
Separate generation from finalization.
A model may suggest a clearer implementation structure or improve information hierarchy, but every change must pass static checks and tests before being merged. Small improvements in visual design or interaction cannot replace runtime correctness.
Research Assistance
Research agents are better suited to evidence organization than to replacing human judgment.
Ask the model to compare materials, identify gaps, and draft content using a methodological template. Do not rely on it to announce a breakthrough independently.
Any external claim that suggests a record or major improvement must be verified against your own data and evaluation protocol.
Computer Use and Interface Automation
Computer-use systems and interface automation should operate only in authorized environments with least-privilege access and complete replayability.
Strong performance does not eliminate the need for auditing. Sensitive actions should be split into two stages:
- Proposal
- Execution
The execution stage should be determined by a policy engine rather than unrestricted model-generated text.
5. Cost, Routing, and Human Responsibility During Failure
Price reductions and caching can change routing strategies, but the strategy must be validated against your own billing data.
A practical approach is:
- Use a standard model for routine work by default.
- Escalate to a flagship model when template validation fails, multi-step planning is required, or the user explicitly requests deeper analysis.
- Set a step budget for long tasks.
- Stop when the budget is exceeded and return a checkpoint instead of continuing indefinitely.
Failure handling should be designed into the product rather than left to the model to improvise.
Failures that can be repaired automatically should be limited to cases such as:
- Formatting errors
- Incorrect paths
- Transient errors that are safe to retry
For failures that cannot be repaired automatically, return a blocker card containing:
- Work completed so far
- Evidence of the failure
- The single decision that requires human input
Do not return a long list of open-ended questions to the user.
Teams should also maintain a regression set. Whenever the model or prompt changes, rerun short, medium, and long tasks, then compare both success rates and human takeover time.
Focusing only on advertised strengths in office work, coding, or research can easily hide responsibility handoffs in long-running tasks.
6. Minimum Production Checklist
Before deployment, verify that:
- Every automated task has explicit completion criteria.
- User-facing output is separated from internal logs.
- Environmental facts are obtained through system queries.
- Permissions, timeouts, and artifact locations are defined in advance.
- Evaluation includes repeated runs rather than a single sample.
- Cost is calculated per successful task, not per individual call.
- Upgrade and fallback routes have clear thresholds.
On enterprise cloud platforms such as Baidu AI Cloud, teams can generally use object storage for artifacts and evaluation samples, logging and monitoring systems to observe step counts, failure types, and retries, and containers to isolate each run.
These are general engineering capabilities. The critical elements remain your own task contracts and acceptance criteria, not simply adopting a newer model name.
The conclusion is straightforward: treat the model as a variable execution component, not as an all-purpose colleague.
Assign structured work to verifiable workflows. Add heartbeats, budgets, and stop conditions to long-running tasks. Score communication quality separately. With these controls, an agent that appears brilliant in one moment and unreliable in the next becomes a system with measurable and manageable capability boundaries rather than an unexpected production risk.
