Skip to content

Commit 210e93b

Browse files
authored
Merge branch 'main' into feat/gh-604
2 parents 0264375 + 12fd75c commit 210e93b

14 files changed

Lines changed: 1094 additions & 484 deletions

File tree

.github/actions/spelling/allow.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ JPY
5252
JSONRPCt
5353
jwk
5454
jwks
55-
JWS
5655
jws
56+
JWS
5757
kid
5858
kwarg
5959
langgraph
@@ -83,6 +83,8 @@ RUF
8383
SLF
8484
socio
8585
sse
86+
sut
87+
SUT
8688
tagwords
8789
taskupdate
8890
testuuid

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ updates:
55
schedule:
66
interval: 'monthly'
77
groups:
8-
uv-dependencies:
8+
all:
99
patterns:
1010
- '*'
1111
- package-ecosystem: 'github-actions'

.github/workflows/linter.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
run: |
2424
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
2525
- name: Install dependencies
26-
run: uv sync --dev
26+
run: uv sync --locked --dev
2727

2828
- name: Run Ruff Linter
2929
id: ruff-lint

.github/workflows/run-tck.yaml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: Run TCK
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
paths-ignore:
9+
- '**.md'
10+
- 'LICENSE'
11+
- '.github/CODEOWNERS'
12+
13+
permissions:
14+
contents: read
15+
16+
env:
17+
TCK_VERSION: 0.3.0.beta3
18+
SUT_BASE_URL: http://localhost:41241
19+
SUT_JSONRPC_URL: http://localhost:41241/a2a/jsonrpc
20+
UV_SYSTEM_PYTHON: 1
21+
TCK_STREAMING_TIMEOUT: 5.0
22+
23+
concurrency:
24+
group: '${{ github.workflow }} @ ${{ github.head_ref || github.ref }}'
25+
cancel-in-progress: true
26+
27+
jobs:
28+
tck-test:
29+
name: Run TCK with Python ${{ matrix.python-version }}
30+
runs-on: ubuntu-latest
31+
strategy:
32+
matrix:
33+
python-version: ['3.10', '3.13']
34+
steps:
35+
- name: Checkout a2a-python
36+
uses: actions/checkout@v6
37+
38+
- name: Install uv
39+
uses: astral-sh/setup-uv@v7
40+
with:
41+
enable-cache: true
42+
cache-dependency-glob: "uv.lock"
43+
44+
- name: Set up Python ${{ matrix.python-version }}
45+
run: uv python install ${{ matrix.python-version }}
46+
47+
- name: Install Dependencies
48+
run: uv sync --locked --all-extras
49+
50+
- name: Checkout a2a-tck
51+
uses: actions/checkout@v6
52+
with:
53+
repository: a2aproject/a2a-tck
54+
path: tck/a2a-tck
55+
ref: ${{ env.TCK_VERSION }}
56+
57+
- name: Start SUT
58+
run: |
59+
uv run tck/sut_agent.py &
60+
61+
- name: Wait for SUT to start
62+
run: |
63+
URL="${{ env.SUT_BASE_URL }}/.well-known/agent-card.json"
64+
EXPECTED_STATUS=200
65+
TIMEOUT=120
66+
RETRY_INTERVAL=2
67+
START_TIME=$(date +%s)
68+
69+
while true; do
70+
CURRENT_TIME=$(date +%s)
71+
ELAPSED_TIME=$((CURRENT_TIME - START_TIME))
72+
73+
if [ "$ELAPSED_TIME" -ge "$TIMEOUT" ]; then
74+
echo "❌ Timeout: Server did not respond with status $EXPECTED_STATUS within $TIMEOUT seconds."
75+
exit 1
76+
fi
77+
78+
HTTP_STATUS=$(curl --output /dev/null --silent --write-out "%{http_code}" "$URL") || true
79+
echo "STATUS: ${HTTP_STATUS}"
80+
81+
if [ "$HTTP_STATUS" -eq "$EXPECTED_STATUS" ]; then
82+
echo "✅ Server is up! Received status $HTTP_STATUS after $ELAPSED_TIME seconds."
83+
break;
84+
fi
85+
86+
echo "⏳ Server not ready (status: $HTTP_STATUS). Retrying in $RETRY_INTERVAL seconds..."
87+
sleep "$RETRY_INTERVAL"
88+
done
89+
90+
- name: Run TCK (mandatory)
91+
id: run-tck-mandatory
92+
run: |
93+
uv run run_tck.py --sut-url ${{ env.SUT_JSONRPC_URL }} --category mandatory --transports jsonrpc
94+
working-directory: tck/a2a-tck
95+
96+
- name: Run TCK (capabilities)
97+
id: run-tck-capabilities
98+
run: |
99+
uv run run_tck.py --sut-url ${{ env.SUT_JSONRPC_URL }} --category capabilities --transports jsonrpc
100+
working-directory: tck/a2a-tck
101+
102+
- name: Stop SUT
103+
if: always()
104+
run: |
105+
pkill -f sut_agent.py || true
106+
sleep 2

