Repository navigation
fix(compat): list push notification configs in the v0.3 REST client - #1424
Merged
mykytanetipa merged 2 commits intoNov 5, 2026
Merged
mykytanetipa merged 2 commits into
mykytanetipa merged 2 commits into
Conversation
🧪 Code Coverage (vs
|
| 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
This was referenced Nov 10, 2026
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]>
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.
Description
CompatRestTransport.list_task_push_notification_configsraisedNotImplementedError, 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 asGET /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
GETrequest and converts theListTaskPushNotificationConfigResponsewith the existing converters, as the v0.3 gRPC transport does.delete_task_push_notification_configkeeps raisingNotImplementedError, since the compat REST server does not mount a delete route.The unit test that asserted
NotImplementedErrornow checks the request path and the parsed configs. Listing two configs against a server built withcreate_rest_routes(..., enable_v0_3_compat=True)also returns both of them now.CONTRIBUTINGGuide.bash scripts/format.shfrom the repository root to format)Fixes #1423