Skip to content

Commit 1cc993c

Browse files
muscarielloTehsmashlkawkaa2a-botdidier-durand
authored
refactor!: upgrade SDK to A2A 1.0 specs (#572)
## Summary This PR migrates the a2a-python SDK from Pydantic-based types to protobuf-generated types, completing the upgrade to A2A v1.0. Fixes #559 ## Breaking Changes - Replace Pydantic-based type system with protobuf types from `a2a_pb2` - Update `Part` usage from `Part(root=TextPart(text=...))` to `Part(text=...)` - Update `Role` enum from `Role.user`/`Role.agent` to `Role.ROLE_USER`/`Role.ROLE_AGENT` - Update `TaskState` enum to use `TASK_STATE_*` prefix ## Changes - Update all source files to use proto types directly from `a2a_pb2` - Replace `model_dump()` with `MessageToDict()` for JSON serialization - Replace `model_copy(deep=True)` with `CopyFrom()` for proto cloning - Add new types module with proto imports and SDK-specific extras - Add `proto_utils` module with identity conversion utilities - Fix REST handler resource name formats for push notification configs - Fix gRPC handler to use `SubscribeToTask` instead of `TaskSubscription` - Fix database task store to handle proto objects from ORM - Update all test files for proto patterns and assertions - Fix spelling check failures by updating allow list - Fix inclusive language check failures: - Replace `master` with `main` in documentation - Rename `Dummy` classes to `Mock` in tests ## Testing - **601 tests passing** - 23 tests skipped (expected - require DB connections or cryptography deps) ## Related Builds on top of PR #556 Release-As: 1.0.0 --------- Signed-off-by: Luca Muscariello <muscariello@ieee.org> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Sam Betts <1769706+Tehsmash@users.noreply.github.com> Co-authored-by: Lukasz Kawka <luk.kawka@gmail.com> Co-authored-by: Agent2Agent (A2A) Bot <a2a-bot@google.com> Co-authored-by: Didier Durand <2927957+didier-durand@users.noreply.github.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Iva Sokolaj <102302011+sokoliva@users.noreply.github.com> Co-authored-by: Will Chen <36873565+chenweiyang0204@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent 3bfbea9 commit 1cc993c

137 files changed

Lines changed: 7216 additions & 10837 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.git-blame-ignore-revs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Template taken from https://github.com/v8/v8/blob/master/.git-blame-ignore-revs.
1+
# Template taken from https://github.com/v8/v8/blob/main/.git-blame-ignore-revs.
22
#
33
# This file contains a list of git hashes of revisions to be ignored by git blame. These
44
# revisions are considered "unimportant" in that they are unlikely to be what you are

.github/actions/spelling/allow.txt

Lines changed: 56 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,57 @@
1+
A2A
2+
A2AFastAPI
13
AAgent
4+
ACMRTUXB
25
ACard
36
AClient
4-
ACMRTUXB
5-
aconnect
6-
adk
77
AError
8+
AException
89
AFast
9-
agentic
1010
AGrpc
11-
aio
12-
aiomysql
13-
amannn
14-
aproject
1511
ARequest
1612
ARun
1713
AServer
1814
AServers
1915
AService
2016
AStarlette
2117
AUser
18+
DSNs
19+
ES256
20+
EUR
21+
FastAPI
22+
GBP
23+
GVsb
24+
HS256
25+
HS384
26+
INR
27+
JOSE
28+
JPY
29+
JSONRPC
30+
JSONRPCt
31+
JWS
32+
Llm
33+
OpenAPI
34+
POSTGRES
35+
Protobuf
36+
RS256
37+
RUF
38+
SECP256R1
39+
SLF
40+
Starlette
41+
Tful
42+
a2a
43+
aconnect
44+
adk
45+
agentic
46+
aio
47+
aiomysql
48+
alg
49+
amannn
50+
aproject
2251
autouse
2352
backticks
53+
base64url
54+
buf
2455
cla
2556
cls
2657
coc
@@ -29,59 +60,63 @@ coro
2960
datamodel
3061
deepwiki
3162
drivername
32-
DSNs
3363
dunders
3464
euo
35-
EUR
3665
excinfo
3766
fernet
3867
fetchrow
3968
fetchval
40-
GBP
4169
genai
4270
getkwargs
4371
gle
44-
GVsb
72+
hazmat
4573
ietf
74+
importlib
4675
initdb
4776
inmemory
48-
INR
4977
isready
50-
JPY
51-
JSONRPCt
52-
JWS
78+
jku
79+
jwk
80+
jwks
81+
jws
82+
kid
5383
kwarg
5484
langgraph
5585
lifecycles
5686
linting
57-
Llm
5887
lstrips
88+
middleware
5989
mikeas
6090
mockurl
6191
notif
6292
oauthoidc
6393
oidc
94+
openapiv
95+
openapiv2
6496
opensource
6597
otherurl
98+
pb2
6699
postgres
67-
POSTGRES
68100
postgresql
101+
proto
102+
protobuf
69103
protoc
104+
pydantic
70105
pyi
71106
pypistats
72107
pyupgrade
73108
pyversions
74109
redef
75110
respx
76111
resub
77-
RUF
78-
SLF
79112
socio
80113
sse
114+
starlette
115+
swagger
81116
tagwords
82117
taskupdate
83118
testuuid
84-
Tful
85119
tiangolo
120+
typ
86121
typeerror
87122
vulnz

.github/actions/spelling/excludes.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,5 +87,7 @@
8787
^\.github/workflows/
8888
CHANGELOG.md
8989
^src/a2a/grpc/
90+
^src/a2a/types/
9091
^tests/
9192
.pre-commit-config.yaml
93+
(?:^|/)a2a\.json$

.github/workflows/linter.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
if: github.repository == 'a2aproject/a2a-python'
1313
steps:
1414
- name: Checkout Code
15-
uses: actions/checkout@v5
15+
uses: actions/checkout@v6
1616
- name: Set up Python
1717
uses: actions/setup-python@v6
1818
with:

.github/workflows/python-publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313

1414
steps:
15-
- uses: actions/checkout@v5
15+
- uses: actions/checkout@v6
1616

1717
- name: Install uv
1818
uses: astral-sh/setup-uv@v7
@@ -26,7 +26,7 @@ jobs:
2626
run: uv build
2727

2828
- name: Upload distributions
29-
uses: actions/upload-artifact@v5
29+
uses: actions/upload-artifact@v6
3030
with:
3131
name: release-dists
3232
path: dist/
@@ -40,7 +40,7 @@ jobs:
4040

4141
steps:
4242
- name: Retrieve release distributions
43-
uses: actions/download-artifact@v6
43+
uses: actions/download-artifact@v7
4444
with:
4545
name: release-dists
4646
path: dist/

.github/workflows/stale.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name: Mark stale issues and pull requests
77

88
on:
99
schedule:
10-
# Scheduled to run at 10.30PM UTC everyday (1530PDT/1430PST)
10+
# Scheduled to run at 10.30PM UTC every day (1530PDT/1430PST)
1111
- cron: "30 22 * * *"
1212
workflow_dispatch:
1313

.github/workflows/unit-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
python-version: ['3.10', '3.13']
4040
steps:
4141
- name: Checkout code
42-
uses: actions/checkout@v5
42+
uses: actions/checkout@v6
4343
- name: Set up test environment variables
4444
run: |
4545
echo "POSTGRES_TEST_DSN=postgresql+asyncpg://a2a:a2a_password@localhost:5432/a2a_test" >> $GITHUB_ENV

.github/workflows/update-a2a-types.yml

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,43 +12,36 @@ jobs:
1212
pull-requests: write
1313
steps:
1414
- name: Checkout code
15-
uses: actions/checkout@v5
15+
uses: actions/checkout@v6
1616
- name: Set up Python
1717
uses: actions/setup-python@v6
1818
with:
19-
python-version: '3.10'
19+
python-version: "3.10"
2020
- name: Install uv
2121
uses: astral-sh/setup-uv@v7
2222
- name: Configure uv shell
2323
run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
24-
- name: Install dependencies (datamodel-code-generator)
25-
run: uv sync
2624
- name: Define output file variable
2725
id: vars
2826
run: |
29-
GENERATED_FILE="./src/a2a/types.py"
27+
GENERATED_FILE="./src/a2a/types"
3028
echo "GENERATED_FILE=$GENERATED_FILE" >> "$GITHUB_OUTPUT"
31-
- name: Generate types from schema
32-
run: |
33-
chmod +x scripts/generate_types.sh
34-
./scripts/generate_types.sh "${{ steps.vars.outputs.GENERATED_FILE }}"
3529
- name: Install Buf
3630
uses: bufbuild/buf-setup-action@v1
3731
- name: Run buf generate
3832
run: |
3933
set -euo pipefail # Exit immediately if a command exits with a non-zero status
4034
echo "Running buf generate..."
4135
buf generate
42-
uv run scripts/grpc_gen_post_processor.py
4336
echo "Buf generate finished."
4437
- name: Create Pull Request with Updates
45-
uses: peter-evans/create-pull-request@v7
38+
uses: peter-evans/create-pull-request@v8
4639
with:
4740
token: ${{ secrets.A2A_BOT_PAT }}
4841
committer: a2a-bot <a2a-bot@google.com>
4942
author: a2a-bot <a2a-bot@google.com>
50-
commit-message: '${{ github.event.client_payload.message }}'
51-
title: '${{ github.event.client_payload.message }}'
43+
commit-message: "${{ github.event.client_payload.message }}"
44+
title: "${{ github.event.client_payload.message }}"
5245
body: |
5346
Commit: https://github.com/a2aproject/A2A/commit/${{ github.event.client_payload.sha }}
5447
branch: auto-update-a2a-types-${{ github.event.client_payload.sha }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ test_venv/
1010
coverage.xml
1111
.nox
1212
spec.json
13+
src/a2a/types/a2a.json

CHANGELOG.md

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,31 @@
11
# Changelog
22

3+
## [0.3.22](https://github.com/a2aproject/a2a-python/compare/v0.3.21...v0.3.22) (2025-12-16)
4+
5+
6+
### Features
7+
8+
* Add custom ID generators to SimpleRequestContextBuilder ([#594](https://github.com/a2aproject/a2a-python/issues/594)) ([04bcafc](https://github.com/a2aproject/a2a-python/commit/04bcafc737cf426d9975c76e346335ff992363e2))
9+
10+
11+
### Code Refactoring
12+
13+
* Move agent card signature verification into `A2ACardResolver` ([6fa6a6c](https://github.com/a2aproject/a2a-python/commit/6fa6a6cf3875bdf7bfc51fb1a541a3f3e8381dc0))
14+
15+
## [0.3.21](https://github.com/a2aproject/a2a-python/compare/v0.3.20...v0.3.21) (2025-12-12)
16+
17+
18+
### Documentation
19+
20+
* Fixing typos ([#586](https://github.com/a2aproject/a2a-python/issues/586)) ([5fea21f](https://github.com/a2aproject/a2a-python/commit/5fea21fb34ecea55e588eb10139b5d47020a76cb))
21+
22+
## [0.3.20](https://github.com/a2aproject/a2a-python/compare/v0.3.19...v0.3.20) (2025-12-03)
23+
24+
25+
### Bug Fixes
26+
27+
* Improve streaming errors handling ([#576](https://github.com/a2aproject/a2a-python/issues/576)) ([7ea7475](https://github.com/a2aproject/a2a-python/commit/7ea7475091df2ee40d3035ef1bc34ee2f86524ee))
28+
329
## [0.3.19](https://github.com/a2aproject/a2a-python/compare/v0.3.18...v0.3.19) (2025-11-25)
430

531

@@ -94,7 +120,7 @@
94120
### Bug Fixes
95121

96122
* apply `history_length` for `message/send` requests ([#498](https://github.com/a2aproject/a2a-python/issues/498)) ([a49f94e](https://github.com/a2aproject/a2a-python/commit/a49f94ef23d81b8375e409b1c1e51afaf1da1956))
97-
* **client:** `A2ACardResolver.get_agent_card` will auto-populate with `agent_card_path` when `relative_card_path` is empty ([#508](https://github.com/a2aproject/a2a-python/issues/508)) ([ba24ead](https://github.com/a2aproject/a2a-python/commit/ba24eadb5b6fcd056a008e4cbcef03b3f72a37c3))
123+
* **client:** `A2ACardResolver.get_agent_card` will autopopulate with `agent_card_path` when `relative_card_path` is empty ([#508](https://github.com/a2aproject/a2a-python/issues/508)) ([ba24ead](https://github.com/a2aproject/a2a-python/commit/ba24eadb5b6fcd056a008e4cbcef03b3f72a37c3))
98124

99125

100126
### Documentation
@@ -431,8 +457,8 @@
431457
* Event consumer should stop on input_required ([#167](https://github.com/a2aproject/a2a-python/issues/167)) ([51c2d8a](https://github.com/a2aproject/a2a-python/commit/51c2d8addf9e89a86a6834e16deb9f4ac0e05cc3))
432458
* Fix Release Version ([#161](https://github.com/a2aproject/a2a-python/issues/161)) ([011d632](https://github.com/a2aproject/a2a-python/commit/011d632b27b201193813ce24cf25e28d1335d18e))
433459
* generate StrEnum types for enums ([#134](https://github.com/a2aproject/a2a-python/issues/134)) ([0c49dab](https://github.com/a2aproject/a2a-python/commit/0c49dabcdb9d62de49fda53d7ce5c691b8c1591c))
434-
* library should released as 0.2.6 ([d8187e8](https://github.com/a2aproject/a2a-python/commit/d8187e812d6ac01caedf61d4edaca522e583d7da))
435-
* remove error types from enqueable events ([#138](https://github.com/a2aproject/a2a-python/issues/138)) ([511992f](https://github.com/a2aproject/a2a-python/commit/511992fe585bd15e956921daeab4046dc4a50a0a))
460+
* library should be released as 0.2.6 ([d8187e8](https://github.com/a2aproject/a2a-python/commit/d8187e812d6ac01caedf61d4edaca522e583d7da))
461+
* remove error types from enqueueable events ([#138](https://github.com/a2aproject/a2a-python/issues/138)) ([511992f](https://github.com/a2aproject/a2a-python/commit/511992fe585bd15e956921daeab4046dc4a50a0a))
436462
* **stream:** don't block event loop in EventQueue ([#151](https://github.com/a2aproject/a2a-python/issues/151)) ([efd9080](https://github.com/a2aproject/a2a-python/commit/efd9080b917c51d6e945572fd123b07f20974a64))
437463
* **task_updater:** fix potential duplicate artifact_id from default v… ([#156](https://github.com/a2aproject/a2a-python/issues/156)) ([1f0a769](https://github.com/a2aproject/a2a-python/commit/1f0a769c1027797b2f252e4c894352f9f78257ca))
438464

0 commit comments

Comments
 (0)