Skip to content

Commit 57cb4e5

Browse files
bokelleyclaude
andauthored
docs(adcp): fix a2a-sdk 1.0.x symbol guidance in v3→v4 migration guide (#524)
MIGRATION_v3_to_v4.md told adopters that `a2a.utils.errors.ServerError` migrates to `a2a.types.A2AError` and `a2a.types.DataPart` migrates to `a2a.types.MessagePart`. Neither `a2a.types.A2AError` nor `a2a.types.MessagePart` exist in a2a-sdk 1.0.1 (the version this SDK pins). The error base is at `a2a.utils.errors.A2AError`; `DataPart` and `TextPart` are replaced by `a2a.types.Part` (a protobuf message with a `content` oneof); `MessagePart` does not exist at all. Replace the one-line "verify against your usage" punt with two concrete subsections: - Hand-rolled 0.3 servers: no mechanical migration path; recommend deleting the hand-rolled server and using `adcp.server.serve(transport="a2a")`. - Direct `a2a` type imports: correct before/after for DataPart, TextPart, Part wrapper, and ServerError with proper module paths. Also corrects the version specifier from `>=1.0.0` to `>=1.0.1,<1.0.2` to match the actual pin in pyproject.toml. Closes #514 https://claude.ai/code/session_015ztuszM5hAJG7N5NcA9acB Co-authored-by: Claude <noreply@anthropic.com>
1 parent 11732c8 commit 57cb4e5

1 file changed

Lines changed: 51 additions & 9 deletions

File tree

MIGRATION_v3_to_v4.md

Lines changed: 51 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,11 @@ felt blast radius, work in this order:
8181

8282
## a2a-sdk transitive bump (only matters if you have direct `a2a` imports)
8383

84-
v4 of this SDK requires `a2a-sdk>=1.0.0`. If your codebase has any direct
85-
imports from the `a2a` package — typically `a2a.utils.errors.ServerError`,
86-
`a2a.types.DataPart`, or other surface — those are a separate migration that
87-
this SDK forces on you transitively.
84+
v4 of this SDK requires `a2a-sdk>=1.0.1,<1.0.2` (pinned tight due to a
85+
1.0.2 upstream regression; see the comment in `pyproject.toml` for context).
86+
If your codebase imports from the `a2a` package directly — typically
87+
hand-rolled a2a-sdk 0.3 server code or direct type imports — those are a
88+
separate migration this SDK forces on you transitively.
8889

8990
Symptoms during pytest collection after upgrading:
9091

@@ -95,11 +96,52 @@ If you don't import from `a2a` directly (only via `adcp.server` /
9596
`adcp.protocols.a2a`), this section doesn't apply — the SDK's wrapper layer
9697
absorbs the change.
9798

98-
If you do, see the [a2a-sdk
99-
1.0 release notes](https://github.com/a2aproject/a2a-python/releases) for the
100-
import-path moves. The most common pattern is `a2a.utils.errors.ServerError`
101-
`a2a.types.A2AError` and `a2a.types.DataPart``a2a.types.MessagePart`,
102-
but verify against your specific usage.
99+
### Hand-rolled a2a-sdk 0.3 servers — no mechanical migration path
100+
101+
If you have a hand-rolled a2a-sdk 0.3 server (a module that imports from
102+
`a2a.server.apps`, constructs `DataPart`, `TextPart`, or `Part(root=...)`
103+
directly, or references `a2a.utils.errors.ServerError`), there is no
104+
symbol-by-symbol migration path to a2a-sdk 1.0.x. The 0.3 Pydantic types
105+
(`DataPart`, `TextPart`, `Part(root=...)`) are replaced by a protobuf `Part`
106+
message with a `content` oneof; `a2a.server.apps` is replaced by
107+
`a2a.server.routes` + `a2a.server.agent_execution`; `ServerError` is replaced
108+
by `a2a.utils.errors.A2AError` and its subclasses (`InternalError`,
109+
`InvalidParamsError`).
110+
111+
**The recommended path:** delete the hand-rolled server and use
112+
`adcp.server.serve(transport="a2a")` instead:
113+
114+
```python
115+
from adcp.server import ADCPHandler, serve
116+
117+
class MyHandler(ADCPHandler):
118+
async def get_products(self, req, ctx=None):
119+
return {"products": [...]}
120+
121+
serve(MyHandler(), name="my-agent", transport="a2a")
122+
```
123+
124+
The SDK's A2A layer handles `DataPart`/`Part` construction, task lifecycle,
125+
agent card, and dual 0.3/1.0 wire compatibility internally.
126+
127+
### Direct `a2a` type imports (non-server code)
128+
129+
If your non-server code imports `a2a` types directly, the 0.3 → 1.0 changes
130+
include:
131+
132+
- `a2a.types.DataPart` and `a2a.types.TextPart``a2a.types.Part` (the
133+
standalone `DataPart`/`TextPart` classes are gone; 1.0 uses a single
134+
protobuf `Part` with a `content` oneof — see the
135+
[a2a-sdk 1.0 release notes](https://github.com/a2aproject/a2a-python/releases)
136+
for the full protobuf API)
137+
- `a2a.types.Part(root=<DataPart|TextPart>)``a2a.types.Part` directly
138+
(the 0.3 wrapper is gone; `Part` is the message itself)
139+
- `a2a.utils.errors.ServerError``a2a.utils.errors.A2AError` (base class)
140+
or `InternalError` / `InvalidParamsError` for specific cases
141+
142+
Note: `a2a.types.A2AError` and `a2a.types.MessagePart` do **not** exist in
143+
a2a-sdk 1.0.1. If a guide or resource points you at these symbols, it is out
144+
of date. The error base class lives at `a2a.utils.errors.A2AError`.
103145

104146
## Removed types
105147

0 commit comments

Comments
 (0)