How to Separate the Impact of LLMs and Agent Harnesses on Coding Tasks

    Poor results in coding-agent tasks are often attributed to the model, but the agent harness also controls prompts, context, tools, retries, and state. This article explains how to isolate the two factors through controlled experiments, defines representative task sets and evaluation metrics, and provides checklists for front-end generation and simulation tasks, along with common misjudgments and practical recommendations.

    1. Where the Problem Comes From: When Results Are Poor, Where Is the Cause?

    In coding-agent scenarios, the same task can produce very different results when handled by different combinations. A common situation is that switching to a different execution environment noticeably improves results, while switching the model changes the results again. At this point, it is difficult to determine whether the problem lies in the model’s reasoning ability or in the harness’s scheduling, context management, and tool invocation.

    The agent harness is responsible for wrapping the model into an agent that can complete work. It determines how system prompts are organized, how context is truncated, how tool calls are parsed, whether to retry after failures, and how output is written back to the filesystem. The model is only one part of the system. If the harness loses information at any point, the final result will degrade, and this degradation often looks like “the model has become weaker.”

    Therefore, the first step in evaluation is not to compare which model is stronger, but to separate the two types of factors.

    2. Four Layers That Affect Results

    A coding-agent task can be analyzed at four layers.

    1. Model layer: the base capability to understand requirements, plan steps, and generate code.
    2. Context layer: system prompts, how project files are selected, and compression strategies for historical dialogue.
    3. Tool layer: parameter formats and handling of returned results for tools that read and write files, execute commands, and search code.
    4. Control layer: loop termination conditions, error retry mechanisms, and state tracking for multi-step tasks.

    A problem at any layer may appear as “the result is wrong,” but the fixes are completely different. Model-layer issues usually require changing the model or adjusting how the task is decomposed. Context-layer issues require improving prompts and retrieval strategies. Tool-layer issues require checking parameter parsing. Control-layer issues require checking loop logic and state management.

    3. Controlled Experiments with Control Variables

    To separate these factors, the most reliable method is to control variables: fix the task set and judging criteria, and change only one factor at a time.

    The experiment should include at least two comparisons:

    • The same model connected to different agent harnesses. If results differ greatly, the problem mainly lies in the harness layer.
    • The same agent harness connected to different models. If results differ greatly, the problem mainly lies in the model layer.

    Doing only one of these can easily distort conclusions. For example, if you only change harnesses, you may happen to hit an improperly configured default parameter and mistakenly conclude that the harness as a whole is unusable.

    3.1 Task Set Design Principles

    The task set should cover typical scenarios and, where possible, allow objective judgment of results:

    • Single-file generation: write a function or a page and check whether it runs correctly.
    • Multi-file modification: add a feature to an existing project and check whether existing tests are broken.
    • Defect repair: provide reproduction steps and check whether regression tests pass after the fix.
    • Iterative modification: make new change requests on generated results and check whether earlier constraints are forgotten.

    Iterative modification tasks are especially important. Many problems only surface in the second or third round, because as context grows longer, early constraints are easily missed.

    3.2 Evaluation Metrics

    At minimum, record the following metrics:

    • First-pass rate: whether the result meets requirements without human intervention.
    • Repair rounds: how many dialogue rounds are needed to reach a usable state.
    • Regression defects: the number of new issues introduced after fixing one issue.
    • Tool-call failure rate: the number of tool parameter errors or execution failures.
    • Latency and invocation cost: the time and resources spent completing the same task.

    Each combination should be run multiple times and averaged. A single run is heavily affected by randomness and is insufficient to support conclusions.

    3.3 Evaluation Loop Example

    The following code is unrelated to any specific product. It only shows the structure of an evaluation loop: fix the tasks, run different combinations separately, and record the results.

    1. from dataclasses import dataclass
    2. @dataclass
    3. class RunResult:
    4. passed: bool
    5. rounds: int
    6. tool_errors: int
    7. def evaluate(task, model, harness, runs=5):
    8. results = []
    9. for _ in range(runs):
    10. session = harness.start(model=model, workspace=task.workspace)
    11. session.send(task.prompt)
    12. while not session.finished and session.rounds < task.max_rounds:
    13. if session.needs_feedback:
    14. session.send(task.next_feedback(session.output))
    15. passed = task.check(session.workspace) # run tests or validate output structure
    16. results.append(RunResult(passed, session.rounds, session.tool_errors))
    17. return summarize(results)
    18. # Fix the task set and evaluate (model, harness) combinations separately
    19. for model in ["model_a", "model_b"]:
    20. for harness in ["harness_x", "harness_y"]:
    21. print(model, harness, evaluate(task, model, harness_impl[harness]))

    The key is that result judgment is performed by scripts rather than by subjective scoring from the evaluator. task.check should run tests or validate the output structure, avoiding treating “looks good” as a pass.

    4. Evaluation Points for Front-End Generation Tasks

    Front-end generation tasks produce interactive pages, so evaluation cannot rely only on screenshots. Check three aspects.

    First is requirement coverage. Go through the requirements in the prompt item by item, for example, whether fonts, layout, navigation structure, and footer information are all implemented. Split the requirements into a checklist and confirm each item.

    Second is interaction completeness. Collapsible panels, popovers, side tables of contents, and similar components need to be operated in practice. A common problem is that display state and style state are not managed consistently. For example, the table of contents can expand, but after it collapses, the body text shows garbled characters or a broken layout. This usually indicates a flaw in the state-switching logic.

    Third is repair stability. After asking the model to fix a known issue, retest all related interactions to check whether new issues have been introduced. Fixing only the reported issue without regression testing is the most common failure mode in iterative tasks.

    An example checklist:

    • Does the table of contents obscure the body text in the default state?
    • After the table of contents collapses, do the body width and layout recover?
    • During the expand and collapse transitions, are there residual styles or abnormal characters?
    • Is the layout usable on both narrow and wide screens?

    5. Evaluation Points for Simulation Tasks

    Simulation tasks, such as a timeline and data dashboard simulating a crewed lunar flyby, have higher correctness requirements. They include the interface, data, and logic, and all three need to be checked.

    Evaluation can start with data consistency:

    • Does the stage order match the real mission flow, and are all states updated synchronously after a stage jump?
    • When dragging the timeline, do telemetry values change continuously without unexplained jumps?
    • Does distance data conform to basic physical common sense? For example, the average Earth-Moon distance is about 380,000 km, and the distance curve in the simulation should fall within a reasonable order of magnitude.
    • Are event markers aligned with the corresponding time points?

    These tasks are prone to “good-looking interface but incorrect data.” Evaluation should check the data layer separately rather than looking only at visual effects.

    Example code for data checks:

    1. MAX_STEP_KM = 5000 # Maximum allowed distance change between adjacent samples; set according to the sampling interval
    2. def check_telemetry(frames):
    3. for prev, cur in zip(frames, frames[1:]):
    4. assert cur.time >= prev.time, "Timestamps must be monotonically increasing"
    5. jump = abs(cur.distance_km - prev.distance_km)
    6. assert jump < MAX_STEP_KM, "Distance jump between adjacent frames; possible data error"
    7. return True

    6. Common Misjudgments and How to Avoid Them

    In practical evaluation, the following types of misjudgment are common.

    First, treating a single success as stable capability. A model occasionally getting something right once does not mean it can do it reliably. Run multiple times and calculate the pass rate.

    Second, treating a prompt problem as a model problem. When requirements in the prompt are ambiguous, the model implements them according to its own understanding, so the result naturally does not meet expectations. In this case, revise the prompt first, then consider changing the model.

    Third, looking only at the final round’s result. Intermediate rounds may already have introduced regression defects, and the final small patch can hide them. Save each round’s output for traceability.

    Fourth, ignoring environment differences. The same model performs differently under different tool configurations, context lengths, and timeout settings. Comparative experiments must keep the environment consistent.

    7. Practical Recommendations

    1. First establish a fixed task set covering at least three typical scenarios.
    2. Use controlled-variable comparison experiments and record the impact of the model and the harness separately.
    3. Base judgments on scripts and test results, and reduce subjective scoring.
    4. Add regression checks for iterative tasks; do not verify only the reported issue.
    5. For simulation and data tasks, check data-layer consistency separately.
    6. Record evaluation results in version history.