feat(a2a): upgrade a2a-sdk from >=0.3.4,<0.4 to >=1.0,<2 (A2A 1.0 spec)#5917
Open
waadarsh wants to merge 2 commits into
Open
feat(a2a): upgrade a2a-sdk from >=0.3.4,<0.4 to >=1.0,<2 (A2A 1.0 spec)#5917waadarsh wants to merge 2 commits into
waadarsh wants to merge 2 commits into
Conversation
Migrates all A2A integration code and tests from the Pydantic-based
a2a-sdk 0.3.x API to the Protocol Buffer (proto) based a2a-sdk 1.x
API, implementing the A2A 1.0 specification.
Breaking changes addressed:
- Part types: TextPart/DataPart/FilePart replaced by flat proto Part
with WhichOneof("content") oneof pattern (text, url, raw, data)
- Enum prefixes: TaskState.working -> TASK_STATE_WORKING,
Role.agent -> ROLE_AGENT (all enums now SCREAMING_SNAKE_CASE)
- Timestamps: TaskStatus.timestamp is now proto Timestamp
(use .FromDatetime() instead of .isoformat() string)
- TaskStatusUpdateEvent.final field removed; finality via task state
- AgentCard.url moved to supported_interfaces list (AgentInterface)
with protocolBinding + protocolVersion fields (A2A 1.0 schema)
- A2AStarletteApplication removed; replaced by create_agent_card_routes(),
create_jsonrpc_routes(), create_rest_routes() builders
- DefaultRequestHandler now requires agent_card= constructor argument
- ClientCallContext moved: a2a.client.middleware -> a2a.client.client
- ClientConfig.supported_transports -> supported_protocol_bindings
- TransportProtocol enum values now uppercase (JSONRPC, HTTP_JSON)
- Client send_message() takes SendMessageRequest proto and yields
StreamResponse (use .WhichOneof("payload") to dispatch)
- proto Struct metadata: use "in" + subscript instead of .get()
- AgentCard construction: use json_format.ParseDict() not **dict
- v1 SDK requires Task enqueued before TaskStatusUpdateEvent
Files changed: pyproject.toml, 16 source files, 15 test files
All 299 a2a unit + integration tests pass (2 skipped for removed
A2AFastAPIApplication which has no 1.x equivalent).
Fixes google#5056
Replace A2AFastAPIApplication (removed in a2a-sdk v1) with FastAPI + add_a2a_routes_to_fastapi in the two input_required follow-up tests. Also fix proto Task construction (remove 'kind' field, use Role.ROLE_USER enum). All 301 a2a tests now pass with 0 skipped.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #5056
Key changes
Test plan
```
uv run pytest tests/unittests/a2a/ -q
```
```
301 passed, 0 skipped, 0 failed
```