Building and Analyzing a Minimal Coding Agent Harness
说明与用途
作者从零构建了一个编码代理,以理解设计原则,并将其与参考项目“pi”进行比较。他们发现,“极简主义”意味着坚决拒绝额外功能(如MCP、子代理),同时深入完善核心工具。作者采纳了处理截断输出和确定性评估的模式。
问题
Understanding the true meaning of 'minimal' in coding agent design by building a custom harness and comparing it against a reference implementation (pi), avoiding the trap of superficial copying.
结果
The author learned that 'minimal' in agent design refers to disciplined scope rather than small code size. By building first, they gained deep insight into why certain features (like compaction and robust edit tools) are necessary, and identified critical bugs in their own implementation regarding truncated outputs and evaluation metrics.
工作流
- Build a coding agent harness from scratch without looking at reference implementations.
- Define a strict set of tools and constraints (e.g., no MCP, no subagents).
- Implement a basic evaluation suite to measure agent performance.
- Read the source code of a reference implementation (pi) to compare design decisions.
- Diff the implementations to identify where reasoning diverged.
- Verify assumptions by inspecting source code directly (e.g., checking grep matches) rather than trusting surface-level metrics.
- Adopt robust patterns from the reference, such as handling truncated outputs and deterministic judging.
证据
The edit tool alone is 443 lines... Compaction arrived because long sessions genuinely need it.
pi checks whether the model's output was cut off by the token limit, and if so refuses every tool call in that message
pi's 'judge' isn't an LLM. createJudge() is a deterministic multi-criteria scorer.
- 记录日期: 2026-09-05T14:13:17.190Z