Evaluating Long-Horizon Coding Agents: From Writing Code to Deliverable Software

    This article examines how to evaluate modern AI coding agents beyond single-turn code generation, focusing on long-horizon development capability. It defines the key evaluation dimensions—context understanding, cross-module coordination, and sustained iterative progress—and illustrates them with two typical real-world scenarios: adding secure asset handling to a legacy system and building a learning application from scratch. The article also explains why passing automated tests alone does not guarantee delivery readiness, especially for security-sensitive features, and proposes a layered acceptance process plus a practical human-agent collaboration model for production teams.

    1. Key Conclusion: Long-Horizon Development Ability Is Becoming the Core Metric

    When evaluating a code agent, single-shot code generation quality or a leaderboard score is not sufficient. For real software engineering, the more valuable questions are: Can the agent understand a large, existing codebase? Can it maintain contextual consistency across multi-turn interactions? Can it continuously modify multiple modules and push a feature to a runnable, testable, and maintainable state?

    Based on actual development tasks, the new generation of coding agents has significantly improved stability in long-horizon tasks. These agents can do more than generate local code snippets based on a request—they can analyze directory structure, trace call chains, understand data flow, and continuously modify interface layers, business logic, storage layers, front-end pages, and background task modules around a single goal. For tasks that require repeated execution, fault localization, and regression fixes, this capability matters more than producing a single block of “looks correct” code.

    However, it is important to note that passing tests does not automatically mean the system is ready for delivery. Especially in areas like permission control, data isolation, file uploads, cross-tenant access, and sensitive information handling, automated tests typically cover known paths only and cannot replace manual security review. Therefore, a more accurate assessment would be:

    Coding agents already have the ability to participate in real-world project development, particularly for long-horizon coding and cross-module refactoring; however, human oversight is still required at security boundaries and in the final acceptance phase.

    2. Evaluation Dimensions for Code Agents

    2.1 Context Understanding

    Requirements in complex projects rarely exist in a single, well-organized document. Critical constraints are often scattered across interface definitions, database schemas, commit history, configuration files, test cases, and inline comments. The first challenge for an agent is not “what code to write,” but “how does the current system actually work.”

    A capable code agent should be able to:

    • Quickly build an overall understanding of the project’s directory structure and module dependencies;
    • Locate functional entry points, core data structures, and key call chains;
    • Distinguish current requirements from legacy compatibility logic;
    • Identify implicit constraints, such as state machine rules, data permissions, and exception handling patterns;
    • Assess which upstream and downstream modules might be affected before making changes.

    If an agent only modifies a single file based on a natural language request, it is likely to introduce interface inconsistencies, broken state transitions, or regressions in existing features. Conversely, an agent that proactively searches for related implementations and formulates a modification plan is essential for long-horizon engineering tasks.

    2.2 Cross-Module Coordination

    Real features rarely touch just one file. For example, adding the ability to “import user image assets and reference them in feed pages” typically requires coordinated changes in:

    1. Data model: record asset ownership, path, type, status, and creator;
    2. Interface layer: provide upload, query, delete, or reference APIs;
    3. Storage layer: handle file saving, access URLs, and lifecycle;
    4. Business layer: validate user permissions and asset status;
    5. Background tasks: execute format conversion, thumbnail generation, or async transformations;
    6. Front-end pages: provide selection, preview, and error messaging;
    7. Rendering module: safely inject assets into dynamic pages;
    8. Test suite: cover normal flows, error inputs, and unauthorized access.

    The value of a coding agent is its ability to maintain consistency across these modules. For instance, if the backend adds a new field, does the front-end correctly handle null values? If an API returns an async status, does the page poll or display failure reasons? If a background task fails, can the database state be restored? Such questions require system-level reasoning.

    2.3 Persistence in Long-Horizon Tasks

    Long-horizon tasks typically follow a cycle of “analyze → implement → run → encounter errors → fix → regression-test.” If an agent only completes the first implementation round, it provides limited productivity gains.

    A more mature working pattern includes:

    • Reading project documentation, build scripts, and test entry points first;
    • Breaking the requirement into verifiable, incremental milestones;
    • Implementing the minimal runnable path first;
    • Identifying environment and logic issues through actual execution results;
    • Locating root causes from error logs rather than blindly modifying code;
    • Re-running relevant tests after fixes;
    • Finally checking code style, edge cases, and documentation completeness.

    This process capability is especially valuable for legacy systems. Legacy projects often have inconsistent naming conventions, complex backward-compatibility logic, and insufficient test coverage, making static analysis alone unreliable for correctness. The ability to keep iterating determines whether an agent acts as a “code generator” or a “collaborative engineer.”

    3. Performance in Two Representative Scenarios

    Scenario 1: Adding Secure Asset Handling to a Legacy System

    The difficulty of this scenario is not implementing file upload itself, but embedding the new capability into an existing system without disrupting the original permission model.

    A complete solution must address at least the following security concerns:

    • Whether the uploader has permission to use the target project;
    • Whether assets are accessible only to the owning user or project members;
    • Whether file types are validated by actual content, not just extension;
    • Whether filenames are normalized to prevent path traversal;
    • Whether file size, quantity, and retention period are limited;
    • Whether referencing assets in dynamic pages introduces script injection risks;
    • Whether historical jobs and caches still reference deleted assets;
    • Whether error messages leak internal paths, object IDs, or user information.

    Coding agents typically handle the main flow well: adding fields, creating interfaces, integrating storage, updating pages, and wiring the rendering chain. But security risks often hide in non-primary paths. For example, an API may check user login status but not whether the user owns the target asset; a download endpoint may directly return a file by resource ID without project-level permission checks.

    This means security validation cannot rely solely on “the API returns a success response.” Tests must be designed from an attacker’s perspective, including:

    • Using a normal user to access another user’s resource;
    • Modifying resource identifiers in requests;
    • Directly accessing file URLs that are not exposed on the page;
    • Uploading files with spoofed types;
    • Constructing filenames with special path characters;
    • Injecting special characters or script fragments into dynamic pages;
    • Continuing to access old URLs after resource deletion;
    • Submitting concurrent duplicate upload and delete requests.

    These tests are unlikely to appear in the agent’s default automated flow, so manual security acceptance remains irreplaceable.

    Scenario 2: Building a Learning Application from Source Materials and Requirements

    This scenario is closer to greenfield development. The agent must first understand a set of knowledge materials and product requirements, then design interaction flows, organize content structure, implement page logic, and ensure users can complete the entire learning journey.

    This task tests not only coding ability but also:

    • Extracting knowledge hierarchy from source materials;
    • Translating abstract concepts into actionable tasks;
    • Designing a reasonable learning path and feedback mechanism;
    • Handling user state, level progress, and completion conditions;
    • Providing clear start, advance, failure, retry, and end flows;
    • Conducting real operational verification of critical paths.

    A “complete-looking” page does not mean the product is usable. Users may not understand what to do next; a button may only change the UI state without advancing the business flow; completion conditions may never trigger; or progress may be lost after refreshing the page.

    Therefore, evaluation of such applications should include end-to-end acceptance:

    1. Start from the initial page without developer hints;
    2. Complete all tasks as an ordinary user would;
    3. Verify that every key action produces the expected feedback;
    4. Test error inputs and repeated operations;
    5. Refresh or re-enter the page to confirm state persistence;
    6. Check that the final result truly matches the product requirements.

    For knowledge-learning applications, additional attention must be paid to content accuracy, progressive difficulty, and feedback quality. An agent can quickly scaffold a product, but whether the content design suits actual users still requires human review.

    4. Why Passing Automated Tests Does Not Mean Immediate Delivery

    Automated tests are stable, fast, and repeatable, but their coverage depends on how they are designed. If tests only verify “legitimate users performing legitimate operations,” they will miss permission bypasses, abnormal states, and boundary inputs.

    Engineering acceptance should be layered into at least four levels:

    Level 1: Build and Static Checks

    Confirm that the project can resolve dependencies, compile successfully, and pass formatting, type, and static analysis checks. This level surfaces obvious syntax errors, type mismatches, and dependency issues.

    Level 2: Unit and API Tests

    Verify the behavior of functions, modules, and APIs under normal inputs and typical exceptional inputs, focusing on status codes, error structures, data consistency, and idempotency.

    Level 3: End-to-End Tests

    Simulate a real user’s complete journey from entering the system to achieving the goal, verifying that front-end, back-end, database, asynchronous tasks, and page interactions are truly connected.

    Level 4: Security and Manual Acceptance

    Review from the perspectives of privilege escalation, input pollution, resource isolation, sensitive information leakage, and abnormal flows. Also confirm that the product behavior matches the actual requirement. This level cannot be fully automated by a generative system because acceptance criteria often involve business judgment and risk trade-offs.

    5. How to Use Code Agents Correctly in a Team

    Code agents are best suited for highly repetitive, strongly structured, and iteratively refined work, but they should not be treated as unsupervised autonomous developers. A recommended collaboration model is:

    • Ask the agent to summarize the project structure and affected areas first;
    • Require it to present an implementation plan rather than directly modifying all code;
    • Break large tasks into small, reversible stages;
    • Run builds and relevant tests after each stage;
    • Require manual approval for changes involving permissions, payments, data deletion, and sensitive information;
    • Maintain clear change logs and test evidence;
    • Have developers perform final diff review and business acceptance.

    In enterprise settings, you can further integrate code repository permissions, CI/CD, log monitoring, and release approval workflows to form a closed loop of “agent executes, system verifies, human decides.” This approach leverages automation efficiency while avoiding irreversible risks being placed solely on the model.

    6. Conclusion

    The progress of the new generation of coding agents is no longer limited to generating longer code or solving simpler algorithmic problems. What truly matters is whether the agent can maintain context in complex projects, drive tasks across modules, continuously fix issues based on execution results, and ultimately deliver a runnable, testable system.

    From a practical engineering perspective, long-horizon coding capability is already sufficient for agents to participate in real projects, especially for prototyping, cross-layer feature development, test completion, and legacy code analysis. However, in areas such as permission isolation, security review, data protection, and final product acceptance, automated results alone are not enough.

    The most reasonable positioning is not to “replace the development team with agents,” but to let them take on more analysis, implementation, and verification work, while developers retain control over architectural boundaries, risk boundaries, and delivery standards. Only by combining model capabilities with engineering processes can code agents evolve from improving coding speed to genuinely improving the quality of software delivery.