Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 65 additions & 1 deletion md/migration_v2.0.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Migrating from `agent-client-protocol` 1.x to 2.0

Version 2.0 changes the low-level in-process transport boundary so JSON-RPC frames remain intact
across components and adapters.
across components and adapters. It also gives `AcpAgent` an SDK-owned process-launch
configuration instead of reusing an MCP wire-schema type.

## Raw channels carry frames

Expand All @@ -24,3 +25,66 @@ received frame intact when relaying it so batch response grouping remains correc
The separate, hidden `FramedChannel` and `into_framed_channel_and_future` compatibility path no
longer exist. Implement only `ConnectTo::connect_to`, optionally overriding
`into_channel_and_future` for a direct channel adapter.

## `AcpAgent` has its own process configuration

`AcpAgent` now accepts `AcpAgentConfig` instead of the ACP wire-schema `McpServer`. An ACP agent
subprocess is not an MCP server, and its local launch settings should not depend on the v1
protocol schema:

```rust
use agent_client_protocol::{AcpAgent, AcpAgentConfig};

let agent = AcpAgent::new(
AcpAgentConfig::new("my-agent")
.arg("--verbose")
.env("RUST_LOG", "info"),
);
let configuration = agent.config();
# let _ = configuration;
```

`server()` and `into_server()` are now `config()` and `into_config()`. The MCP-only `name` and
`_meta` fields have no equivalents because they never affected process launching. Use `command()`,
`arguments()`, and `environment()` to inspect the configuration.

The JSON configuration shape also changes. The MCP `type`, `name`, and `_meta` fields are removed,
and environment variables change from schema objects:

```json
{
"type": "stdio",
"name": "my-agent",
"command": "python",
"args": ["agent.py"],
"env": [{ "name": "RUST_LOG", "value": "info" }]
}
```

to a string map:

```json
{
"command": "python",
"args": ["agent.py"],
"env": { "RUST_LOG": "info" }
}
```

Command-string and `from_args` construction are unchanged. HTTP and SSE `McpServer` variants were
never valid subprocess launch configurations; callers using them must select an appropriate
network transport separately.

The deprecated `AcpAgent::zed_claude_code` and `AcpAgent::zed_codex` constructors were removed;
use `claude_agent` and `codex`. The `google_gemini` convenience constructor was also removed;
replace it with the explicit command:

```rust
let agent = AcpAgent::from_args([
"npx",
"-y",
"--",
"@google/gemini-cli@latest",
"--experimental-acp",
]).unwrap();
```
5 changes: 5 additions & 0 deletions src/agent-client-protocol/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
- **Breaking:** Make `Channel` the batch-aware `TransportFrame` boundary and remove the hidden
`FramedChannel` compatibility path. See the
[2.0 migration guide](../../md/migration_v2.0.md).
- **Breaking:** Replace the MCP wire-schema configuration accepted by `AcpAgent` with the SDK-local
`AcpAgentConfig`; use `config()` and `into_config()`, and represent JSON environment variables as
an object.
- **Breaking:** Remove the deprecated `zed_claude_code` and `zed_codex` constructors and the
`google_gemini` convenience constructor from `AcpAgent`.

### Fixed

Expand Down
Loading