正在加载陈远的个人网站

UHP统一Harness协议与HarnessRouter开源实现

推出UHP协议与开源HarnessRouter,用统一API在任意Agent Harness间路由任务,实现可替换、可对比、可降本的Agent基础设施。

Agent 工程架构与基础设施研发效能AI 应用

来源摘录

Big release here! After MCP, A2A, & AG-UI, there's another agent protocol: And this one is built for Agent harnesses: UHP (Unified Harness Protocol) is a standardized interface for running agent tasks across any agent harness, regardless of which one you use. HarnessRouter is its open-source server implementation. Here's how it works: - Your product backend sends a task + harness_id to HarnessRouter. - HarnessRouter routes it to whichever configured harness should run it. - The harness streams progress and artifacts back through HarnessRouter. - HarnessRouter returns the output to your product. Three core components handle this: - Gateway: Responses API, harness config, your model keys. - Runner: Isolated workspaces, one event stream, turn checkpoints. - Built-in tools: MCP servers, browser, database, GitHub, media. This means your agent infra becomes fully interchangeable. - Swap Codex for Claude Code without touching your product code. - Run the same task across different harnesses and compare outputs. - Add new harnesses as they emerge without any rewrites. Here's the repo: https://t.co/4y6zJShKSu (don't forget to star it ⭐) The savings can be substantial. In HarnessRouter's first controlled benchmark, changing only the harness reduced cost by up to 2.1×, with the cheaper setup using roughly 53% fewer credits on the same model. And Alibaba Cloud's Qoder has already officially adopted UHP, making it available as an agent backend through the HarnessRouter API. If you want to dive deeper, my co-founder's recent article explains why model routing is not the same as harness routing, and what it takes to support multiple harnesses. It also covers UHP, the full local setup, a working API call, and how sessions and files work. Read it below.

https://t.co/MNpA3r6Mc7

— @akshay_pachaar(Akshay 🚀)的引用原文
在 X 上查看原视频

深度解析

是什么 UHP(Unified Harness Protocol)是继MCP、A2A、AG-UI之后面向Agent Harness的开放协议;HarnessRouter是其开源(Apache-2.0、Python)服务实现,把Codex、Claude Code、Gemini CLI、Hermes等Harness变成可插拔的Agent后端,社区版可Docker自托管、BYOK,Qoder已官方采用。

架构与核心设计 三组件分工清晰:Gateway提供Responses兼容API、Harness配置与模型密钥;Runner负责隔离工作区、单一事件流和回合检查点;内置工具集成MCP、浏览器、数据库、GitHub与媒体。产品后端只需带metadata.harness_id调用一个API,会话、流式、文件、取消与结构化失败均由协议层统一处理。

值得借鉴的亮点 ① 把「模型路由」与「Harness路由」解耦,控制基准显示仅换Harness即可带来最高2.1倍成本差(省约53%额度),说明Harness层是被忽视的优化杠杆;② 工程细节扎实:密钥通过$headers/vault:引用在每回合解析并从输出、流、trace中脱敏,明确提示勿把长token放进prompt;③ API与OpenAPI文档、Console工作区、trace联动,形成完整可运营面。

坑与边界 基准指标取自官方自报方法(最优vs最差),实际收益因任务而异;CE需自管升级备份,entrypoint需root运行,安全边界依赖密钥最小权限实践。图中配图为DailyDoseofDS的协议架构示意图,属技术图解而非设计作品。