Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/a2a/compat/v0_3/rest_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,10 @@ def routes(self) -> dict[tuple[str, str], Callable[[Request], Any]]:
): functools.partial(
self._handle_request, self.handler.list_push_notifications
),
('/v1/tasks', 'GET'): functools.partial(
self._handle_request, self.handler.list_tasks
),
# ListTasks is intentionally absent: not in the A2A v0.3 spec (see
# issue #1043). Sibling v0.3 transports (jsonrpc_transport,
# grpc_transport, rest_transport) also reject list_tasks with
# NotImplementedError — do not add a route here.
('/v1/card', 'GET'): functools.partial(
self._handle_request, self.handler.on_get_extended_agent_card
),
Expand Down
9 changes: 0 additions & 9 deletions src/a2a/compat/v0_3/rest_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,15 +290,6 @@ async def list_push_notifications(

return MessageToDict(pb2_v03_resp)

@validate_version(constants.PROTOCOL_VERSION_0_3)
async def list_tasks(
self,
request: Request,
context: ServerCallContext,
) -> dict[str, Any]:
"""Handles the 'tasks/list' REST method."""
raise NotImplementedError('list tasks not implemented')

@validate_version(constants.PROTOCOL_VERSION_0_3)
async def on_get_extended_agent_card(
self,
Expand Down
6 changes: 0 additions & 6 deletions tests/compat/v0_3/test_rest_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,12 +357,6 @@ async def test_list_push_notifications(
assert called_req.params.id == 'task-1'


@pytest.mark.anyio
async def test_list_tasks(rest_handler, mock_request, mock_context):
with pytest.raises(NotImplementedError):
await rest_handler.list_tasks(mock_request, mock_context)


# Add our new translation method test
@pytest.mark.anyio
async def test_on_get_extended_agent_card_success(
Expand Down
9 changes: 9 additions & 0 deletions tests/compat/v0_3/test_rest_routes_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import pytest

from a2a.compat.v0_3 import a2a_v0_3_pb2
from a2a.compat.v0_3.rest_adapter import REST03Adapter
from a2a.server.request_handlers.request_handler import RequestHandler
from a2a.server.routes import create_agent_card_routes
from a2a.server.routes.rest_routes import create_rest_routes
Expand Down Expand Up @@ -166,6 +167,14 @@ async def test_get_task_v03(
assert expected_response == actual_response


@pytest.mark.anyio
async def test_list_tasks_not_in_v03_adapter_routes(
request_handler: RequestHandler,
) -> None:
adapter = REST03Adapter(http_handler=request_handler)
assert ('/v1/tasks', 'GET') not in adapter.routes()


@pytest.mark.anyio
async def test_cancel_task_v03(
client: AsyncClient, request_handler: MagicMock
Expand Down
Loading