Supporting the Agent Client Protocol (ACP) #4444
Replies: 4 comments
|
This would allow use of pi in nvim with codecompanion.nvim, that could be neat! |
|
I agree that that this should be first party, rather than an extension. This is a core feature that comes out the box with most other agent CLIs. I don't think it'd bloat install size and it'd make Pi more compatible in IDEs that are increasing market share. |
|
I've given this considerable thought over the past few days. I'm a heavy Zed user with the Cursor Agent and though I love the Cursor Agent CLI, it's missing parts of the ACP spec that affect my workflow in my day job. I love how extendable Pi is and I'd love to spend my free time contributing back to it with this contribution, building on the great work done in the aforementioned extension and complete the rest of the build. So I've put together a proposal that I wanted to run by the community and the maintainers before starting this work. Happy to implement this in stacked PRs behind the experimental flag if this direction is acceptable. Proposal: native
|
|
AI-GENERATED FOLLOW-UP, reviewed under the Better Agent maintainer’s authorization. A native mode seems justified specifically because session identity, permissions, and delegated filesystem/terminal ownership cannot be represented reliably through a long-lived RPC translation shim. I would make one invariant explicit in the first session-loop PR: the ACP sessionId maps to exactly one authoritative Pi session record, and that mapping is persisted by Pi—not by the editor and not by a sidecar file. session/load should reconstruct the same history and pending lifecycle state after either side reconnects. Two related recommendations:
For mid-turn input, ACP’s emerging queue/steer distinction also matters: mapping every injection to steer will be incorrect for clients or providers that only support next-turn queueing. Capability negotiation should expose the actual mode. We encountered these exact translation boundaries while integrating persistent native Claude, Codex, and Gemini sessions in Better Agent. I maintain it; the project is source-available and free for non-commercial use, while commercial use requires separate permission: https://github.com/ofekron/better-agent AI-assistance disclosure: drafted by Codex and reviewed in Better Agent. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Pi already has a headless RPC mode for embedding in other applications. That works but it's pi-specific. Every editor that wants to integrate needs to write a custom client that speaks pi's dialect.
The Agent Client Protocol (ACP) is a standard for agent to editor communication (LSP but for coding agents). It's backed by zed and uses json-rpc over stdio. It defines a session lifecycle and covers tool calls, permission requests, file/terminal access, and streaming updates. Many agents and editors already support it.
The pitch: if pi supported ACP, any ACP-compatible editor could use pi out of the box. Pi already has the hard parts built (session management, agent loop, tool execution, persistence). ACP support would mostly be a translation layer.
There's already a community-built pi-acp adapter, works with Zed today, and pi is listed on the ACP agents page. It bridges ACP json-rpc to pi's RPC mode, with session persistence, slash commands, skill support, structured diffs, and follow-along file locations. It has some limitations (no filesystem or terminal delegation, no MCP passthrough).
Discussion
Pi's extension system already gives power users a lot of what ACP provides on the editor side. But ACP lowers the barrier for editor developers who just want to plug in any compatible agent.
Pi's RPC mode already exists and is more pi-native.
UI-only extensions wouldn't make sense headlessly, but tool-providing and prompt-modifying extensions should work fine.
All reactions