Skip to content

Comments

feat(acp): Agent Client Protocol integration — Phase 1 MVP#774

Merged
bug-ops merged 9 commits intomainfrom
feat/acp-integration
Feb 23, 2026
Merged

feat(acp): Agent Client Protocol integration — Phase 1 MVP#774
bug-ops merged 9 commits intomainfrom
feat/acp-integration

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Feb 23, 2026

Summary

  • Add zeph-acp crate implementing ACP (Agent Client Protocol) server over stdio for IDE embedding
  • Rewritten to use official agent-client-protocol SDK v0.9 primitives (SessionId, acp::Result, ContentBlock::from, AgentSideConnection)
  • Session lifecycle: initialize, new_session, prompt (streaming via LoopbackChannel), cancel, load_session
  • Filter empty chunks from Ollama thinking phase to avoid no-op notifications
  • Stream monitor via conn.subscribe() for JSON-RPC traffic debugging
  • Verified end-to-end with Zed 0.224.11: streaming responses work correctly

Test plan

  • cargo clippy -p zeph-acp -- -D warnings passes
  • cargo nextest run -p zeph-acp — 8 tests pass
  • Manual test in Zed: initialize → session/new → prompt → streaming response → end_turn

@github-actions github-actions bot added enhancement New feature or request documentation Improvements or additions to documentation rust dependencies size/XL labels Feb 23, 2026
Implement Phase 1 MVP of ACP integration enabling Zeph to run as a
coding agent inside ACP-compatible IDEs (Zed, JetBrains, Neovim).

- Scaffold zeph-acp crate with feature gate (#763)
- stdio JSON-RPC transport via agent-client-protocol SDK (#764)
- Session lifecycle: initialize, new, load, prompt (#765)
- Streaming session/update notifications via bridge_loop (#766)
- LoopbackChannel bridge pattern (consistent with A2A)
- Security hardening: MAX_PROMPT_BYTES, MAX_SESSIONS, error sanitization
- Launch with: cargo run --features acp -- --acp
@bug-ops bug-ops force-pushed the feat/acp-integration branch from d79ac48 to 31e4531 Compare February 23, 2026 15:31
bridge_loop was started sequentially after the agent spawner future,
which never completes. Use tokio::join! to run both concurrently so
streaming updates reach the IDE client.
…erns

Replace custom bridge/session architecture with the official SDK pattern:
- prompt() blocks and streams notifications via mpsc+oneshot backpressure
- AgentSideConnection handles JSON-RPC dispatch and transport framing
- AgentSpawner closure constructs Agent per session with LoopbackChannel
- Remove bridge.rs and session.rs, consolidate into agent.rs
- Fix agent wiring: spawner now receives session's channel directly

Closes #763
- SessionId as HashMap key instead of String
- acp::Result/acp::Error in Agent trait methods instead of AcpError
- ContentBlock::from() via .into() instead of ContentBlock::Text(TextContent::new())
- Remove unused next_id counter and AcpError::Other variant
Skip empty text in loopback_event_to_update to avoid flooding the
client with no-op agent_message_chunk notifications during the LLM
thinking phase. Add conn.subscribe() stream monitor for JSON-RPC
traffic debugging.
Extract build_acp_deps and spawn_acp_agent helper functions from the
monolithic run_acp_server to keep each function under 100 lines.
Destructure WatcherBundle explicitly and return watcher handles via
keepalive box to prevent them from being dropped prematurely.
Remove underscore prefix from watcher bindings used in keepalive box.
Box::pin spawn_acp_agent to satisfy large_futures lint (16KB future).
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds initial ACP (Agent Client Protocol) integration so Zeph can run as an IDE-embedded ACP stdio server (feature-gated).

Changes:

  • Introduces new zeph-acp crate implementing an ACP agent and stdio transport using the agent-client-protocol SDK.
  • Adds --acp CLI mode and a root acp feature (included in full) to launch the ACP server from the main binary.
  • Updates changelog and lockfile for the new crate/dependencies.

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
src/main.rs Adds --acp flag and ACP server runner + agent dependency bootstrap/spawner.
crates/zeph-acp/src/transport.rs Implements stdio transport using AgentSideConnection and a LocalSet for !Send agent trait.
crates/zeph-acp/src/agent.rs Implements ACP agent lifecycle, session map, prompt streaming via LoopbackChannel events.
crates/zeph-acp/src/error.rs Adds AcpError error type.
crates/zeph-acp/src/lib.rs Exposes ACP public API surface (serve_stdio, errors, spawner type).
crates/zeph-acp/Cargo.toml New crate manifest and dependencies.
Cargo.toml Adds zeph-acp to workspace deps and introduces acp feature flag.
Cargo.lock Locks new transitive dependencies for ACP SDK.
CHANGELOG.md Documents ACP addition and related CLI/feature entries.

- Move agent-client-protocol and async-trait to workspace dependencies
- Set MAX_SESSIONS=1 to match Phase 1 single-session spawner
- Gate stream monitor message body behind ZEPH_ACP_LOG_MESSAGES env var
- Update CHANGELOG to reflect actual types and functions
@bug-ops bug-ops merged commit 4d04091 into main Feb 23, 2026
20 checks passed
@bug-ops bug-ops deleted the feat/acp-integration branch February 23, 2026 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies documentation Improvements or additions to documentation enhancement New feature or request rust size/XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant