Skip to content

fix(compat): serve DELETE for v0.3 REST push notification configs - #1442

Merged
Iwaniukooo11 merged 5 commits into
a2aproject:mainfrom
YusefSyed:fix/v03-rest-delete-push-config
Nov 13, 2026
Merged

Iwaniukooo11 merged 5 commits into
a2aproject:mainfrom
YusefSyed:fix/v03-rest-delete-push-config

Conversation

@YusefSyed

@YusefSyed YusefSyed commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

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.

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

Fixes #1441

The v0.3 REST adapter mounted GET, POST and list routes for push
notification configs but no DELETE, although 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). The request fell through to the v1.0 tenant mount with
tenant `v1`, so a v0.3 client got 400 VERSION_NOT_SUPPORTED while the same
call succeeded over v0.3 JSON-RPC and gRPC.

Add REST03Handler.delete_push_notification and mount it. It returns `{}`,
the JSON form of google.protobuf.Empty, like the v1.0 REST dispatcher.
@YusefSyed
YusefSyed requested a review from a team as a code owner November 10, 2026 00:48
@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

🧪 Code Coverage (vs main)

⬇️ Download Full Report

Base PR Delta
src/a2a/compat/v0_3/rest_handler.py 96.74% 96.97% 🟢 +0.23%
src/a2a/compat/v0_3/rest_transport.py 95.71% 95.73% 🟢 +0.03%
Total 93.57% 93.57% ⚪️ 0.00%

Generated by coverage-comment.yml

@ConnorMoss02

Copy link
Copy Markdown
Contributor

Ran this end to end with the real DefaultRequestHandler and in-memory push config store, not mocks. Over v0.3 REST: create, then list shows it, then delete returns 200 {}, then list is empty. On main that delete gets a 400 VERSION_NOT_SUPPORTED and the config sticks around. A delete under an unknown task gives a 404.

Would be nice to get the CompatRestTransport client side in too, since it still raises NotImplementedError.

@Iwaniukooo11 Iwaniukooo11 self-assigned this Nov 12, 2026
Comment thread src/a2a/compat/v0_3/rest_adapter.py Resolved
Comment thread src/a2a/compat/v0_3/rest_adapter.py Resolved
CompatRestTransport.delete_task_push_notification_config raised
NotImplementedError because the server had no v0.3 route. It now sends
DELETE /v1/tasks/{id}/pushNotificationConfigs/{configId}.

Tests: the transport test checks the request instead of the error, a
route test covers 404 for an unknown task, and a client test sends the
delete through the real v0.3 REST routes.
@YusefSyed
YusefSyed requested a review from a team as a code owner November 12, 2026 21:29

@Iwaniukooo11 Iwaniukooo11 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@Iwaniukooo11
Iwaniukooo11 merged commit 14e799c into a2aproject:main Nov 13, 2026
17 checks passed
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 compat REST server has no DELETE route for push notification configs

3 participants