Skip to content

Feature Request: Support ACP (Agent Client Protocol) Compatible CLIs #377

Description

@yazelin

Summary

Add native support for the Agent Client Protocol (ACP) to allow Copilot SDK to connect directly to ACP-compatible agents like Gemini CLI, without requiring a protocol translation proxy.

Problem

Currently, when using cliPath to specify a custom CLI (e.g., gemini), the SDK fails because it sends Copilot-specific CLI arguments (--headless, --stdio, --log-level) that ACP-compatible CLIs don't recognize.

// This doesn't work with Gemini CLI
const client = new CopilotClient({
  cliPath: "gemini"
});

Error:

Unknown arguments: server, log-level, logLevel, stdio

Root Cause: Protocol Incompatibility

Copilot SDK and ACP use different JSON-RPC method names and initialization flows:

Feature Copilot SDK Protocol ACP Protocol
Initialize ping initialize
Create Session session.create session/new
Send Message session.send session/prompt
Cancel N/A session/cancel
CLI Arguments --headless --stdio --log-level --experimental-acp (Gemini)

Current Workaround

Users must build a protocol translation proxy that:

  1. Accepts Copilot SDK protocol over stdio
  2. Translates to ACP protocol
  3. Spawns and communicates with the ACP agent

Example implementation: claude-code-acp-py (PyPI) - A Python proxy that bridges Copilot SDK to ACP-compatible backends (Gemini CLI, Claude Code ACP, etc.)

This adds complexity and maintenance burden.

Proposed Solution

Add an option to specify the protocol type when creating a client:

// Option 1: New protocol parameter
const client = new CopilotClient({
  cliPath: "gemini",
  protocol: "acp",  // or "copilot" (default)
  cliArgs: ["--experimental-acp"]
});

// Option 2: Auto-detect based on initialization response
const client = new CopilotClient({
  cliPath: "gemini",
  cliArgs: ["--experimental-acp"],
  autoDetectProtocol: true
});

Use Cases

  1. Gemini CLI Integration: Use gemini --experimental-acp directly with Copilot SDK
  2. Claude Code ACP: Connect to claude-code-acp implementations
  3. Custom Agents: Support any ACP-compatible agent without proxy overhead
  4. Ecosystem Interoperability: ACP is becoming a standard for AI agent communication (supported by Zed, Neovim, etc.)

References

Environment

  • SDK: Node.js / Python / Go / .NET (all affected)
  • Tested with: Gemini CLI v1.x with --experimental-acp

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions