Hermes 通过 OpenCode ACP 接入 harness 模型

结论

Hermes 可以调用 OpenCode harness 的 ACP server,并把 OpenCode 暴露的模型(包括 opencode-go/* 与 opencode/* 系列)当作推理后端使用。2026-10-14 本地验证:

  • CopilotACPClient 以 opencode acp 启动成功。
  • list_models() 返回 OpenCode 模型列表,含 opencode-go/cat-jam-free。
  • 单轮调用 opencode-go/cat-jam-free 返回正常结果。

因此,虽然 Hermes 直接走 opencode-go HTTP provider 存在账号/免费模型限制,但 via harness ACP 可进入 OpenCode 模型目录。

最小接入

环境变量:

export HERMES_COPILOT_ACP_COMMAND=opencode
export HERMES_COPILOT_ACP_ARGS=acp

Hermes provider 选择 copilot-acp。模型 ID 直接使用 OpenCode ACP 返回的 ID,例如:

opencode-go/cat-jam-free
opencode/big-pickle
opencode-go/deepseek-v4-flash

Kanban/子 Agent 使用 acp_command=opencode、acp_args=["acp"] 的模式,与现有 Codex lane 类似。

与 Codex lane 的对应关系

面向Codex laneOpenCode lane
调用方式Hermes 安排,Codex 执行编码Hermes 安排,OpenCode 执行编码/推理
worker 权限无 Kanban 写权限,提交仅 patch无 Kanban 写权限,提交仅 patch/report
审查/测试Hermes 侧重跑Hermes 侧重跑/复核
模型来源Codex runtimeOpenCode ACP
安全要求沙盒、 isolationworktree/沙盒 isolation;避免 auto-approve 无边界

注意点

  • --acp probe 逻辑中,HERMES_COPILOT_ACP_ARGS=acp 不含 --acp,因此会被视为 custom transport,直接 subprocess 启动。
  • 只读/执行权限应与 target 目录和 task boundary 一起设计;不要仅依靠 OpenCode --auto 作为权限边界。
  • 会话超时可能需要按任务类型调参(轻量推理 vs coding lane)。
  • OpenCode 免费模型可能受 harness account / quota 限制,不是无限制基础设施。
  • provider 名称为 copilot-acp,但 agent 是 OpenCode;日志与审计需要明确标注。

不确定项

  • 是否需要 profile 级持久配置;当前只验证 env override + Python 入口。
  • 对 sandbox/network policy 与 OpenCode MCP 插件的权限交互尚未 tested。
  • 对 long-running Kanban 任务的 checkpoint/retry behavior 仍需实测。