0036. 0036 — ACP agents drive the local canvas
Status: proposed 2026-11-11.
Context
Section titled “Context”Local mode (feega local, desktop app) hides the chat: the built-in agent needs an account and
credits. Users already run Claude Code, Codex or Gemini CLI. The Agent Client Protocol
(agentclientprotocol.com) lets an editor spawn any such agent and talk to it over JSON-RPC on
stdio: initialize, session/new (cwd, MCP servers), session/prompt, session/update
notifications, session/request_permission back to the client. Gui uses it to edit source.
Decision
Section titled “Decision”- The local Feega server is the ACP client. It spawns the user’s agent per turn and hands
it Feega’s own MCP server (
cli/mcp/stdio.ts, pointed at the local app URL) insession/new. The agent edits the canvas through the same tools as any MCP agent: no new tool surface, so the direction app → CLI → MCP holds. - Agents are rows in one table,
ACP_AGENTS(src/lib/server/acp/agents.ts): Claude Code and Codex via Zed’s ACP adapters, Gemini CLI native. A new agent is a row. - The client advertises no
fsorterminalcapability: the agent reaches Feega only via MCP. - Permission requests go to the user: the endpoint streams them as
permissionevents and waits for{ permission: { id, optionId } }. Aborting the turn sendssession/canceland answers pending requestscancelled. - Local mode only:
POST /api/v1/local/acpis 404 elsewhere. Cloud would need a sandboxed agent process per user; out of scope. - Tests stub the agent with
src/lib/server/acp/fake-agent.mjs, a real ACP process. No model calls.
Slice built
Section titled “Slice built”runAcpTurn (client), the agent table, the endpoint, tests. Then: the agent picker in the
local Chat tab (localStorage), SSE streaming, user-approved permissions, cancel. Not built:
keeping one session across turns.
Rejected
Section titled “Rejected”- Feega as an ACP agent (editors drive Feega): Feega is the surface, not the reasoner.
- A dependency on the ACP SDK: the client needs four methods; ~100 lines of JSON-RPC.