Can AI Agents Self-Iterate and Evolve? Evidence from a Batch File Processing Benchmark
This article examines whether AI agents can truly self-iterate and evolve, using a batch file processing task as a benchmark. It compares two mainstream agent approaches—script-first automation and interactive tool calling—on a 237-record task involving video downloads, case-sensitive extension preservation, and strict naming rules. The analysis highlights delivery cleanliness, data fidelity, and verifiable completion criteria as the real differentiators of agent maturity, explains why small local models struggle with such tasks, and offers practical recommendations for building reliable agent workflows. Readers will learn how to define acceptance criteria, isolate intermediate artifacts, protect immutable metadata, and build regression mechanisms for measurable iteration.
1. Background: Why Batch File Processing Is a Litmus Test for Agents
At first glance, batch file processing sounds like three simple steps: traverse, download, and rename. In real engineering environments, however, it concentrates nearly every failure-prone element: inconsistent source formats, missing fields, mixed-case extensions, network jitter, broken links, and target directories polluted by intermediate artifacts. Manual processing is not only slow but also prone to omissions and low-level mistakes such as “conveniently normalizing” file extensions.
The baseline task defined here is as follows: given a table containing names, phone numbers, ID numbers, and face-verification video URLs, with 237 records in total (176 of which include video links), download all videos, preserve the original case of each extension (for example, .mp4 and .MOV coexisting), rename each file according to the rule “name-IDnumber.extension,” and deliver a clean directory ready for the next stage.
This type of task was chosen as a benchmark because it tests four agent capabilities at once: understanding constraints (naming rules and case requirements), planning and execution (batch downloads and concurrency control), error recovery (timeout retries and resumable downloads), and delivery awareness (whether scripts, logs, or data copies remain in the directory).
2. Comparing Two Technical Approaches in Practice
Two mainstream agent implementation styles were compared. One favors a “generate a script first, then execute it” automated programming route; the other favors an interactive execution route that “reasons while calling tools.” Both use the same tier of general-purpose large model, and the cost per task is on the order of one yuan, so the difference does not come from model capability but from design trade-offs in the execution framework.
The first route produces a complete download script at the start and then runs it once. Result: all 176 videos downloaded successfully, naming strictly compliant, and the case of .MOV and .mp4 fully preserved—no “normalize to lowercase” processing that looks tidy but actually destroys original information. More importantly, the target directory contains only the 176 video files; the script, logs, and data copies are written to a separate temporary workspace, so the delivery directory is the finished product.
The second route also completed the downloads and naming, with the correct video count and extension handling, but left two extra files in the target directory: the download script and a copy of the data source. This does not affect the use of the videos themselves, but it violates the implicit contract of a “clean delivery directory” and requires an additional cleanup step in a formal delivery scenario.
Abstracting the difference yields an important conclusion: an agent’s maturity is not reflected in “whether it can finish,” but in “what it leaves behind after finishing.” The former is a capability issue; the latter is an engineering discipline issue.
3. The Overlooked Key Detail: Delivery Cleanliness
In engineering practice, a delivery directory is often consumed directly by downstream processes—for example, packaged and uploaded to object storage, mounted to a transcoding service, or reconciled in batches by directory structure. In such cases, any extra file can trigger cascading problems: a script mistaken for data, a data copy causing sensitive information to be retained a second time, or a log file interfering with file-count validation.
It is therefore advisable to make delivery constraints explicit at the task-description stage rather than relying on the agent’s “self-discipline.” A reusable constraint template is as follows:
Target directory: /output/videosAllowed file types: video files onlyProhibited: scripts, logs, intermediate data copies, temporary filesNaming rule: {name}-{ID number}.{original extension, case preserved}Failure handling: retry a single failure 3 times; if it still fails, write to a report file (the report is not placed in the target directory)
Paired with a lightweight directory validation check, you can immediately determine whether the task passed after it finishes:
import os, reALLOWED_EXT = {".mp4", ".MOV"}pattern = re.compile(r"^[\u4e00-\u9fa5A-Za-z·]+-\d{17}[\dXx]\.(mp4|MOV)$")def check(output_dir, expected=176):files = os.listdir(output_dir)bad = [f for f in files if not pattern.match(f) or os.path.splitext(f)[1] not in ALLOWED_EXT]return {"count": len(files), "expected": expected, "invalid": bad, "passed": len(files) == expected and not bad}
Moving validation forward as an acceptance criterion gives the agent a clear definition of “done,” which significantly reduces delivery rework.
4. Extension Case: A Requirement Easily “Optimized” Away
Preserving case may seem trivial, but it reflects data fidelity. The original data contains both .mp4 and .MOV, indicating that the upstream system did not normalize formats. If an agent unifies them to lowercase out of a motivation for “tidiness,” the directory may look neater, but the one-to-one correspondence with the source data is broken, causing mismatches during later reconciliation.
The correct engineering practice is to treat the extension as immutable metadata: allow only reading and concatenation, never normalization. At the script level, this means avoiding a lowercase conversion on the entire filename and instead splitting the stem and suffix for separate handling:
stem, ext = os.path.splitext(source_name) # ext preserved as-istarget = f"{name}-{id_number}{ext}"
5. Why Local Models Collectively Fail at This Kind of Task
A notable phenomenon: the small, locally deployed models evaluated generally failed on the same task, with problems concentrated in three areas. First, weak long-instruction following—negative constraints like “preserve case” in the naming rule are the easiest to overlook. Second, unstable tool calling, prone to parameter concatenation errors or repeated loops. Third, lack of long-range planning: after a mid-task failure, they cannot recover on their own and often silently stop after downloading a few dozen files.
This is not a denial of the value of local models, but a clarification of their applicable boundaries: in privacy-sensitive scenarios where data must not leave the intranet, local models remain a reasonable choice, but tasks need to be broken down more finely, with external orchestration logic taking on planning and validation responsibilities—for example, splitting data into batches, validating each batch separately, and automatically re-queuing failed batches. If a container platform hosts the inference service, combined with a message queue for batch distribution and logging services plus monitoring alerts to track failure rates, the overall success rate can be brought to an acceptable level even with weak planning capability.
6. A Rational Judgment on “Self-Iteration and Evolution”
Back to the original question: do these agents truly possess the ability to self-iterate and evolve? Based on this test, a more accurate understanding is “in-task adaptation” rather than cross-task self-evolution. Within a single task, the same agent does adjust its strategy based on execution feedback—for example, lowering concurrency after a timeout, or skipping and logging a broken link—but such adjustments do not automatically accumulate as prior knowledge for the next task.
To achieve true iteration, external mechanisms are needed to close the loop: structurally retain each task’s execution trace, failure reasons, and acceptance results to form a reusable evaluation set; version-control prompts and tool orchestration, using regression tests to confirm changes introduce no degradation; and run canary validation with a fixed benchmark task set before each release. This process is essentially no different from routine software iteration—an agent’s “evolution” is more the result of engineering system evolution.
7. Implementation Checklist
- Write acceptance criteria into the task description, especially directory cleanliness and naming rules, rather than relying on default behavior.
- Isolate intermediate artifacts in a separate workspace; keep only final files in the delivery directory.
- Establish explicit protection for immutable metadata (such as extension case) and prohibit any normalization.
- Build retries, timeouts, and resumable downloads into download tasks, and output the failure list outside the delivery directory.
- Replace manual spot checks with scripted validation, turning “whether it is done” into an automatically determinable boolean result.
- Establish a fixed benchmark task set and regression mechanism so every framework or prompt change is measurable.
- In cost-sensitive scenarios, prioritize a cost-effective model tier and invest the budget in orchestration and validation, which is often more effective than simply upgrading the model.
In summary, “low-complexity, high-detail-density” tasks like batch file processing are an ideal yardstick for testing agent engineering maturity. What truly sets agents apart is not how smart the model is, but whether the execution framework has delivery awareness, fidelity awareness, and a verifiable definition of done.
