跪拜 Guibai
← All articles
Agent · AI Programming · VibeCoding

The Harness: Two Open-Source Designs for Turning LLMs into Agents

By 愤怒的代码 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

The harness layer determines whether an AI coding agent actually delivers results: a well-designed interface can produce a ninefold improvement in SWE-bench solve rates without changing the model. Two major open-source harnesses now show opposite design tradeoffs, and understanding them is decisive for developers building or extending agent tools.

Summary

This piece explains what a harness is and why it matters for AI coding agents. The same LLM that only answers prompts in a chat box can modify files, run commands, and work for dozens of rounds when placed in a Coding Agent; the difference is the harness—all the code around the model that gives it hands, memory, and boundaries. The essential components include the agent loop (Think, Act, Observe), context assembly from four sources, an append-only session log as the single source of truth, and the agent-computer interface (ACI) that determines how well the model can act. Evidence from SWE-agent shows the same GPT-4 Turbo can go from a 1.31% to 12.47% solve rate on SWE-bench just by redesigning the interface.

The article then contrasts two open-source harnesses. DeepSeek Harness (dsh) follows "Everything is a Plugin": no privileged core, the loop itself is replaceable, and components are composed via a layered plugin tree with profiles and patches. pi takes the opposite tack: a fixed minimal core with only four extension points, deliberately omitting sub-agents and plan mode. The debate is not about whether to extend, but where to draw the boundary of composition—dsh bets on operating-system-like composability, pi on editor-like defaults and restraint. Finally, the piece argues that model capability sets the ceiling while the harness sets the success rate; mini-swe-agent's 100-line harness achieving over 74% on SWE-bench Verified shows that a strong model can make the harness very thin.

Takeaways
— A harness is all code outside the model: agent loop, context assembly, tool execution, session memory, and permission controls.
— The agent loop follows Think, Act, Observe, with step and turn as the two timing units; a turn contains zero or more steps.
— Context assembly feeds the model each round from four sources: system prompt, tool/skill definitions, runtime context, and session history, all competing for the context window.
— Session logs are the single source of truth; they are append-only, and the context sent to the model is projected from the log.
— DeepSeek Harness is built on an "Everything is a Plugin" philosophy with no privileged core, while pi has a fixed minimal core with four extension points.
— SWE-agent's interface redesign improved GPT-4 Turbo's SWE-bench solve rate from 1.31% to 12.47% without changing the model.
— mini-swe-agent uses 100 lines of Python and claims over 74% on SWE-bench Verified, showing a strong model can make a harness very thin.
— Both harnesses agree on three points: append-only session logs as the source of truth, extensions as ordinary code with same-process permissions, and harnesses as deterministic software.
Conclusions

The SWE-agent result shows that interface design can matter more than model selection for coding benchmarks, meaning harness engineering is a high-leverage investment.

Both DeepSeek Harness and pi converge on session logs as the single source of truth, indicating that durable append-only persistence is a universal requirement for agent harnesses.

The philosophical split between plugin-everything and minimal-core is not about whether to extend but about where to place the boundary of composability—both use middleware, but they differ in how much of the core behavior can be swapped.

The existence of mini-swe-agent's 100-line harness suggests that as models improve, harness complexity may collapse drastically, potentially making heavy engineering unnecessary for many tasks.

The two designs target different users: dsh suits those who want to shape the harness itself, while pi suits those who want a working product with a few customization points; neither approach is universally superior.

Concepts & terms
Harness
In the context of AI agents, a harness is all the code outside the language model that turns it from a text generator into an acting agent. It includes the agent loop, context assembly, tool execution, session memory, and permission controls.
Agent loop
The core orchestration cycle that repeatedly calls the model, executes chosen tools, and feeds results back. It typically follows Think, Act, Observe steps.
Step & Turn
Two timing units in agent execution. A step is one model request plus the tools it calls; a turn contains zero or more steps and closes when the model declares the task complete.
Session log
An append-only record of everything that has happened in an agent session: messages, branches, failures, token usage, compression records. It is the single source of truth from which the context sent to the model is projected.
ACI (Agent-Computer Interface)
The interface between an agent and its environment—what the agent sees, can do, and in what format. A well-designed ACI can dramatically improve task success rates, as shown by SWE-agent.
Seam
In DeepSeek Harness, a capability seam splits each capability into interface definition, provider, and consumer. Replacing the provider swaps the entire product behavior without changing consumer code.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