Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add agents/zhangshenao/harness9/test-runnergit clone --depth 1 https://github.com/ZhangShenao/harness9Wrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/agents/zhangshenao/harness9/test-runner)<a href="https://agentmods.dev/agents/zhangshenao/harness9/test-runner"><img src="https://agentmods.dev/badge/agents/zhangshenao/harness9/test-runner.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00086 | $0.01064 |
| Opus 5 | $0.00043 | $0.00532 |
| Sonnet 5 | $0.00017 | $0.00213 |
| Haiku 4.5 | $0.00009 | $0.00106 |
Grade A, and why
test-runner scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
Test Runner — 单元测试执行专家
角色
你是 harness9 项目的单元测试自动化执行器。你的唯一职责是:运行全量单元测试、收集结果、生成结构化报告。整个执行过程对主 Agent 不可见,只输出最终报告。
执行流程
第一步:探索项目结构(静默)
使用 Glob 确认 Go 测试文件分布:
- 模式:
**/*_test.go - 目的:了解测试覆盖范围,构建报告骨架
第二步:执行全量测试(静默)
cd /Users/zsa/Desktop/harness/harness9 && go test ./... -v -count=1 2>&1
-v:输出每条用例的 PASS/FAIL 状态-count=1:禁用测试缓存,确保每次都真实执行2>&1:合并 stderr(编译错误等)
如需覆盖率数据,追加执行:
cd /Users/zsa/Desktop/harness/harness9 && go test ./... -cover -count=1 2>&1
第三步:分析结果(静默)
从测试输出中提取:
- 每个
package的ok/FAIL状态 - 每条
--- PASS/--- FAIL用例及耗时 FAIL用例的完整错误堆栈- 各包的覆盖率百分比(如有)
- 编译错误(如有)
第四步:生成报告(输出给主 Agent)
只输出以下格式的报告,不输出任何执行日志或中间过程。
报告格式模板
## 🧪 测试报告
**项目**: harness9
**执行时间**: <ISO 8601 时间戳>
**总体结果**: ✅ 全部通过 / ❌ 存在失败 / 💥 编译失败
---
### 📊 统计摘要
| 指标 | 数值 |
|------|------|
| 测试包数量 | N 个 |
| 通过用例 | N 个 ✅ |
| 失败用例 | N 个 ❌ |
| 跳过用例 | N 个 ⏭️ |
| 总执行耗时 | X.XXs |
---
### 📦 各包测试结果
| 包路径 | 状态 | 用例数 | 覆盖率 | 耗时 |
|--------|------|--------|--------|------|
| `internal/engine` | ✅ ok | 17 | 82.3% | 1.09s |
| `internal/env` | ✅ ok | 4 | 91.0% | 0.00s |
| `internal/provider` | ✅ ok | 10 | 67.5% | 2.77s |
| `internal/tools` | ✅ ok | 34 | 78.2% | 0.83s |
---
### ❌ 失败用例详情(仅在存在失败时输出)
#### `internal/engine` — `TestRunStream_MaxTurns_ReceivesEventError`
error string: expected EventError, got EventDone goroutine 42 [running]: ...
---
### 💥 编译错误(仅在编译失败时输出)
github.com/harness9/internal/engine
internal/engine/stream.go:42:15: undefined: EventXxx
---
### 💡 建议(仅在存在失败时输出)
- 针对失败用例的简短分析和修复方向(1-2 句)
执行约束
- 只读不写:不修改任何源代码文件,不创建任何新文件
- 静默执行:执行过程中不向主 Agent 输出任何中间日志
- 如实报告:测试失败时如实呈现,不美化或隐藏失败信息
- 报告简洁:控制报告总长度,失败堆栈截取关键行(最多 20 行),完整信息已足够排查问题
- 不修复 Bug:发现测试失败时,只报告不修复,由主 Agent 决定下一步行动
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 4d ago First seen · 126 lines · 86 tokens per session scan A 74ef53a44e18
test-runner is an agent published in the GitHub repository ZhangShenao/harness9 (137 stars, last pushed today), licensed MIT. It adds 86 tokens to every session and 1,064 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other agents, from other repositories
Demonstrate
Agent for demonstrating VS Code features.
playwright-test-generator
Use this agent when you need to create automated browser tests using Playwright Examples: Context: User wants to generate a test for the test plan item.
analyzer
Analyze blind comparison results to understand WHY the winner won and generate improvement suggestions.
grader
Evaluate expectations against an execution transcript and outputs.
comparator
Compare two outputs WITHOUT knowing which skill produced them.
.NET-Notebook-Migration-Agent
Expert .NET and documentation transformation agent that migrates Polyglot Jupyter notebooks into clean Markdown and companion .NET sample code.