AI Agent Batch Jobs: Why Completing a Task Is Not the Same as a Clean Delivery

    A hands-on comparison of two code-executing AI agents on a 176-file video download-and-rename job. The article covers completion, output cleanliness, cost, local small-model failure, and a three-layer way to evaluate agents—plus practical prompt and QA habits so batch work can ship without leftover scripts.

    AI Agent Batch Jobs in Practice: Completing a Task Is Not the Same as a Clean Delivery

    1. Why repetitive work is a natural fit for agents

    Imagine this requirement: you have a user table with 237 records, 176 of which include URLs for face-verification videos produced after identity checks. You need to download those videos locally and rename them using the rule name-id_number.original_extension.

    There is no deep technical challenge, but the work is expensive in human time. Manually handling 176 files can take an afternoon, and fatigue causes misses: skipped downloads, wrong extensions, inconsistent names.

    Tasks that are logically simple, highly repetitive, and easy to get wrong in the details are a typical use case for AI agents. In theory, the agent understands the request, writes a script, and runs it—fast and consistent. In practice, “it ran” and “it is ready to hand off” are often separated by small details.

    This article uses that job to compare two widely discussed AI agent tools. The focus is three dimensions: task completion, purity of the deliverable, and execution cost, plus a reusable way to evaluate agent capability.

    2. Task design: simple on the surface, traps in the details

    The source is a CSV with fields such as name, phone number, ID number, and video URLs from a third-party face-verification service.

    Three core requirements:

    1. Download every record that has a video URL (176 rows)—none missing.
    2. Keep the original file extension, including case—formats mix .mp4 and .MOV.
    3. Names must be strictly name-id_number.extension.

    Why this stresses detail:

    • Filtering: Only 176 of 237 rows have links. The script must skip empty values without false downloads or misses.
    • Case: Many scripts lowercase extensions, turning .MOV into .mov and violating the spec.
    • Robustness: Timeouts and dropped connections are common in bulk downloads. Retries and error handling decide whether you get every file.
    • Delivery hygiene: Scripts, data copies, and logs must not land in the delivery folder.

    The first two test understanding and coding; the third tests engineering habits; the fourth tests delivery discipline—where many agents fail.

    3. Two code-execution paths, split by details

    Setup

    Both agents used the same underlying large model, the same task description, and the same output-directory rules. Both wrote Python for bulk download rather than calling tools one URL at a time.

    Typical structure (illustrative):

    1. import csv
    2. import os
    3. import requests
    4. os.makedirs("output", exist_ok=True)
    5. with open("users.csv", encoding="utf-8") as f:
    6. rows = [r for r in csv.DictReader(f) if r["video_url"]]
    7. for row in rows:
    8. # Key 1: take the original extension from the URL, keep case
    9. ext = os.path.splitext(row["video_url"])[1]
    10. filename = f"{row['name']}-{row['id_number']}{ext}"
    11. filepath = os.path.join("output", filename)
    12. # Key 2: retry on failure so none are missing
    13. for attempt in range(3):
    14. try:
    15. resp = requests.get(row["video_url"], timeout=30)
    16. resp.raise_for_status()
    17. with open(filepath, "wb") as out:
    18. out.write(resp.content)
    19. break
    20. except Exception:
    21. if attempt == 2:
    22. print(f"FAILED: {filename}")

    Result 1: a clean handoff

    The first agent:

    • Downloaded all 176 videos with zero misses.
    • Followed name-id_number naming and preserved .MOV vs .mp4 case; no “helpful” normalization.
    • Left a clean directory—only the 176 video files, no leftover script, log, or temp files.

    That folder could go to the next business step with no human cleanup. Model-call cost was about 1 yuan, a strong return for the work done.

    Result 2: the job finished, with leftovers

    The second agent also completed the core job: all 176 videos, correct names and extensions.

    The delivery folder, however, contained two extras: the Python script (download.py) and a copy of the source CSV. The videos were fine, but the folder was not clean. In a formal handoff, someone still has to delete those files.

    Model-call cost was also about 1 yuan.

    4. The gap is not “can it,” but “did it think of delivery”

    The useful finding: both agents tied on hard skills—understanding the spec, writing correct code, handling errors. The split was delivery awareness.

    “The output is the product” is an engineering habit. Even among human developers, few move intermediates out of the delivery directory and delete temps. Agent behavior reflects that habit. One extra file looks small until a downstream system auto-ingests the folder and fails on an unexpected name.

    Three evaluation layers:

    1. Capability: Understand the request and produce a runnable plan.
    2. Quality: Complete, accurate results and correct edge cases.
    3. Delivery: Output matches handoff rules and needs no extra human cleanup.

    Most agents pass the first two; the third is where they diverge. When you select or accept an agent, add a test case specifically for output purity.

    5. A caution: a local small model did not finish the job

    The same task, driven by a locally deployed small-parameter model, failed across the board: malformed scripts, wrong extension handling, or missing exception handling that stopped mid-run.

    The implication is direct: multi-constraint engineering jobs have a hard bar for instruction following and code quality. Until the model clears that bar, money saved on API calls is spent on rework and debugging. If privacy forbids outbound calls, you still have to weigh waiting for a stronger local model versus splitting and simplifying the task.

    6. Practice: handing batch work to an agent with less risk

    1. State delivery rules in the prompt. For example, “the output directory may contain only the final video files.” Explicit constraints are followed far more reliably than implied ones.
    2. Spell out edges. Empty URLs, case-sensitive extensions, name collisions—write them down; do not expect the agent to guess.
    3. Validate with code, not spot checks. Check file count, naming, and extension mix:
    1. import os, re
    2. files = os.listdir("output")
    3. pattern = re.compile(r"^.{1,20}-\d{17,18}\.(mp4|MOV)$")
    4. bad = [f for f in files if not pattern.match(f)]
    5. print(f"total: {len(files)}, invalid: {bad}")
    1. Separate work dir and delivery dir. Run in a temp directory, then copy only finished files into the handoff folder so leftovers cannot pollute delivery.
    2. Cost the full path. ~1 yuan of model calls is cheap, but include time to write the spec, verify results, and clean up failures.

    7. Closing

    This 176-video batch run shows current AI agents can already handle structured, repetitive work; core capability differences were small. The real split is delivery discipline—whether you get a clean, usable product. For users, exact requirements and machine-checkable acceptance matter more than which tool you pick. Treat the agent as a capable junior engineer who needs explicit standards; that is the workable human–agent collaboration model.