acp-bridge上 Production,不是 Demo

把任何本地 LLM(Ollama、llama.cpp、OpenAI 相容的後端)變成 Agent Client Protocol 相容的 agent。在 Zed、JetBrains、ACP UI、Meuxe、Codex CLI 裡 spawn 它 — 資料不離開本機。

怎麼接

你在編輯器裡寫 code。編輯器 spawn acp-bridge 當 subprocess,透過 stdin/stdout 上的 JSON-RPC 跟它對話。acp-bridge 透過原生 HTTP API 跟你的本地 LLM(Ollama、llama.cpp、vLLM、LM Studio,任何 OpenAI 相容的都行)對話。Tool calls 不離開你的機器。

┌──────────────────┐ JSON-RPC / stdio ┌──────────────┐ HTTP ┌─────────────┐ │ 編輯器 │ ─────────────────────▶ │ acp-bridge │ ───────▶ │ 本地 LLM │ │ (Zed, Meuxe, │ ◀───────────────────── │ (Rust) │ ◀─────── │ (Ollama, │ │ ACP UI, …) │ session/update │ │ │ (llama.cpp) │ └──────────────────┘ └──────┬───────┘ └─────────────┘ │ tool calls │ (sandboxed) ▼ ┌──────────────┐ │ 工作目錄 │ └──────────────┘

相容的 Client

acp-bridge 在 init 時跟每個 client 協商 protocol version。下表是各 client 目前講的版本,跟 acp-bridge 會回應的 wire。

ClientACP 版本acp-bridge wire測試狀態
Zedv1v1✓ zed_style.rs e2e
JetBrains IDEsv1v1✓ mirror Zed shape
ACP UIv1v1✓ via inspector_style.rs e2e
ACP Inspectorv1v1✓ via inspector_style.rs e2e
Meuxev1v1✓ — issue #13 已修
Codex CLI adapterv1 (minimal)v1✓ via minimal_style.rs e2e
Claude Code (Claude Agent SDK)v1v1手動驗過互通
OpenCodev2 (preview)v1 (negotiated)OpenCode 正式出 v2 後會自動協商到 v2

Protocol 支援

acp-bridge 同份 code base 完整實作 ACP v1 跟 v2。協商是自動的:init 時 client 送它偏好的 protocolVersion,acp-bridge 挑雙方都支援的最高版本,之後每個 notification 都用對應的 wire shape。

v2 改了什麼

概念v1 wirev2 wire
initialize responseagentInfo + agentCapabilities統一 info + capabilities
image capabilitytrue / false{}(marker)或 omit
Tool start notificationtool_call 帶 toolCallId + kind + status: "in_progress"tool_call_update 帶同樣欄位(tool_call 不再發)
Plan{sessionUpdate: "plan", entries[]}{sessionUpdate: "plan_update", plan: {type: "items", planId, entries[]}}
Turn 結束(無)state_update 帶 stopReason

最新版本

v0.9.1
2026-10-03
v2 wire-shape blockers + sandbox 強化
Review 抓到 3 個 v2 schema 違規,加 5 個既有 bug,跟 doc stale 修正。acp-bridge 現在也實作了 v2 baseline session/close 跟 session/list、Ollama 原生 tool.arguments object 處理、web_fetch redirect 重新驗證 allowlist。171 tests passing。
v0.9.0
2026-10-02
ACP v1 / v2 雙制 wire format
在 init 時協商 protocolVersion,emit 對應 v1 或 v2 wire shape。同份 code,根據版本 dispatch。

文章

0.9.0 — ACP v1 / v2 雙制 wire format

v2 wire shape diff、協商規則、給 LLM 的 code review prompt。

docs/scope.md

Source-of-truth capability matrix。哪些有、哪些有限制、哪些不做。

Three Things To Know

⌘

ACP v1 + v2, same code base

One binary. Negotiation at init picks the right wire shape per Client. Today that means Zed / JetBrains / ACP UI / Meuxe / Codex CLI on v1, future v2-only Clients on v2.

⌬

11 built-in tools

read_file, list_dir, search_code, write_file, edit, web_fetch (opt-in), bash, git_status / git_diff / git_log / git_commit. Sandboxed to the session working dir.

⏚

Air-gap clean, audit-friendly

Single 5 MB static Rust binary. No npm. No models.dev fetches. No LSP. Outbound only to the configured LLM endpoint, opt-in via LLM_WEB_ALLOWLIST.