本文由 AI 分析生成
建立時間: 2026-03-29 來源: https://www.anthropic.com/engineering/harness-design-long-running-apps
Summary
Anthropic Labs engineer Prithvi Rajasekaran describes a GAN-inspired three-agent architecture (Planner, Generator, Evaluator) for autonomous long-running coding sessions. The key insights are: separating generation from evaluation breaks the self-praise loop, context resets (vs. compaction) solve context anxiety in weaker models, and sprint contracts negotiate “done” criteria before code is written. With Claude Opus 4.6, the sprint structure became unnecessary; with 4.5, it was load-bearing.
Anthropic 工程師介紹一個 GAN 啟發的三代理人架構,用於自主長時間程式開發。核心發現:將生成與評估分離打破 LLM 自我讚美的迴圈;context reset(而非壓縮)解決 Opus 4.5 的 context anxiety;Opus 4.6 能力提升後,sprint 結構不再必要。
Key Points
- Generator-Evaluator 分離:LLM 評估自己的作品會系統性地過度讚美,獨立的評估代理人(配備 Playwright MCP 直接操作應用程式)能更客觀地發現問題
- 評估標準的具體化:「這個設計美嗎?」→「這個設計符合以下四個標準嗎?」,把主觀判斷轉化為可評分的準則,evaluator 才能有效運作
- Context Reset vs. Compaction:Opus 4.5 會在接近 context 限制時「提前收工」(context anxiety),reset 提供乾淨 slate;Opus 4.6 大幅改善,compaction 即已足夠
- Sprint Contract:Generator 與 Evaluator 在寫程式前先協商「什麼算完成」,橋接高層 spec 與可測試的實作細節
- 成本對比:Solo run 200 / 6小時(Opus 4.5);簡化後的 harness $124 / 4小時(Opus 4.6),品質差異顯著
Insights
「每個 harness 元件都是對模型能力不足的假設,這些假設值得隨模型進步而重新檢驗。」這是本文最重要的設計哲學。Sprint structure 在 4.5 是 load-bearing,在 4.6 是 overhead,說明 harness 設計必須跟著模型演進。
Evaluator 的 Playwright MCP 設計尤其值得注意:它不是靜態截圖評分,而是像真實用戶一樣操作應用程式。這讓 evaluator 能發現「看起來正常但用起來壞掉」的問題,這是 unit test 覆蓋不到的 UX 層問題。
Connections
- Clippings-building-effective-agents-anthropic — Anthropic 建構有效 Agent 的設計原則,本文是其實踐案例
- claude-code
- agent-harness
- multi-agent
Raw Excerpt
“Every component in a harness encodes an assumption about what the model can’t do on its own, and those assumptions are worth stress testing, both because they may be incorrect, and because they can quickly go stale as models improve.”