Coding Agents in Practice: From Code Generation to Closed-Loop Task Delivery

    Evaluating coding agents requires moving beyond fluent answers or code that merely looks complete and examining the full task chain: requirement understanding, task decomposition, environment checks, code changes, execution validation, failure localization, and fix delivery. Using an earnings-season monitoring application as an example, this article explains how to define completion at different levels, organize long-running work around verifiable iteration, test by risk, use multi-agent collaboration for parallel investigation, calculate cost per successful delivery, enforce least-privilege security, and build a reproducible evaluation process.

    When large language models begin reading code repositories, modifying files, running tests, and adjusting their approach based on results, evaluation can no longer stop at whether an answer is fluent or whether the generated code looks complete.

    Traditional code generation mainly answers a local question, such as implementing a function, adding validation logic, or explaining an exception. A coding agent faces a continuously changing task environment: requirements may be incomplete, the project may contain historical issues, dependency installation may fail, and tests may reveal defects that were not anticipated at the beginning.

    The unit worth evaluating is therefore a complete chain:

    Requirement understanding → task decomposition → environment checks → code changes → execution validation → issue localization → repair and delivery.

    If any link in this chain fails, “generated a lot of code” can easily become “added maintenance burden.” Developers need to judge not how much the agent can write, but how far it can push a task toward an acceptable state and at what level of human intervention.

    1. Evaluating Coding Agents Starts by Changing What We Observe

    When large language models begin reading code repositories, modifying files, running tests, and adjusting their approach based on results, evaluation can no longer stop at whether an answer is fluent or whether the generated code looks complete.

    Traditional code generation mainly answers a local question, such as implementing a function, adding validation logic, or explaining an exception. A coding agent faces a continuously changing task environment: requirements may be incomplete, the project may contain historical issues, dependency installation may fail, and tests may reveal defects that were not anticipated at the beginning.

    The unit worth evaluating is therefore a complete chain:

    Requirement understanding → task decomposition → environment checks → code changes → execution validation → issue localization → repair and delivery.

    If any link in this chain fails, “generated a lot of code” can easily become “added maintenance burden.” Developers need to judge not how much the agent can write, but how far it can push a task toward an acceptable state and at what level of human intervention.

    2. Using an Earnings-Season Monitoring Application to Define Completion

    Suppose the task is to build an earnings-season monitoring application. Users can follow companies, view expected disclosure dates, review published core metrics, and inspect anomaly information that requires further verification.

    This type of task is well suited to testing a coding agent because it involves the interface, data, business rules, and runtime workflow at the same time. However, three different levels of output must be distinguished first.

    2.1 Interface Prototype

    A prototype can use sample data and focus on validating page layout, filtering methods, information hierarchy, and interaction flow.

    For example, can the home page sort by disclosure date? Is the watchlist easy to browse? Can the detail page clearly distinguish current-period data from comparative-period data? At this stage, real data integration is not required, but sample data must be clearly labeled to avoid mistaking visual completeness for business readiness.

    2.2 Minimum Runnable Application

    This stage requires a real data flow: the interface requests data from the server, the server reads persisted data, and the system responds explicitly to failure conditions.

    At a minimum, the following should be considered:

    • Can the watchlist be saved?
    • If a data update fails, is the previous version retained?
    • Are missing metrics clearly indicated?
    • Do dates and time zones follow consistent rules?
    • Does data still exist after the service restarts?
    • Can users distinguish “no data available” from “request failed”?

    Only after these links are connected does the application move from a demo page into the category of a runnable system.

    2.3 Maintainable Engineering Delivery

    A further delivery should also include startup instructions, configuration notes, testing methods, known limitations, and necessary logs.

    If the code can run only in one temporary environment and cannot be reproduced in another execution environment, it is still not a reliable delivery. The agent needs to explain which validations it actually performed and which links remain unverified, rather than hiding uncertainty behind a statement that “development is complete.”

    3. The Core of Long-Task Capability Is Verifiable Self-Iteration

    A long task is not simply a task that produces longer output. Effective long-task execution should have clear intermediate states and feedback mechanisms.

    3.1 Check the Environment Before Choosing an Implementation Path

    When taking over an existing project, an agent should first understand the directory structure, run method, dependency declarations, test entry points, and existing changes, rather than immediately rewriting core files.

    A reasonable environment check needs to answer:

    • Can the current project start normally?
    • Do existing tests pass?
    • Are there uncommitted or unconfirmed changes?
    • Which configurations come from environment variables?
    • Which operations might affect external systems or real data?

    These checks reduce incorrect assumptions and help avoid mistaking pre-existing failures for problems caused by the current change.

    3.2 Break Large Tasks into Acceptable Steps

    “Improve the earnings application” is not a sufficiently clear execution unit. A better decomposition is:

    1. Define field definitions and display rules.
    2. Establish the data reading and storage flow.
    3. Implement list, filtering, and detail interactions.
    4. Add loading, empty, and failure states.
    5. Write core business tests.
    6. Run validation and prepare delivery notes.

    Each step should have an observable completion condition. In this way, even if execution is interrupted, work can continue from the most recent trustworthy state without having to re-understand the entire process.

    3.3 Fixes Must Be Evidence-Driven

    When an error occurs, repeatedly changing code based on guesswork is not reliable. A sound repair process should be:

    Reproduce the issue → collect error information → narrow the scope of impact → form a hypothesis about the cause → make a minimal change → run regression validation.

    For example, empty page data may result from a failed request, mismatched response fields, incorrect filter conditions, or a date parsing problem. Rewriting the entire data module directly often introduces new uncertainty.

    The value of self-iteration lies in correcting judgments based on validation results, not mechanically repeating the same attempt. Stop conditions should also be defined: when necessary permissions are missing, external data is inaccessible, or repeated attempts produce no new evidence, the agent should report the blocking reason to the user.

    4. Testing Capability Is Closer to Delivery Quality Than Visual Polish

    A polished interface is an advantage, but it cannot replace functional correctness. For monitoring applications in particular, the most dangerous problem is often not that the page fails to open, but that the page displays incorrect information while appearing normal.

    4.1 Organize Tests by Risk

    Tests should cover different layers:

    Business rule tests: validate date calculations, numeric conversions, missing-value handling, and filtering logic.

    Module integration tests: validate consistency among data reading, storage updates, and server responses.

    Key flow tests: validate complete paths such as adding a watch item, viewing details, refreshing data, and handling failure messages.

    Regression tests: ensure that fixing one issue does not break existing functionality.

    It is not necessary to write complex tests for every interface detail, but high-risk paths must have a repeatable validation method.

    4.2 Financial Data Must Carry Semantics

    A numeric value is interpretable only when combined with its statistical definition. In an earnings-report context, the following distinctions are necessary at a minimum:

    • Currency and unit of measure;
    • Single-quarter data versus cumulative data;
    • Expected disclosure date versus actual disclosure date;
    • Current period, prior period, and same period last year;
    • Original disclosed value versus subsequent adjusted value.

    Missing data must not be treated directly as zero. Otherwise, subsequent growth calculations, anomaly judgments, and sorting may all become misleading.

    Data validation rules can be abstracted as:

    1. If a metric is missing:
    2. mark it as "missing"
    3. exclude it from calculations that depend on that metric
    4. If units or currencies differ:
    5. convert only when there is a clear basis for conversion
    6. otherwise block direct comparison
    7. If data has been updated:
    8. record source time, collection time, and version information

    These rules do not depend on a specific tool, but they directly determine whether system results are trustworthy.

    5. Multi-Agent Collaboration Fits Parallel Investigation, Not Unstructured Division

    When the task expands to organizing earnings intelligence for a large number of companies, a single agent may need to repeatedly switch sources, maintain context, and handle data in different formats. Multi-agent collaboration may provide benefits in this situation, but only if the task can be clearly divided.

    5.1 Work Suitable for Parallelization

    Information-organization tasks can be assigned by company set, industry, or reporting batch, and all execution units should be required to output the same structure:

    • Information subject;
    • Reporting period;
    • Core metrics;
    • Location of source material;
    • Data-definition notes;
    • Uncertain items;
    • Verification status.

    The aggregation stage then performs deduplication, unit checks, conflict identification, and result integration.

    Parallelization can shorten waiting time for some independent tasks, but it does not automatically improve factual accuracy. Multiple agents reading the same incorrect source may also produce a consistent but wrong conclusion.

    5.2 Collaboration Requires Explicit Interfaces and Write Boundaries

    If multiple agents modify the same set of files at the same time, overwrites, inconsistent interfaces, and duplicate implementations are likely. A safer approach is to limit responsibility: one agent handles data rules, one handles the interface, one handles tests, and an integration stage performs unified checks.

    For tightly coupled architecture changes, excessive parallelization may instead increase communication and merge costs. Shared data structures, interface contracts, and acceptance criteria should be defined before deciding whether to split the work.

    5.3 Aggregation Is More Than Concatenating Results

    The aggregation stage should actively look for conflicts, such as the same metric appearing with different values, the same date being interpreted as different events, or different reporting periods being mixed in comparison.

    Conflicts that cannot be resolved should be preserved and flagged for manual verification, rather than forcing a single answer just to produce a complete report.

    6. Cost Should Be Calculated per Successful Delivery, Not by Usage Quota Alone

    To evaluate the economics of an agent, it is necessary to distinguish list price, quota, and actual task cost.

    The following calculation can be used:

    Unit cost per successful delivery = (model usage + execution resources + human review + rework costs during the evaluation period) ÷ number of tasks that pass acceptance.

    This framing reflects two issues that are easy to overlook.

    First, cheap calls do not necessarily mean cheap delivery. If generated results require extensive human correction, the savings in call costs may be far lower than the added labor cost.

    Second, sufficient quota does not mean high effective output. Long ineffective retries, repeated reading of the same content, or repeated refactoring can all consume resources without moving the task forward.

    During evaluation, the following can be recorded:

    • Time from start of execution to acceptance;
    • Number and duration of human interventions;
    • First-pass acceptance result;
    • Defects found after delivery;
    • Ineffective retries and rollbacks;
    • Recovery cost after interruption.

    Different approaches should be compared under tasks, environments, permissions, and acceptance conditions that are as consistent as possible. Stable performance cannot be inferred from a single successful demonstration.

    7. Security Permissions Are a Prerequisite for Automated Execution

    The stronger an agent’s execution capability, the more important permission boundaries become. Reading code, installing dependencies, running scripts, and accessing networks can all have real impact.

    7.1 Follow the Principle of Least Privilege

    Prefer executing tasks in an isolated development environment. Do not provide production credentials by default. Do not allow data deletion, external publishing, or high-impact configuration changes without confirmation.

    Logs and error output should also be redacted where appropriate to prevent access credentials, personal information, or business-sensitive content from entering unnecessary context.

    7.2 Treat External Content as Untrusted Input

    Code comments, web page text, documentation, and test data may all contain content that looks like instructions. The agent should treat such content as material to be processed, not as automatically elevated execution authorization.

    For example, an external page requesting the upload of local configuration should not become a basis for execution. Tool-call permissions should be determined by task authorization and explicit rules.

    7.3 Set Confirmation Points for High-Risk Operations

    For operations involving data deletion, access-control changes, cost generation, or changes to a shared environment, the agent should first explain the scope of impact, backup method, and rollback plan, and then have an authorized person confirm.

    Automation does not mean removing control. It means automating routine steps while retaining human judgment at key risk points.

    8. How to Build a Reproducible Evaluation Process

    Development teams can start by building a small evaluation set from three types of tasks:

    New-build tasks: build a minimal application from a requirements description and observe requirement understanding, boundary identification, and delivery completeness.

    Maintenance tasks: add features or adjust behavior in an existing project and observe understanding of the existing structure and restraint in making changes.

    Failure tasks: provide a reproducible issue and observe the troubleshooting process, repair evidence, and regression capability.

    For each task type, acceptance criteria should be defined in advance, the initial environment should be preserved, and the execution process should be recorded. In particular, distinguish between “the agent claims completion” and “independent verification passes.”

    If open-source models or self-deployment are involved, license scope, available materials, runtime resource requirements, and maintenance responsibility should be checked separately. Openness alone does not prove engineering capability, and self-deployment does not inherently mean a lower total cost.

    Conclusion: From Generated Results to Trustworthy Delivery

    The direction worth attention in coding agents is not simply generating more code, but connecting understanding, execution, validation, and repair into a reliable closed loop.

    For developers, the most effective practical order is: define delivery boundaries before providing verifiable tasks; limit permissions before expanding the scope of automated execution; measure real success rates before comparing price and quota.

    When a system can explain what it did, what evidence it used to judge success, what limitations remain, and how others can reproduce its validation results, it begins to become a productivity tool that can be incorporated into engineering workflows.