Long-Horizon Coding Agents: Capability Boundaries and Production Engineering Practices

    This article examines the practical boundaries of long-horizon coding agents through two contrasting hands-on tasks: a security-sensitive retrofit of a legacy codebase and a from-scratch build of a complete knowledge-learning game. It explains the post-training scaling logic behind the capability gains, documents where the agents succeeded and where manual acceptance caught a P1 permission-isolation flaw, and offers engineering guidance for positioning agents as high-intensity executors while keeping human gates on permissions, security, and final delivery.

    Long-Horizon Coding Agents: Capability Boundaries and Production Engineering Practices

    1. Conclusion First: The Capability Ceiling Is Rising, but Delivery Still Depends on Humans

    Discussions around long-horizon code generation often rely on benchmark scores, but those scores reveal only the tip of the iceberg. What really determines whether an agent can enter a production workflow is its performance on long tasks: whether it can understand complex context spanning multiple modules, whether it can sustain cross-file and cross-layer changes, and whether it can carry a task all the way to a runnable and testable state.

    Recent in-depth hands-on testing shows that agents with long-horizon coding capabilities have indeed pushed the upper bound of Chinese-developed models further in this area. But it is important to be clear: they are not yet at the point where “all tests are green” means safe delivery. In a retrofit of a legacy project with historical code and security constraints, the functionality ran, but manual acceptance still exposed a P1-level permission-isolation issue. In a separate task that built a complete application from scratch, the end-to-end flow ran smoothly.

    This leads to a basic judgment: these models are worth testing with real projects, especially in long-horizon coding scenarios. But wherever permissions, security, and final acceptance are involved, humans cannot let go.

    2. Evaluation Design: Two Differentiated Tasks and Two Dimensions

    To verify capability boundaries, the hands-on test deliberately designed two very different tasks:

    Task A: Security-sensitive retrofit of a legacy project. In a project with a large amount of historical code, the agent had to add “secure user image asset import and HTML animated scene references.” The core difficulty was not “writing the feature,” but understanding the old system’s layering, data flow, and existing security constraints, and then embedding the new capability without breaking existing contracts.

    Task B: Building a product from scratch. The agent was given only domain learning material and a PRD, and was asked to implement a knowledge-learning game that could be completed from start to finish. This task tested completeness across material analysis, requirement decomposition, and product implementation, as well as whether the agent could establish a reasonable engineering structure without historical code to reference.

    One task tested “understanding an old system + handling security constraints”; the other tested “material analysis + product delivery.” Together, they provide a relatively comprehensive outline of long-horizon coding capabilities in practice.

    3. Technical Logic Behind the Capability Evolution: Post-Training Scaling, Not a Base-Model Swap

    To understand this kind of capability improvement, it is necessary to see where it comes from. Compared with the previous generation, the new version did not change the base model. The upgrade mainly came from post-training scaling: the long-horizon task environments expanded to dozens of times their previous size, environment types became more diverse, and training time increased. This path of “longer and larger-scale post-training on the same base model” brought improvements in three directions:

    • Long-horizon software engineering capability: greater emphasis on sustained cross-module work, production-grade code quality, and end-to-end task closure, rather than single-point code snippet generation.
    • Security review capability: the capability extends from “generating code” to white-box code review and vulnerability reasoning. It is close to frontier closed-source models on basic security tasks, but there is still a clear gap in complete exploit scenarios.
    • Deployability and verifiability: an open-weight strategy allows developers to deploy, verify, and continue improving the model themselves, which is especially important for enterprise intranet scenarios and security evaluation.

    This evolution logic shows that long-horizon capability improvement does not come from “smarter single-step generation,” but from “repeated refinement in more complex and longer-horizon environments.” It also explains why the agent performs better on cross-module tasks while still requiring human fallback on boundary conditions that demand strict security guarantees.

    4. Task A Record: “It Runs” and “Acceptance Failure” in a Legacy Retrofit

    The typical flow of this task can be broken down into several stages:

    1. Context understanding: the agent needs to read the project structure, identify existing module responsibilities, and understand implicit constraints in historical code, such as which layers are not allowed to access the database directly and which interfaces have permission checks in place.
    2. Solution design: design integration points for the new capability under existing contracts, including input validation, asset storage, and scene reference rendering.
    3. Cross-module implementation: modify the interface layer, service layer, and front-end rendering logic at the same time while keeping the data flow consistent.
    4. Self-testing and repair: run tests and iterate on fixes based on errors until the feature is runnable and tests pass.

    In the hands-on test, the overall flow ran successfully, and the functionality reached a “runnable and testable” state. The problem appeared during manual acceptance: a P1-level permission-isolation defect was exposed. Specifically, the new asset import capability failed to strictly isolate the access scopes of different users and roles under boundary conditions. The test cases did not cover such cross-permission scenarios, and the agent did not proactively identify the implicit requirement behind this security constraint.

    The value of this case is that it reveals a typical failure mode of long-horizon coding:

    1. Functional correctness ≠ security correctness
    2. Tests passing ≠ ready to ship

    The agent is good at “making the code run.” But “making the code remain safe under malicious or unauthorized input” requires threat-modeling awareness and security acceptance criteria. That is exactly the part that still needs human review at the current stage.

    5. Task B Record: A Complete Loop from Material to a Playable Product

    In contrast to Task A, Task B involved building a learning game from scratch. The task provided only domain learning material and a PRD, with no historical code to rely on. The agent needed to complete:

    • Material analysis and knowledge decomposition: extract core knowledge points from the learning material and organize them into a gamified level structure.
    • Product structure design: determine the game loop, progression mechanism, and interaction flow according to the PRD.
    • Engineering implementation: build the front-end interface, state management, and level logic.
    • End-to-end verification: ensure the game can truly be completed from start to finish, not just a skeleton.

    The hands-on result was an end-to-end run, and the game could be completed in full. This shows that across the complete chain from requirements to product, long-horizon coding agents already have considerable autonomous execution capability. Especially in scenarios where requirement boundaries are relatively clear and there is no complex historical baggage to handle, delivery completeness is high.

    The comparison between the two tasks gives a clear conclusion: the agent is more reliable in “greenfield” scenarios than in “retrofit” scenarios. In greenfield scenarios, the constraints are established by the agent itself, so consistency is easier to guarantee. In retrofit scenarios, constraints are hidden in historical code, so both understanding cost and security risk are higher.

    6. Engineering Adoption Recommendations: Put the Agent in the Right Position

    Based on the hands-on tests above, several actionable recommendations can be made:

    First, position long-horizon coding agents as “high-intensity executors,” not “final owners.” They are suitable for cross-module changes, end-to-end feature implementation, and test-fix loops—work with high effort and long paths—and can significantly compress development cycles.

    Second, security-sensitive tasks must have manual acceptance gates. Issues such as permission isolation, input validation, and unauthorized access cannot be judged by “all tests green.” After agent delivery, run a separate threat-modeling-oriented security review, focusing on boundary conditions and role isolation.

    Third, provide an explicit constraint checklist for legacy retrofit tasks. Security constraints in historical code are often implicit, and agents will not proactively infer them. Writing these constraints as explicit checklist items for the agent can significantly reduce the probability of missed checks.

    Fourth, the evaluation system should include both “long tasks” and “security boundaries.” Looking only at feature completion overestimates capability, while looking only at security review underestimates engineering value. Only by combining both can you get a judgment close to a real production environment.

    7. Conclusion

    The progress in long-horizon coding capability is real: it can understand complex context, sustain cross-module changes, bring tasks to a runnable and testable state, and has already demonstrated high delivery completeness in greenfield full-application scenarios. But the exposure of P1-level issues such as permission isolation is also real: understanding security constraints and final acceptance remain human responsibilities.

    The reasonable stance is this: use it on real projects, especially long-horizon tasks, but maintain human review discipline on permissions, security, and delivery acceptance. This respects both the capability boundary and engineering quality.