对照 DeepSeek 官方开源的 deepseek-harness(github.com/deepseek-ai/deepseek-harness,Cordis「一切皆插件」架构,developer preview)。第三份 DSH 报告基于第三方逆向,本报告用官方源码验证并修正其推断。deepseek-harness 是本地单机开发者工具,art-harness 是多租户内部 IM 服务 —— 定位不同,价值评估剔除单机独占部分。
第三份 DSH 报告基于泄漏截图 + 部分源码反推;本报告用官方源码验证,修正几处推断。
| 第三份报告推断 | 官方源码验证 | |
|---|---|---|
| 「遥测一等公民」(turns/steps/cache hit 66%) | ✅ 确认 | 官方 ui-trajectory 有 TTFT + cacheRead/Write 分桶 + contextBreakdown,比逆向看到的更全 |
| 「无内置 turn budget」 | ✅ 确认 | 官方明确 "No built-in turn budget",policy 走 agent/turn-stopping 插件 |
| 「translate.ts 协议翻译」 | ✅ 基本确认 | 官方有 llm-deepseek(官方 SSE adapter)+ llm-pi-ai(多 provider) |
| 「verify / checkpoint」 | ❌ 修正 | 官方无独立 verify —— goal 是模型自报 complete/blocked("No independent evaluator");checkpoint 仅是 session persistence |
| 「Cordis 4.0 插件引擎」 | ✅ 确认且更深 | 官方 vendored Cordis,「everything is a plugin」,连 agent loop 本身都是插件 |
官方架构(docs/architecture.md + AGENTS.md)提炼的四个范式,是它和 art-harness 的根本差异。
插件向 shared context contribute services / typed events / reversible effects。无 privileged core —— model adapter、tool registry、session log、agent loop 本身都是插件,全部可从配置替换。
session log 是唯一 authority。任何进 model request 的东西必须能从 log 重建;新增 model-visible input 必须新增 SessionEvent。fork / resume / transcript / telemetry 全从这条流 derive。
agent-loop 只有 496 行,全事件化扩展点。新行为挂到 documented extension points,改 loop 必须更新 architecture.md。policy(限流/恢复/验证)全走插件,不内建。
一个 capability = Service Definition(接口)+ Service Provider(实现)+ Consumer(常用是 model-facing tool)。换 provider 不改 consumer。加能力必须设计三角。
逐项对照,标注对 clawbot 替换价值。
| 能力 | deepseek-harness | art-harness | 对 clawbot 价值 |
|---|---|---|---|
| MCP 客户端 | 完整 stdio+http,重连,HMR | 无 | 高 |
| 中间件抽象(typed events) | agent/*+tools/* 全事件化 | 自研 Hooks seam | 高 |
| compaction 精细度 | routed policy + KV cache 复用 | summary/prune | 中高 |
| 遥测细度 | TTFT + cache 分桶 + breakdown | dur_ms/iterations/ratio | 高 |
| HITL / 审批 seam | approval + ask-user | 无 | 中 |
| code runtime 多后端 | worker-thread + E2B | exec local/none | 中高 |
| Extensions 自修改 runtime | tool-cordis | 无 | 低(风险高) |
| LSP 集成 | 4 操作只读 | 无 | 低 |
| ACP 协议 | automation server | 无 | 中 |
| goal 长时程跟踪 | event-sourced + round-driver | 无 | 中 |
| plan/todo 工具 | plan-mode + todo_write | 无 | 中 |
| guard(repeat-reminder) | advisory + timeout | 无 | 中 |
| background jobs | owner-isolated + wake | cron | 低中 |
| 独立验证 | 无(模型自报) | 无 | 共同缺口,需自研 |
| message 工具(WEA 主动发) | 无(只有 ask-user) | 无 | art-harness 需自研 |
| 多租户/鉴权/配额 | 无(单机) | 有 | art-harness 自有优势 |
deepseek-harness 有完整 MCP 客户端,art-harness 无 —— 这是六份对照里反复出现的缺口,官方实现可直接借鉴。
mcp__<server>__<tool>(与 Claude Code/Codex 同形)notifications/tools/list_changed re-syncdeepseek-harness 的 typed events + 三语义(waterfall/serial/emit)是比 art-harness Hooks seam 更系统的中间件抽象。
| 事件语义 | deepseek-harness | 用途 |
|---|---|---|
| waterfall(listener 调 next() 委托) | agent/pre-step / agent/request / llm/stream / tools/pre-execute / tools/execute / tools/post-execute | 可改写/拒绝/重试 |
| serial(无 next) | agent/turn-stopping | 顺序观察,限流 policy 在此 cancel |
| emit(detached) | session events | 持久事实,append-only log |
reject pre-step、deny/ask pre-tool、retry request-error —— 这是「中间件能干预决策」而非「只观察」。
deepseek-harness 的 compaction 比 art-harness 更精细,三个点可借鉴。
| 能力 | deepseek-harness | art-harness |
|---|---|---|
| KV cache 复用 | 有 summarize 时直接 ctx.llm.stream() 重放 prefix 复用 cache | 无 |
| routed policy | 按 provider/model 不同容量 | 单一 triggerRatio |
| 两阶段剪枝 | prune-then-summarize | summary 或 prune 二选一 |
| overflow recovery | agent/request-error 路径 | 422 context_overflow |
| 人类命令 | /compact | 无 |
deepseek-harness 遥测比 art-harness 刚加的 SSE 遥测更细,几个指标可直接借鉴。
| 指标 | deepseek-harness | art-harness(已加) |
|---|---|---|
| TTFT(首 token 时延) | 有 Assistant span 分 TTFT vs decoding | 无 |
| cacheRead/cacheWrite 分桶 | 有 tokenUsage projection | cache_read/write 已有,ratio 已加 |
| contextBreakdown | system/tools/message tokens 分桶 | 无 |
| contextPressure projection | live push | context_ratio(已有) |
| iterations | 无(无迭代预算) | 有 |
| OTel 导出 | session-telemetry-otel | Opik |
deepseek-harness 有完整 HITL seam,其中 ask_user_question 对 art-harness 的 message 缺口有直接参考价值。
ask_user_question 模型工具(questions/options/multi_select)user-approval one-shot 审批(fail closed)permission-presets(sandbox mode + approval 捆绑)commands slash 命令注册/派发ask_user_question 是「模型主动向用户提问」—— 虽不是「主动发 IM」,但「模型主动发起对话」的交互模式对 art-harness 的 message 工具设计有参考:模型在 loop 中调一个工具向用户发问/发产物,而非等 run 结束。
最重要的发现 —— deepseek-harness 也没有独立验证,与 art-harness 是同一个缺口,谁也借鉴不了谁。
deepseek-harness 有些能力对多租户 IM 助手不适用或风险高,明确不借鉴。
| 能力 | 为何不借鉴 |
|---|---|
| LSP 集成(代码导航) | IM 助手很少做代码导航,价值低 |
| Extensions 自修改 runtime | agent 动态 mount/unmount 自身插件,多租户下风险极高 |
| CC/Codex hooks 桥接 | IM 助手不接 Claude Code/Codex hooks |
| session-local schedule | art-harness 的全局 cron 更适合多租户 |
| 单机 identity/credentials | harness home 模型,多租户需自建(art-harness 已有) |
| Cordis 插件系统整体 | Go + 多租户移植成本极高,只借鉴 seam/层叠哲学 |
综合官方 deepseek-harness 价值 + clawbot 场景,排定优先级。
借鉴:namespace 规则 mcp__<server>__<tool>、自动重连 backoff、list_changed re-sync、HMR。用 Go 重新实现。
价值:clawbot 284 skill 部分可 MCP 化,免自研每个集成。六份报告共识缺口,官方实现最成熟。
借鉴:typed events + 三语义 + 每点 typed Decision,让中间件能干预(reject/deny/retry)而非只观察。
价值:art-harness 缺中间件抽象是六份报告共识;这是让 DeerFlow/LongHorizon 的防御/验证能力以中间件挂入的基础设施。
借鉴:summarize 重放 prefix 复用 cache;prune-then-summarize。
价值:clawbot 84.4% cache 命中,compaction 复用 cache 进一步省钱。
借鉴:流式首 token 时延(TTFT)+ system/tools/message tokens 分桶。
价值:art-harness 已加 dur_ms/iterations/ratio,TTFT 是 UX 关键,contextBreakdown 定位膨胀来源。
借鉴:「模型主动发起对话」的工具化交互,供 art-harness message 工具(WEA 主动发)设计参考。
deepseek-harness 也缺,需自研(参考 LongHorizon Auditor + DeerFlow 产出自检)。
| 报告 | 对照对象 | 补什么层面 |
|---|---|---|
| clawbot | 真实流量 | 能力缺失:message/记忆/skill/多模态 |
| xagent | AgentScope 薄包装 | 记忆/guardrail/IntentRouter |
| DSH(逆向) | 第三方反推 | 遥测一等公民 |
| DeerFlow | LangGraph 研究agent | 治理防御:SkillScan/sandbox/loop_detection |
| LongHorizon | Loop Engineering | 执行可靠:update_plan/verified checkpoint |
| AgentScope | 框架源码 | 框架范式:中间件/事件流/Task |
| deepseek-harness(本报告) | 官方源码 | MCP/中间件三语义/compaction cache 复用/TTFT |