Skip to content

fix(compat): remove ListTasks from v0.3 REST adapter (#1043)#1068

Open
matanweks wants to merge 1 commit into
a2aproject:mainfrom
matanweks:fix/rest03-list-tasks-1043
Open

fix(compat): remove ListTasks from v0.3 REST adapter (#1043)#1068
matanweks wants to merge 1 commit into
a2aproject:mainfrom
matanweks:fix/rest03-list-tasks-1043

Conversation

@matanweks
Copy link
Copy Markdown

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

  • uv run pytest tests/compat/v0_3/ — 249 passed
  • ./scripts/lint.sh — ruff clean; ty reports only pre-existing errors in untouched lines (generated protobuf stubs)
  • Manual trace: GET /v1/tasks no longer routes to REST03Handler.list_tasks; the route is absent from REST03Adapter.routes()

The A2A v0.3 spec does not define ListTasks, but REST03Adapter advertised
GET /v1/tasks while REST03Handler.list_tasks raised NotImplementedError —
exposing a route guaranteed to fail at runtime. The sibling v0.3 transports
(jsonrpc_transport, grpc_transport, rest_transport) all already reject
ListTasks for the same reason; this aligns the REST adapter with them.
@matanweks matanweks requested a review from a team as a code owner May 17, 2026 07:26
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request removes the list_tasks functionality from the A2A v0.3 REST adapter and handler to align with the v0.3 specification. The /v1/tasks route and its associated handler method were deleted, and a new test was added to verify the route's absence. I have no feedback to provide.

@github-actions
Copy link
Copy Markdown

🧪 Code Coverage (vs main)

⬇️ Download Full Report

Base PR Delta
src/a2a/compat/v0_3/rest_handler.py 96.70% 96.63% 🔴 -0.07%
Total 93.08% 93.08% ⚪️ -0.00%

Generated by coverage-comment.yml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: v0.3 REST compatibility exposes GET /v1/tasks but ListTasks is still unimplemented

1 participant