fix(compat): remove ListTasks from v0.3 REST adapter (#1043)#1068
Open
matanweks wants to merge 1 commit into
Open
fix(compat): remove ListTasks from v0.3 REST adapter (#1043)#1068matanweks wants to merge 1 commit into
matanweks wants to merge 1 commit into
Conversation
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.
Contributor
There was a problem hiding this comment.
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.
🧪 Code Coverage (vs
|
| 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1043.
The A2A v0.3 spec does not define a
ListTasksmethod, butREST03AdapteradvertisedGET /v1/taskswhileREST03Handler.list_tasksraisedNotImplementedError— 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:
('/v1/tasks', 'GET')fromREST03Adapter.routes().REST03Handler.list_tasksstub.pytest.raises(NotImplementedError)test with a regression test asserting the route is no longer registered inREST03Adapter.routes().This matches the design already present in the three sibling v0.3 transports —
jsonrpc_transport.py,grpc_transport.py, andrest_transport.py— all of which explicitly raiseNotImplementedError('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/tasksnow falls through to the tenant catch-all (Mount('/{tenant}', ...)inrest_routes.py). A request withA2A-Version: 0.3will 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;tyreports only pre-existing errors in untouched lines (generated protobuf stubs)GET /v1/tasksno longer routes toREST03Handler.list_tasks; the route is absent fromREST03Adapter.routes()