Commit 5c88793
## Summary
Fixes #1043.
The A2A v0.3 spec does not define a `ListTasks` method, but
`REST03Adapter` advertised `GET /v1/tasks` while
`REST03Handler.list_tasks` raised `NotImplementedError` — exposing a
route guaranteed to fail at runtime.
This PR aligns the v0.3 REST adapter with the rest of the v0.3 compat
surface:
- **Removes** `('/v1/tasks', 'GET')` from `REST03Adapter.routes()`.
- **Removes** the dead `REST03Handler.list_tasks` stub.
- **Replaces** the stale `pytest.raises(NotImplementedError)` test with
a regression test asserting the route is no longer registered in
`REST03Adapter.routes()`.
This matches the design already present in the three sibling v0.3
transports — `jsonrpc_transport.py`, `grpc_transport.py`, and
`rest_transport.py` — all of which explicitly raise
`NotImplementedError('ListTasks is not supported in A2A v0.3 ...')`.
(Confirmed with @ishymko in the issue thread to go with Option 2 from
the report.)
## Known follow-up (out of scope)
With the route gone, `GET /v1/tasks` now falls through to the tenant
catch-all (`Mount('/{tenant}', ...)` in `rest_routes.py`). A request
with `A2A-Version: 0.3` will get a 400 version-mismatch error instead of
a clean 404/405. This is a pre-existing routing quirk that affects any
`/v1/<unknown>` path, not just `/v1/tasks` — worth a separate issue to
tighten the tenant path converter or register an explicit 405 for
reserved prefixes when v0.3 compat is enabled. Happy to follow up.
## Test plan
- [x] `uv run pytest tests/compat/v0_3/` — 249 passed
- [x] `./scripts/lint.sh` — ruff clean; `ty` reports only pre-existing
errors in untouched lines (generated protobuf stubs)
- [x] Manual trace: `GET /v1/tasks` no longer routes to
`REST03Handler.list_tasks`; the route is absent from
`REST03Adapter.routes()`
Co-authored-by: Iva Sokolaj <102302011+sokoliva@users.noreply.github.com>
1 parent 1122d4e commit 5c88793
4 files changed
Lines changed: 13 additions & 18 deletions
File tree
- src/a2a/compat/v0_3
- tests/compat/v0_3
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
146 | | - | |
147 | | - | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
148 | 149 | | |
149 | 150 | | |
150 | 151 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
290 | 290 | | |
291 | 291 | | |
292 | 292 | | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | 293 | | |
303 | 294 | | |
304 | 295 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
357 | 357 | | |
358 | 358 | | |
359 | 359 | | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | 360 | | |
367 | 361 | | |
368 | 362 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
166 | 167 | | |
167 | 168 | | |
168 | 169 | | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
169 | 178 | | |
170 | 179 | | |
171 | 180 | | |
| |||
0 commit comments