Evaluating LLM Coding Agents: Capability Boundaries and Engineering Practices
While LLM-based coding agents excel in simple demos, complex software refactoring tasks reveal their true capability boundaries. This article explores the gap between "demo-ready" and "production-deliverable," analyzing common failure modes such as misattributing code errors, premature completion claims, and uncontrolled code modifications. It further proposes an engineering evaluation framework and outlines practical implementation strategies—like workspace snapshots, acceptance gates, and patch budgets—to integrate coding agents into reliable, verifiable development workflows.
1. From “Demo-Ready” to “Production-Deliverable”
Complex software refactoring is a typical scenario for testing the capabilities of LLM coding agents. It differs significantly from single-file code completion, script generation, or page scaffolding: tasks often span multiple modules and rely on implicit constraints, build chains, test systems, runtime behaviors, and team conventions. The model must not only “write code” but also understand the existing architecture, maintain interface compatibility, verify assumptions iteratively, and locate root causes when failures occur.
A phenomenon worth noting is that given the same codebase and execution plan, different agents might quickly claim “step completed,” but whether they ultimately pass builds and tests depends on whether a true verification loop has been established. In a demo environment, task feedback is short, constraints are few, and results are immediately visible. In a production environment, issues like build logs, test failures, boundary conditions, visual consistency, interaction readability, and state layer alignment are fully exposed. Therefore, evaluating a coding agent should not focus solely on generation speed or surface-level code quality, but on whether it can consistently deliver within a verifiable engineering loop.
2. Typical Failure Modes: It’s Not Just About “Model Capability”
2.1 Misattributing Code Errors to Environment Issues
In some observations, an agent fails to build after a quick modification but attributes the failure to “build cache anomalies” and requests human intervention. More critically, after clearing the cache, it does not immediately re-run the build to verify; instead, it proceeds to the next step, causing errors to accumulate.
The essence of this failure is the lack of an evidence chain in failure attribution. While build caches can affect results, “cache issues” should not be the default explanation. The correct approach involves:
- Retaining the original build logs and change diffs;
- Reproducing the issue in a clean workspace;
- Comparing logs, dependency states, and artifact hashes before and after cleaning;
- If the clean build still fails, prioritizing the inspection of code, interfaces, dependencies, and configurations;
- Only entering the environment repair process when reproducible evidence proves an environment anomaly.
In other words, clearing the cache is a diagnostic tool, not a fix; a passing build is the completion standard.
2.2 Claiming Completion Without Verification
A common misconception for coding agents is equating “modified files” with “task completed.” In complex refactoring, completion should at least include: code builds successfully, tests pass, static checks pass, key behaviors meet expectations, changes are reviewable, and necessary documentation is synced. Without this evidence, “completion” is merely the end of an editing action.
Teams should define clear acceptance gates for each step, for example:
step_done =build_passand unit_tests_passand integration_tests_passand static_checks_passand diff_reviewableand acceptance_criteria_met
For UI or interaction tasks, additional checks should include reproducible screenshot comparisons, geometric constraint checks, state layer consistency checks, and manual acceptance.
2.3 “Shotgun” Modifications Amplify Risk
When an agent cannot locate the root cause of a compilation failure, it tends to exhibit a “change a line here, change a line there” behavior: continuously expanding the scope of modifications without establishing a minimal reproduction or rolling back invalid assumptions. While this may look like active fixing in the short term, it actually increases unreviewable changes, making the problem difficult to converge.
A more robust strategy is to introduce patch budgets and blast radius control:
- Limit the number of modified files and the scale of changes per step;
- Validate only one primary hypothesis per commit;
- Perform a minimal reproduction before modifying when a compilation fails;
- Force a rollback to the last stable snapshot after consecutive failures;
- Require interface contracts and tests to be added before cross-module changes;
- Directly reject unexplained batch modifications from proceeding to the next phase.
The value of an agent lies not in changing a lot at once, but in making each change explainable, verifiable, and reversible.
2.4 Disconnect Between Planning and Execution
Even if the original plan is detailed, an agent may still ignore step dependencies, acceptance criteria, and risk prompts during execution. For example, it might proceed to the next step before the previous step passes the build, or consider “visual style mentioned in the plan” as “visual style implemented.”
The solution is to upgrade the plan from a natural language document to an executable state machine. Each step should include: inputs, outputs, dependencies, acceptance commands, failure handling, rollback points, and evidence artifacts. A plan is not just a manual for humans, but a contract jointly executed by the agent and the toolchain.
2.5 “Claimed” vs. “Implemented” in Visual and Interaction Tasks
In tasks involving slider puzzles, physics simulations, maze navigation, or 3D scenes, common issues include:
- The planning text claims a certain art style, but the rendering result shows no trace of it;
- Unreasonable collision body gaps in physical scenes prevent the goal from being achieved;
- Poor UI readability with insufficient contrast between background and elements;
- The agent’s graphic is too large, obscuring the scene;
- Misalignment between the control layer, terrain layer, and rendering layer;
- Lack of stable visual regression tests after an initial failure.
These issues indicate that visual tasks cannot rely solely on whether the “final image looks right”; they require definable, checkable constraints: canvas proportion, hierarchy order, collision parameters, color contrast, state coordinate consistency, and interaction flow completion. For stylistic requirements, confirmation should come through reference images, screenshot comparisons, and manual acceptance, rather than trusting the description in the chain of thought.
2.6 Lack of Reproducibility in RL and Control Tasks
In navigation, control, and policy training tasks, a single successful run does not prove stable capability. It is necessary to record random seeds, training logs, convergence curves, environment configurations, and evaluation metrics. If the agent only modifies the presentation layer without aligning the action and terrain layers, the training cannot be considered complete even if it occasionally converges. For such tasks, acceptance criteria should include: environment reproducibility, metric comparability, policy replayability, and failure locatability.
3. Building an Evaluation Framework for Complex Tasks
Evaluating coding agents should shift from “can it generate code” to “can it reliably complete the loop.” It is recommended to design evaluations across the following dimensions:
| Dimension | Key Questions | Suggested Evidence |
|---|---|---|
| Correctness | Do builds, tests, and behaviors meet expectations? | Build logs, test reports, acceptance records |
| Verifiability | Are completion claims supported by evidence? | Diff summaries, command outputs, screenshots |
| Convergence | Can it locate and recover after a failure? | Failure classifications, retry records, rollback points |
| Change Quality | Are modifications local, cohesive, and reviewable? | File counts, lines changed, review comments |
| Stability | Are results consistent across multiple runs? | Repeated execution results, random seeds |
| Security & Compliance | Are there privilege escalations, leaks, or risky dependencies? | Access logs, dependency reviews, policy checks |
Evaluation tasks should also cover three types of scenarios: short-chain demo tasks, real-world bug fixing tasks, and cross-module refactoring tasks. Only the third type effectively exposes planning execution, verification loops, and failure recovery capabilities.
4. Engineering Implementation: Putting Agents into a “Verifiable Loop”
4.1 Workspace Snapshots and Rollbacks
Create a workspace snapshot before each task starts, and record diffs and verification results after each key step. When a failure occurs, prioritize rolling back to the most recent stable state rather than continuing to patch in a polluted environment.
4.2 Proactive Acceptance Gates
Write acceptance commands and success conditions directly into the task description. The agent must not declare completion on its own; it must be confirmed jointly by builds, tests, static checks, and human review.
4.3 Failure Classification and Evidence Chains
Categorize failures into code defects, test defects, environment anomalies, unclear specs, performance issues, UI issues, etc. Only after reproduction and log comparison should a failure be attributed to an environment issue. Each retry should carry failure evidence to avoid repeating ineffective modifications.
4.4 Patch Budgets and Phased Commits
Set a change budget for each step, such as limiting the number of files, interface changes, and dependency changes. When the budget is exceeded, the agent should split the task or request human confirmation rather than continuing to spread modifications.
4.5 Observability
Record task trajectories, command outputs, diff summaries, test results, time consumed, and costs. Observability is not only for auditing but also for evaluating whether the agent is “working with evidence.”
Below is tool-agnostic execution pseudocode:
execute(plan):snapshot = freeze_workspace()for step in plan.steps:assert step.acceptance_criteria existspatch = agent.propose(step, readonly_context)if patch.blast_radius > step.budget:return request_breakdown(step)result = run_gate(build,tests,static_checks,ui_or_behavior_checks)if not result.ok:cause = classify_failure(result.logs, patch.diff)if cause == UNKNOWN:reproduce_in_clean_workspace()compare_logs()if cause == CODE_DEFECT and patch.unstable:snapshot.rollback()agent.update_memory(cause, result.evidence)continuerecord_evidence(step, patch, result)snapshot.checkpoint()return final_verification()
5. Recommendations for Teams
First, do not substitute demo effects for real evaluation. Select representative legacy code, cross-module refactoring, and hidden acceptance use cases to observe the agent’s behavior after failures.
Second, treat the agent as an engineering participant requiring process constraints, rather than an omniscient replacement. It is suitable for repetitive modifications, adding tests, local refactoring, and drafting solutions, but must be subject to constraints from builds, tests, reviews, and rollback mechanisms.
Third, prioritize building verification infrastructure. Build speed, test coverage, static checks, visual regression, and log quality determine whether the agent can efficiently close the loop. The weaker the verification capability, the easier it is for the agent to fall into a cycle of “quick modifications, repeated failures, and unattributable causes.”
Fourth, adopt a phased introduction. Start with low-risk modules, test supplementation, documentation syncing, and local refactoring, then gradually expand to core pipelines. Maintain audit records and manual review checkpoints for each task to prevent unexplained large-scale changes from entering the main branch.
6. Conclusion
The core issue exposed by complex refactoring tasks is not a single “cache misjudgment,” but the lack of a verification loop, failure attribution, and change control. A truly usable coding agent should be able to propose hypotheses, execute modifications, run verifications, read evidence, correct errors, and roll back when necessary, rather than advancing tasks solely through fast generation and optimistic claims.
For development teams, scientific evaluation and engineering integration are more important than chasing demo effects. Putting agents into verifiable, observable, and reversible R&D workflows is the only way to transition them from “looking strong” to “reliably deliverable.”
