54 lines
2.1 KiB
Markdown
54 lines
2.1 KiB
Markdown
---
|
||
title: "从零搭建 Mini Agent Harness"
|
||
author: "陈思州"
|
||
source: "Datawhale (微信公众号)"
|
||
date: "2026-05"
|
||
type: "article"
|
||
tags: ["agent-evaluation", "harness", "engineering", "tutorial"]
|
||
---
|
||
|
||
# 从零搭建 Mini Agent Harness
|
||
|
||
> **Agent = model + harness** — 把 Agentic model 放进一个可运行、可记录、可评分的小环境里。
|
||
|
||
## 核心问题
|
||
|
||
手动测试 Agent 只能看到最终回答,看不到它是否真的读了文件、调了什么工具、有没有凭空编造结论。[[agent-harness-mini|mini harness]] 解决的就是这个——让 Agent 的每一步都留下可分析的执行记录。
|
||
|
||
## 五大模块
|
||
|
||
| 模块 | 职责 |
|
||
|------|------|
|
||
| Task | 任务输入 |
|
||
| Environment | 可操作环境(代码仓库/文件组) |
|
||
| Tools | 工具接口 |
|
||
| Trace | 每一步的工具调用、参数、返回 |
|
||
| Grader | 基于规则/脚本的结果判断 |
|
||
|
||
详见 [[agent-harness-mini]]、[[agent-eval-trace]]、[[agent-eval-grader]]。
|
||
|
||
## Eval Case 设计
|
||
|
||
[[agent-eval-case-design|eval case]] 需要明确四个要素:任务目标、环境内容、工具范围、评分规则。案例见 [[agent-eval-case-design]]。
|
||
|
||
## 公开资料参考
|
||
|
||
- [[anthropic-agent-evals]]:区分 eval harness 与 agent harness
|
||
- [[agent-computer-interface|SWE-agent / ACI]]:Agent-Computer Interface 对表现的影响
|
||
- [[terminal-bench]]:终端环境的隔离任务评测
|
||
- [[swe-bench]]:真实 issue → patch → 测试
|
||
|
||
## 核心洞察
|
||
|
||
1. **Harness 让评测从"主观感觉"变成"可分析记录"**
|
||
2. **不需要一开始就做完整平台**——先串起 Task → Env → Tools → Trace → Grader 五要素
|
||
3. **定位问题的精度提升**:能区分是任务理解错误、工具选择错误、参数填写错误还是结果解读错误
|
||
|
||
## 相关页面
|
||
|
||
- [[agent-harness-engineering|Agent Harness 工程]]
|
||
- [[harness-coupling-problem|Harness 耦合问题]]
|
||
- [[adaptive-harness-simplification|自适应 Harness 简化]]
|
||
- [[prompt-to-harness-evolution|Prompt 到 Harness 的演化]]
|
||
- [[agent-evaluation-paradigm-shift|Agent 评测范式转变]]
|