a2aproject / a2aproject/a2a-tck

[Bug]: Generated Python SUT fails to import — codegen template mixes pre-1.0 and 1.0 a2a-python APIs

Offen Anfängerfreundlich
#209 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Python
Sterne
50
Forks
40
Ø Merge
7 T. 1 Std.
Gemergte PRs (30 T.)
1

Beschreibung

### What happened?

codegen/a2a-python/sut_agent.py.j2 mixes two incompatible generations of the a2a-python SDK API, so the SUT generated by make codegen-a2a-python-sut fails to import against any currently installable SDK version.

Primarily :

https://github.com/a2aproject/a2a-tck/blob/5996b79f9cefa6fc390980e383e358a66fb9e49e/codegen/a2a-python/sut_agent.py.j2#L24

and

https://github.com/a2aproject/a2a-tck/blob/5996b79f9cefa6fc390980e383e358a66fb9e49e/codegen/a2a-python/sut_agent.py.j2#L18

**Suggested fix**

Migrate sut_agent.py.j2 to the 1.x route-factory API, dropping the removed A2AStarletteApplication / A2ARESTFastAPIApplication imports.
Bump _DEFAULT_A2A_PYTHON_SDK_VERSION to a current 1.x release.
Verify by regenerating the SUT, booting it, and confirming ./run_tck.py runs successfully against it.

Happy to work on a fix for this if useful — flagging first since I know the SDK is mid-migration and this may already be tracked elsewhere.

### Relevant log output

```shell
Traceback (most recent call last):
File "/Users//a2a-tck/sut/a2a-python/sut_agent.py", line 22, in
from a2a.server.apps import (
...<2 lines>...
)
ModuleNotFoundError: No module named 'a2a.server.apps'
```

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

The issue is in the Jinja2 template at codegen/a2a-python/sut_agent.py.j2. First, examine the template to understand the current imports and the A2AStarletteApplication/A2ARESTFastAPIApplication usage. Then, check the a2a-python SDK's 1.x documentation or source for the new route-factory API. Update the template imports and bump _DEFAULT_A2A_PYTHON_SDK_VERSION in the relevant configuration file. Finally, run `make codegen-a2a-python-sut` to regenerate the SUT and `./run_tck.py` to verify the fix works.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
tooling
Issue-Typ
Bug
Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Aktivitätsstatus
Ruhig
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
65/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.