.github/workflows/unit-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
run: |
5454
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
5555
- name: Install dependencies
56-
run: uv sync --dev --extra all
56+
run: uv sync --locked --dev --extra all
5757
- name: Run tests and check coverage
5858
run: uv run pytest --cov=a2a --cov-report term --cov-fail-under=88
5959
- name: Show coverage summary in log

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
---
22
name: Update A2A Schema from Specification
33
on:
4-
repository_dispatch:
5-
types: [a2a_json_update]
4+
# TODO (https://github.com/a2aproject/a2a-python/issues/559): bring back once types are migrated, currently it generates many broken PRs
5+
# repository_dispatch:
6+
# types: [a2a_json_update]
67
workflow_dispatch:
78
jobs:
89
generate_and_pr:
@@ -22,7 +23,7 @@ jobs:
2223
- name: Configure uv shell
2324
run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
2425
- name: Install dependencies (datamodel-code-generator)
25-
run: uv sync
26+
run: uv sync --locked
2627
- name: Define output file variable
2728
id: vars
2829
run: |

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/a2a-sdk)
66
[![PyPI - Downloads](https://img.shields.io/pypi/dw/a2a-sdk)](https://pypistats.org/packages/a2a-sdk)
77
[![Python Unit Tests](https://github.com/a2aproject/a2a-python/actions/workflows/unit-tests.yml/badge.svg)](https://github.com/a2aproject/a2a-python/actions/workflows/unit-tests.yml)
8-
[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/a2aproject/a2a-python)
9-
108
<!-- markdownlint-disable no-inline-html -->
9+
<a href="https://codewiki.google/github.com/a2aproject/a2a-python">
10+
<img src="https://www.gstatic.com/_/boq-sdlc-agents-ui/_/r/Mvosg4klCA4.svg" alt="Ask Code Wiki" height="20">
11+
</a>
1112

1213
<div align="center">
1314
<img src="https://raw.githubusercontent.com/a2aproject/A2A/refs/heads/main/docs/assets/a2a-logo-black.svg" width="256" alt="A2A Logo"/>

src/a2a/client/transports/jsonrpc.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,8 @@ async def send_message_streaming(
176176
try:
177177
event_source.response.raise_for_status()
178178
async for sse in event_source.aiter_sse():
179+
if not sse.data:
180+
continue
179181
response = SendStreamingMessageResponse.model_validate(
180182
json.loads(sse.data)
181183
)

src/a2a/client/transports/rest.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ async def send_message_streaming(
154154
try:
155155
event_source.response.raise_for_status()
156156
async for sse in event_source.aiter_sse():
157+
if not sse.data:
158+
continue
157159
event = a2a_pb2.StreamResponse()
158160
Parse(sse.data, event)
159161
yield proto_utils.FromProto.stream_response(event)

tck/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)