Skip to content

Bidirectional ACP (Agent Client Protocol) Support #535

@phodal

Description

@phodal

Bidirectional ACP (Agent Client Protocol) Support

Overview

Implement full bidirectional support for the Agent Client Protocol (ACP) to enable seamless interoperability between AutoDev and other coding agents/editors.

ACP standardizes communication between code editors and AI coding agents via JSON-RPC over STDIO, similar to how LSP standardizes language features.

Goals

1. ACP Client (connect TO external agents)

AutoDev acts as an ACP client to connect to external ACP-compliant agents:

  • Claude CLI (claude --acp)
  • Gemini CLI (gemini --acp)
  • Any ACP agent via configurable command/args

This allows users to leverage their preferred AI agent backend while using the AutoDev UI.

2. ACP Agent Server (expose OUR agent to external editors)

AutoDev acts as an ACP agent that other editors can connect to:

  • JetBrains IDEs via the IDEA plugin
  • VS Code / Cursor via the CLI (xiuper acp-agent)
  • Zed, Neovim, or any editor with ACP client support

This allows our coding agent to be used from any ACP-compatible editor.

Implementation

Kotlin Multiplatform Core (mpp-core)

  • AcpClient - Cross-platform ACP client that connects to external agents
    • Manages protocol lifecycle (transport -> initialize -> session -> prompt)
    • Bridges ACP session updates to CodingAgentRenderer
    • Shared utility: renderSessionUpdate() for all platforms
  • AcpAgentServer - ACP agent server exposing our CodingAgent
    • AcpPromptHandler interface for handling incoming prompts
    • AcpUpdateEmitter for streaming responses back
    • AcpRenderer bridges CodingAgentRenderer -> ACP protocol events
  • SDK: com.agentclientprotocol:acp:0.15.3 (Kotlin Multiplatform: JVM, JS, WASM)

TypeScript CLI (mpp-ui)

  • AcpAgentServer.ts - Node.js ACP agent (xiuper acp-agent command)
    • Exposes JsCodingAgent via ACP protocol on stdio
    • Other editors spawn this process and communicate via JSON-RPC
  • AcpClientConnection.ts - Connect to external ACP agents from CLI
    • Spawn agent process and communicate via ACP
  • SDK: @agentclientprotocol/sdk (TypeScript)

IDEA Plugin (mpp-idea)

  • Updated to ACP SDK v0.15.3 (from v0.10.5)
  • Existing IdeaAcpAgentViewModel works with the new SDK

Architecture

                    ACP Protocol (JSON-RPC over STDIO)
                    
┌─────────────────────┐           ┌─────────────────────┐
│  AutoDev as CLIENT  │           │  AutoDev as AGENT   │
│                     │           │                     │
│  Connects to:       │           │  Serves to:         │
│  - Claude CLI       │ <──ACP──> │  - VS Code          │
│  - Gemini CLI       │           │  - Zed              │
│  - Any ACP agent    │           │  - JetBrains IDEs   │
│                     │           │  - Any ACP client   │
└─────────────────────┘           └─────────────────────┘
       AcpClient                      AcpAgentServer

Usage

As ACP Agent (for other editors to connect)

# Start as ACP agent on stdio
xiuper acp-agent

As ACP Client (connecting to external agents)

Configure in IDEA plugin settings:

  • Command: claude / gemini / custom
  • Args: --acp / custom args
  • Env: environment variables

References

Sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions