Editor’s introduction
The research examines harness effects in LLM-based software engineering agents, comparing two representative harnesses—mini-SWE-agent and OpenCode—across ten models from Qwen and DeepSeek families on three benchmarks. Results show that harness effectiveness varies with model capability and task type, with complex harnesses offering diminishing returns on issue repair but benefiting stronger models on open-ended repository tasks. Component-level analysis reveals that structured tool use and task-specific subagents consistently improve performance, while context compression and general subagents negatively impact repository-generation tasks. These findings indicate that harness design is a critical factor in agent performance, with specific components yielding measurable gains or losses depending on context.
Introduction
Large Language Model (LLM)-based agents are increasingly used to solve Software Engineering (SE) tasks, such as issue resolution, code modification, and test generation. While much progress has been driven by stronger foundation models (e.g., GPT, Claude, Gemini, DeepSeek, Qwen ), the performance of coding agents also depends heavily on the model-external infrastructure that surrounds the model, including context retrieval, tool use, execution environments, patch generation, and validation. This infrastructure is commonly referred to as the agent harness.
Despite this impact, existing SE research has not yet isolated harness design as an object of systematic study. Recent work has introduced increasingly capable coding agents for specific software engineering scenarios. These agents necessarily make concrete harness-level choices, such as how to retrieve repository context, expose tools, plan edits, run tests, and select final patches. However, these choices are typically evaluated as part of an end-to-end agent system, rather than analyzed as separable design components. As a result, we still lack a clear understanding of which harness components drive improvements, how they interact, and how their effects depend on base models and task types.
To bridge this gap, we conduct an empirical study of harnesses in SE agents. Our study focuses on two complementary perspectives: (1) how models, harnesses, and tasks jointly shape agent performance; and (2) how harness components contribute to performance on general SE tasks.
For the second perspective, we follow commercial harness designs (e.g., Claude Code and Codex ) to identify five core components of modern harness architectures, and implement each component in a minimal form. Starting from mini-SWE-agent, we incrementally add these plug-and-play components to the existing harness in a building-block manner, creating a controlled harness variant called NanoHarness for component-level analysis. Using ProgramBench as the testbed, we evaluate both the isolated effect of each component and the combined effect of integrating all components. In addition, we collect and analyze both the performance and execution behavior of NanoHarness and its variants, and further conduct trajectory-level analysis.
Experimental results show that harness design substantially shapes SE-agent performance, but its effect is neither uniform nor monotonic. First, harnesses play different roles under different task regimes. On SWE-style issue repair, where workflows are relatively fixed and edits are often localized, complex harnesses mainly compensate for weaker models, and their marginal benefit decreases as model capability improves. In contrast, on newer and more open-ended repository-level tasks such as ProgramBench and GitTaskBench, complex harnesses behave more like capability amplifiers: only sufficiently capable models can reliably exploit the additional workflow complexity.
Overall Study Design
Study 1: Measuring Joint Effects of Models, Harnesses, and Tasks. SE research mainly follows three directions: improving coding-oriented models, designing agent harnesses, and building SE tasks and benchmarks. Model-oriented studies train models through code pretraining, fine-tuning, reinforcement learning, or inference-time optimization. Harness-oriented studies improve how agents use repositories, tools, tests, and execution environments. Task-oriented and benchmark-oriented studies design realistic SE tasks and evaluation protocols. However, these directions are usually studied with separate focuses, leaving the joint effects of models, harnesses, and tasks underexplored.
To examine these joint effects, we design our first study around the three factors. For models, we select multiple models from the same model family, ranging from weaker to stronger ones, so that performance differences can reflect changes in model scale and capability while reducing variation caused by model lineage. For harnesses, we compare a lightweight basic harness with a more complex product-level harness, which allows us to measure how much the surrounding agent workflow changes SE task performance. For tasks, we choose benchmarks that cover different stages of the software development lifecycle, including requirements analysis, architecture design, coding, testing, and validation. By combining these factors in a unified three-dimensional experimental matrix, we evaluate each model under each harness across each task, allowing us to compare their individual effects and analyze how they interact in LLM-based SE agents.
Tool Registry. We extend the Bash interactive mode of mini-SWE-agent into a tool layer, implemented through a unified registry and native tool-calling mechanism. We introduce four file-system-oriented tools: read_file, write_file, edit_file, and glob. read_file provides bounded file inspection, write_file creates or overwrites files, edit_file applies localized textual modifications, and glob supports pattern-based file discovery.
Context Compression. We implement a context compression module for long-horizon execution under limited context windows. Oversized tool outputs are persisted to the workspace, with only paths and short previews retained in the prompt. When history grows too long, the module applies message snipping and observation compaction while preserving recent results and high-value outputs. If the context still exceeds the limit, it triggers LLM-based summarization to retain necessary information. Compaction can also be invoked manually or after context-window errors, with logs kept for auditing.
Explicit Planning. The planning module adds a TodoWrite-style lightweight planning mechanism to the agent. When enabled, the agent can call todo_write to maintain a short task list, where at most one item may be marked as in_progress. Each update replaces the full todo list and is validated by TodoManager for item format, status values, list length, and planning consistency. The current plan is rendered back into the prompt and saved in the trajectory metadata. To avoid stale plans, the agent injects reminders when the plan has not been updated for several rounds.
Implementations
We use a unified execution protocol across all experiments. For model inference, we set the temperature to 0.0 for all models to reduce randomness. For SWE-bench Pro and GitTaskBench, we follow the original evaluation settings and limit each task to 250 agent steps. For ProgramBench, we reduce the step limit from the original 1,000 steps to 300 steps to reduce evaluation cost. Each task is also subject to a 6-hour wall-clock limit and a 3-minute timeout for each command execution. To control evaluation cost in RQ1, we use random subsets for the larger benchmarks: RQ1.1 uses a random sample of 300 instances from SWE-bench Pro, and RQ1.2 uses a random sample of 70 instances from ProgramBench. We use the same sampled instances across all matched model-harness configurations. RQ1.2 uses all 54 GitTaskBench instances. The component-level experiments in RQ2 and RQ3 use the full 200-instance ProgramBench set. SWE-bench Pro and ProgramBench are evaluated in Docker containers, while GitTaskBench is evaluated in a local environment. For containerized tasks, we disable network access with —network none, allocate 20 CPUs and 60 GB memory per container, set a 7-hour container lifetime, and disable SYS_PTRACE. For GitTaskBench, we isolate the working directory and block operations outside the workspace. For NanoHarness, we set the maximum number of subagent rounds to 50 and limit the planning module to at most 10 todo items. Context compression is enabled with a 350K-token budget, and the most recent 20 messages are preserved when compression is triggered.
RQ1.1-Scaling of Harness Performance with Model Capability
Our controlled experiments on a random 300-instance sample from SWE-bench Pro further support this trend, but also reveal that the scaling pattern differs across model families. For the Qwen family, the effect is relatively smooth. As model capability increases from Qwen3-Max to Qwen3.7-Max, both mini-SWE-agent and OpenCode improve, while the performance gap between them gradually narrows. Specifically, the OpenCode advantage decreases from about 6 pp for Qwen3-Max to 2.67 pp for Qwen3.7-Max, indicating that stronger Qwen models rely less on the additional scaffolding provided by the product-level harness.
RQ1.2-Harness Performance on Different SE Tasks
To verify whether the findings from RQ1.1 are generally applicable, in RQ1.2 we select ProgramBench and GitTaskBench and conduct experiments using the same configuration as RQ1.1. We randomly sample 70 of the 200 instances from ProgramBench, including 20 easy, 21 medium, and 29 hard instances, and use all 54 instances from GitTaskBench.
As shown in Figures 7 and 8, we find that on ProgramBench, OpenCode does not bring greater improvements to weaker models than mini-SWE-agent. Only the latest models (e.g., Qwen3.7-Max and DeepSeek-V4-Pro) can consistently leverage the complex harness to complete tasks more effectively. On GitTaskBench (Figures 9 and 10), we also observe a similar phenomenon: Qwen3.6-Max and DeepSeek-V3.1 are the respective turning points within their model families at which models begin to leverage a complex harness such as OpenCode.
The above results indicate that model capability is not the only factor affecting the effectiveness of a harness; task type and difficulty are also important factors. Compared with ProgramBench and GitTaskBench, SWE-bench Pro has a relatively fixed workflow, and code modifications typically involve only functions in a small number of files. In contrast, ProgramBench is a repository-generation task from scratch, often requiring the model to generate tens of thousands of lines of code while covering fine-grained functionality. The difficulty of GitTaskBench lies in its task flexibility: it involves multiple objectives and requires the model to independently understand the task goal, leverage repository information, and design an execution workflow. In addition, given the growing industry attention to SWE-style tasks in recent years, models may have received task-specific training, which could make them inherently stronger on this type of task and thereby reduce their dependence on the harness.
RQ2: Component-Level Effect Analysis
In RQ1, we treat the harness as a whole and analyze its performance across different SE tasks. Although the results show that complex harnesses (e.g., OpenCode) can improve performance compared with basic harnesses (e.g., mini-SWE-agent), the sources of these improvements remain unclear. Therefore, in RQ2, we decompose and combine representative components of the harness to construct the lightweight and modular NanoHarness. We then conduct ablation experiments on the full ProgramBench set with NanoHarness, using two advanced LLMs, Qwen3.7-Max and DeepSeek-V4-Pro.
RQ2.1-Individual Effect
Figures 11 and 12 show that different harness components contribute unevenly to agent performance. Among the individual components, the tool registry and task-specific subagents bring the most consistent improvements across both models. For Qwen3.7-Max, adding the tool registry improves the ProgramBench score by 4.57 percentage points, while task-specific subagents bring the largest single-component gain of 5.91 percentage points. For DeepSeek-V4-Pro, the same two components also provide strong gains of 3.54 and 4.46 points, respectively. These results suggest that structured repository operations and task-oriented delegation are particularly useful for repository-generation tasks, where agents must inspect files, create or modify multiple modules, and repeatedly validate implementation behavior.
Planning and lazy skills also improve performance, but their effects are more moderate and model-dependent. Explicit planning yields small gains for both Qwen3.7-Max and DeepSeek-V4-Pro, indicating that lightweight task lists can help organize long-horizon execution, but planning alone is insufficient to substantially improve repository generation. Lazy skills show a larger benefit for DeepSeek-V4-Pro than for Qwen3.7-Max, suggesting that procedural guidance is more helpful when the model can effectively decide when and how to invoke it.
In contrast, context compression and general subagents degrade performance for both models. Context compression reduces the score by 4.86 percentage points for Qwen3.7-Max and 3.85 percentage points for DeepSeek-V4-Pro, because ProgramBench requires preserving detailed requirements, interface constraints, and implementation states over long trajectories. Aggressive compression may remove information that is still useful for later coding and debugging. General subagents also underperform, indicating that generic SE delegation may introduce coordination overhead or produce artifacts that are not directly aligned with the fine-grained requirements of repository generation.
RQ2.2-Combined Effect
When all components are combined, NanoHarness achieves the best performance among the variants for both models. For Qwen3.7-Max, the full configuration improves the score from 42.88 to 50.25, yielding a 7.37-point gain over mini-SWE-agent. For DeepSeek-V4-Pro, it improves the score from 45.14 to 51.35, corresponding to a 6.21-point gain. These improvements are larger than those of any single component, showing that multiple harness mechanisms can complement one another when integrated into a unified workflow.
However, the combined improvement is not simply the sum of all individual gains. Some components, such as context compression and general subagents, have negative effects in isolation, and their interaction with stronger components may introduce additional overhead. This indicates that harness components are not independent: their benefits depend on how they are coordinated within the agent loop. Nevertheless, the full NanoHarness configuration still consistently improves both models, suggesting that positive components such as structured tools, task-specific delegation, and procedural skills can dominate the overall effect when combined properly.
Compared with product-level harnesses, NanoHarness also achieves competitive performance while remaining lightweight and modular. On Qwen3.7-Max, NanoHarness reaches 50.25, reducing the gap to OpenCode (51.68) and Claude Code (52.33) to 1.43 and 2.08 percentage points, respectively. On DeepSeek-V4-Pro, NanoHarness achieves 51.35, which is also close to OpenCode (52.48) and Claude Code (52.76), with gaps of only 1.13 and 1.41 percentage points. These results show that although product-level harnesses still obtain the best scores, a lightweight modular harness composed of representative components can recover most of their performance gains. This suggests that the benefit of complex harnesses does not necessarily come from their full engineering stack; instead, a small set of carefully selected and coordinated components can account for a substantial portion of the improvement.
RQ3.2-Effects on Failure Modes
Two cases illustrate how NanoHarness mitigates these extremes. For excessive probing, jqlang__jq.b33a763 shows how NanoHarness reduces unproductive exploration: mini-SWE-agent issued 133 reference-binary probes and passed only 1602/6491 tests (24.68%), whereas NanoHarness reduced the total number of reference probes to 43 and improved the result to 4425/6491 tests (68.17%). For insufficient probing, lfos__calcurse.49180d5 shows the opposite correction: mini-SWE-agent made only 3 reference probes before implementation and passed 1231/1994 tests (61.74%), while NanoHarness expanded exploration to 45 reference probes and improved the score to 1499/1994 tests (75.18%). These examples suggest that NanoHarness does not simply increase or decrease probing uniformly; instead, it regularizes exploration by reducing wasteful probing when the agent is stuck and increasing behavioral coverage when the agent is prematurely confident.
LLM-based Agents for Software Engineering
LLM-based agents have been widely studied for code generation, repository-level problem solving, and multi-role software development workflows such as ChatDev and MetaGPT. Other work improves agentic coding through planning, retrieval, debugging, and tool feedback. For repair and issue resolution, SWE-bench has motivated systems such as SWE-agent, AutoCodeRover, RepairAgent, and Agentless, while newer benchmarks extend evaluation to broader repository-level tasks.
These studies demonstrate the value of agentic workflows, but they usually evaluate complete systems, benchmarks, or task-specific pipelines. As a result, the effects of the model, harness, and task are often entangled. Our work complements them by treating harness design as the main research object and measuring how harnesses and their components affect SE-agent performance across models and tasks.
Agent Harness
Recent studies emphasize that agent performance depends not only on the base model, but also on the surrounding harness or external scaffolding. General agent frameworks such as ReAct, ToolLLM, Reflexion, Voyager, and AutoGen show that tool use, memory, planning, reflection, skills, and multi-agent coordination can improve long-horizon problem solving.
In SE, harnesses must support repository navigation, editing, command execution, testing, and recovery. Existing systems introduce mechanisms such as agent-computer interfaces, repository search and fault localization, and localization-repair-validation pipelines. However, these mechanisms are usually evaluated as parts of complete agents. Our work isolates representative harness components and analyzes their performance, behavioral, and efficiency effects under controlled model and task settings.
Conclusion
This paper studies harness design as a first-class factor in LLM-based SE agents. Across three benchmarks, we show that harness gains depend on model capability and task type. Through NanoHarness, we further identify which components matter: structured tools and task-specific subagents improve performance, while context compression and general subagents can hurt. Our trajectory analysis shows that effective harnesses regularize exploration and tool use, suggesting that future SE-agent design should jointly consider models, harnesses, tasks, and execution behavior.


