Skip to content

Commit 0f2859a

Browse files
committed
docs: add 0.11 migration guide
1 parent b2db256 commit 0f2859a

4 files changed

Lines changed: 148 additions & 1 deletion

File tree

‎docs/index.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ Next steps live in the [Quickstart](quickstart.md): launch the echo agent, wire
3838
| Real-world adopters | [use-cases.md](use-cases.md) |
3939
| Contrib helpers | [contrib.md](contrib.md) |
4040
| Releasing workflow | [releasing.md](releasing.md) |
41+
| Upgrade to 0.11 | [migration-guide-0.11.md](migration-guide-0.11.md) |
4142
| Example scripts | [github.com/agentclientprotocol/python-sdk/tree/main/examples](https://github.com/agentclientprotocol/python-sdk/tree/main/examples) |
4243

4344
## Choose a path
@@ -52,6 +53,7 @@ Next steps live in the [Quickstart](quickstart.md): launch the echo agent, wire
5253
- [Use Cases](use-cases.md) — real adopters with succinct descriptions of what they build.
5354
- [Experimental Contrib](contrib.md) — deep dives on the `acp.contrib` utilities.
5455
- [Releasing](releasing.md) — schema upgrade process, versioning policy, and publishing checklist.
56+
- [0.11 Migration Guide](migration-guide-0.11.md) — interface signature updates, elicitation, and schema notes for 0.10 users.
5557

5658
Need API-level details? Browse the source in `src/acp/` or generate docs with `mkdocstrings`.
5759

‎docs/migration-guide-0.11.md‎

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
# Migrating to ACP Python SDK 0.11
2+
3+
ACP Python SDK 0.11 updates the generated bindings to `schema-v1.16.0` and aligns the high-level interfaces with the new schema. Most applications only need to update method signatures and review the new unstable capabilities. Agents and clients that already pass keyword arguments are the easiest to migrate.
4+
5+
## 1. Regenerate schema-derived code
6+
7+
If your project vendors ACP schema files, generated models, or protocol metadata, regenerate them against the same upstream schema tag:
8+
9+
```bash
10+
ACP_SCHEMA_VERSION=schema-v1.16.0 make gen-all
11+
```
12+
13+
The SDK package version is `0.11.0`, while the protocol schema tag is `schema-v1.16.0`.
14+
15+
## 2. Update interface method signatures
16+
17+
Several generated request models changed field order or fields. The SDK now exposes those shapes through `Agent` and `Client` protocol methods. Prefer keyword calls when invoking connection helpers; keyword calls are stable across field-order changes.
18+
19+
### Client methods
20+
21+
Update client implementations from the 0.10 positional order:
22+
23+
```python
24+
async def request_permission(self, options, session_id, tool_call, **kwargs): ...
25+
async def write_text_file(self, content, path, session_id, **kwargs): ...
26+
async def read_text_file(self, path, session_id, limit=None, line=None, **kwargs): ...
27+
async def create_terminal(self, command, session_id, args=None, cwd=None, env=None, **kwargs): ...
28+
```
29+
30+
to the 0.11 order:
31+
32+
```python
33+
async def request_permission(self, session_id, tool_call, options, **kwargs): ...
34+
async def write_text_file(self, session_id, path, content, **kwargs): ...
35+
async def read_text_file(self, session_id, path, line=None, limit=None, **kwargs): ...
36+
async def create_terminal(self, session_id, command, args=None, env=None, cwd=None, **kwargs): ...
37+
```
38+
39+
### Agent methods
40+
41+
Update agent implementations from the 0.10 prompt and mode signatures:
42+
43+
```python
44+
async def set_session_mode(self, mode_id, session_id, **kwargs): ...
45+
async def prompt(self, prompt, session_id, message_id=None, **kwargs): ...
46+
```
47+
48+
to the 0.11 signatures:
49+
50+
```python
51+
async def set_session_mode(self, session_id, mode_id, **kwargs): ...
52+
async def prompt(self, session_id, prompt, **kwargs): ...
53+
```
54+
55+
The `message_id` field was removed from `PromptRequest`. If your client generated a user message ID before calling `conn.prompt(...)`, stop passing it there. Message IDs now belong to streamed content chunks such as `UserMessageChunk` and `AgentMessageChunk`.
56+
57+
## 3. Remove `session/model` handling
58+
59+
The generated `SetSessionModelRequest` and `SetSessionModelResponse` types are no longer exported, and the `Agent.set_session_model(...)` protocol method is gone. If your agent used this endpoint to switch models, move that behavior into session modes or configuration options exposed through `set_session_mode(...)` and `set_config_option(...)`.
60+
61+
## 4. Handle elicitation if your agent or client advertises it
62+
63+
0.11 adds schema and connection support for the unstable `elicitation/create` request and `elicitation/complete` notification.
64+
65+
Clients that advertise elicitation support should implement:
66+
67+
```python
68+
from typing import Any
69+
70+
from acp import AcceptElicitationResponse, Client, CreateElicitationResponse, ElicitationMode
71+
72+
73+
class MyClient(Client):
74+
async def create_elicitation(
75+
self,
76+
message: str,
77+
mode: ElicitationMode,
78+
**kwargs: Any,
79+
) -> CreateElicitationResponse:
80+
return AcceptElicitationResponse(action="accept", content={})
81+
82+
async def complete_elicitation(self, elicitation_id: str, **kwargs: Any) -> None:
83+
...
84+
```
85+
86+
Agents can request structured input through the connected client:
87+
88+
```python
89+
from acp import (
90+
ElicitationFormSessionMode,
91+
ElicitationSchema,
92+
ElicitationStringPropertySchema,
93+
)
94+
95+
response = await client_conn.create_elicitation(
96+
message="Choose a deployment target",
97+
mode=ElicitationFormSessionMode(
98+
session_id=session_id,
99+
requested_schema=ElicitationSchema(
100+
properties={"target": ElicitationStringPropertySchema(type="string")},
101+
required=["target"],
102+
),
103+
),
104+
)
105+
```
106+
107+
For URL-based flows, use `ElicitationUrlSessionMode` or `ElicitationUrlRequestMode` and call `complete_elicitation(...)` once the external flow finishes.
108+
109+
## 5. Review new session update variants
110+
111+
Clients that exhaustively match `session_update` variants should add the new plan update variants:
112+
113+
```python
114+
from acp.schema import AgentPlanContentUpdate, AgentPlanRemovedUpdate
115+
116+
async def session_update(self, session_id, update, **kwargs):
117+
if isinstance(update, AgentPlanContentUpdate):
118+
...
119+
elif isinstance(update, AgentPlanRemovedUpdate):
120+
...
121+
```
122+
123+
The existing full-plan `AgentPlanUpdate` variant remains available.
124+
125+
## 6. Review MCP server configuration types
126+
127+
Session creation, loading, forking, and resuming now accept `AcpMcpServer` in addition to HTTP, SSE, and stdio MCP server definitions:
128+
129+
```python
130+
from acp.schema import AcpMcpServer, HttpMcpServer, McpServerStdio, SseMcpServer
131+
```
132+
133+
If you validate `mcp_servers` with your own union, add `AcpMcpServer` to keep accepting all SDK-supported server types.
134+
135+
## 7. Re-run examples and checks
136+
137+
After changing signatures, run the standard gates:
138+
139+
```bash
140+
make check
141+
make test
142+
```
143+
144+
Also run any example or integration that subclasses `Agent` or `Client`. Positional argument bugs usually surface there first; using keyword arguments for connection calls avoids most of them.

‎docs/quickstart.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ from acp.interfaces import Client
9999

100100
class SimpleClient(Client):
101101
async def request_permission(
102-
self, options, session_id, tool_call, **kwargs: Any
102+
self, session_id, tool_call, options, **kwargs: Any
103103
):
104104
return {"outcome": {"outcome": "cancelled"}}
105105

‎mkdocs.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ nav:
1313
- Use Cases: use-cases.md
1414
- Experimental Contrib: contrib.md
1515
- Releasing: releasing.md
16+
- 0.11 Migration Guide: migration-guide-0.11.md
1617
- 0.7 Migration Guide: migration-guide-0.7.md
1718
- 0.8 Migration Guide: migration-guide-0.8.md
1819
plugins:

0 commit comments

Comments
 (0)