Tags: Linux2010/a2a-python
Tags
fix(compat): remove ListTasks from v0.3 REST adapter (a2aproject#1043) ( a2aproject#1068) ## Summary Fixes a2aproject#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>