Skip to content

fix(compat): list push notification configs in the v0.3 REST client - #1424

Merged
mykytanetipa merged 2 commits into
a2aproject:mainfrom
RaphaelFakhri:fix/compat-rest-list-push-configs
Nov 5, 2026
Merged

mykytanetipa merged 2 commits into
a2aproject:mainfrom
RaphaelFakhri:fix/compat-rest-list-push-configs

Conversation

@RaphaelFakhri

Copy link
Copy Markdown
Contributor

Description

CompatRestTransport.list_task_push_notification_configs raised NotImplementedError, so a client using the HTTP+JSON binding could not list push notification configs on a v0.3 agent. The v0.3 REST binding defines the call as GET /v1/tasks/{id}/pushNotificationConfigs. This SDK's own v0.3 compat server (REST03Adapter) serves it, and the v0.3 JSON-RPC and gRPC client transports already implement it.

This change sends the GET request and converts the ListTaskPushNotificationConfigResponse with the existing converters, as the v0.3 gRPC transport does. delete_task_push_notification_config keeps raising NotImplementedError, since the compat REST server does not mount a delete route.

The unit test that asserted NotImplementedError now checks the request path and the parsed configs. Listing two configs against a server built with create_rest_routes(..., enable_v0_3_compat=True) also returns both of them now.

Fixes #1423

@RaphaelFakhri
RaphaelFakhri requested a review from a team as a code owner November 4, 2026 09:10
@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

🧪 Code Coverage (vs main)

⬇️ Download Full Report

Base PR Delta
src/a2a/compat/v0_3/proto_utils.py 90.57% 90.76% 🟢 +0.18%
src/a2a/compat/v0_3/rest_transport.py 95.63% 95.71% 🟢 +0.08%
Total 93.51% 93.52% 🟢 +0.01%

Generated by coverage-comment.yml

@mykytanetipa mykytanetipa left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@mykytanetipa
mykytanetipa merged commit d830036 into a2aproject:main Nov 5, 2026
17 checks passed
Iwaniukooo11 added a commit that referenced this pull request Nov 13, 2026
)

# Description

`REST03Adapter` mounts `GET`/`POST
/v1/tasks/{id}/pushNotificationConfigs` and `GET
/v1/tasks/{id}/pushNotificationConfigs/{push_id}`, but no `DELETE`. The
v0.3 binding defines `DELETE
/v1/tasks/{id}/pushNotificationConfigs/{configId}` (spec section 3.5.6,
and the `google.api.http` option on `DeleteTaskPushNotificationConfig`
in `a2a_v0_3.proto`), and the v0.3 JSON-RPC and gRPC adapters already
serve the call.

Without the route the request falls through to the v1.0 `/{tenant}`
mount with tenant `v1`, so a v0.3 client gets a 400 with reason
`VERSION_NOT_SUPPORTED` ("A2A version '0.3' is not supported by this
handler. Expected version '1.0'.").

To reproduce on main: serve a `DefaultRequestHandler` through
`create_rest_routes(..., enable_v0_3_compat=True)`, create a push config
over v0.3 REST, then send `DELETE
/v1/tasks/{task_id}/pushNotificationConfigs/{config_id}`. It returns
400. The same delete over v0.3 JSON-RPC
(`tasks/pushNotificationConfig/delete`) and gRPC
(`DeleteTaskPushNotificationConfig`) succeeds.

This change adds `REST03Handler.delete_push_notification`, which builds
a v0.3 `DeleteTaskPushNotificationConfigRequest` from the path and calls
the v1.0 handler through `RequestHandler03`, and mounts it. It returns
`{}`, the JSON form of `google.protobuf.Empty`, as the v1.0 REST
dispatcher does.

`CompatRestTransport.delete_task_push_notification_config` raised
`NotImplementedError`, which #1424 left in place because the server had
no route. It now sends the same `DELETE`, so the v0.3 REST client can
delete a config too (added after review).

Tests: `test_delete_push_notification` (handler) and
`test_delete_push_notification_config_v03` (route) fail on main and pass
with this change. After review:
`test_compat_rest_transport_delete_task_push_notification_config` now
checks the request the client sends instead of expecting
`NotImplementedError`,
`test_compat_rest_client_deletes_push_notification_config` sends the
delete from the client through the real v0.3 REST routes, and
`test_delete_push_notification_config_v03_unknown_task_returns_404`
covers `TaskNotFoundError`. The client tests fail with the old client
code.
- `uv run pytest tests/compat/v0_3/ -k "delete_push_notification or
deletes_push_notification"`: 8 failed with the three compat source files
from main, 8 passed with this change
- `uv run pytest --cov=a2a --cov-fail-under=88` after merging current
main: 2576 passed, 207 skipped, 4 xfailed, 1 xpassed; coverage 93.57%.
In one of three runs
`test_scenario_auth_required_side_channel[blocking-legacy]` failed and
then passed on rerun; it does not touch this code.
- `tests/integration/cross_version/client_server/test_client_server.py`
(against `a2a-sdk` 0.3.24): 4 passed
- `uv run ruff check` and `uv run ruff format --check`: clean; `uv run
ty check`: no errors (3 warnings, all in files this PR does not touch)

Worth checking: v0.3 routes are registered before the `/{tenant}` mount,
so a v1.0 tenant literally named `v1` deleting at this path now reaches
the v0.3 handler. That is already true for the existing v0.3 GET on the
same path. Deleting an unknown config id returns 200 `{}`, as it does on
the other transports.

- [x] Follow the CONTRIBUTING Guide.
- [x] Make your Pull Request title in the conventionalcommits.org
specification.
- [x] Ensure the tests and linter pass
- [ ] Appropriate docs were updated (if necessary)

Fixes #1441

---------

Co-authored-by: YusefSyed <[email protected]>
Co-authored-by: Mateusz Iwaniuk <[email protected]>
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 client raises NotImplementedError for list_task_push_notification_configs

2 participants