Repository navigation
fix(compat): serve DELETE for v0.3 REST push notification configs - #1442
Merged
Iwaniukooo11 merged 5 commits intoNov 13, 2026
Merged
Conversation
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.
🧪 Code Coverage (vs
|
| 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
Contributor
|
Ran this end to end with the real Would be nice to get the |
Iwaniukooo11
requested changes
Nov 12, 2026
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.
This was referenced Nov 17, 2026
Iwaniukooo11
pushed a commit
that referenced
this pull request
Nov 17, 2026
🤖 I have created a release *beep* *boop* --- ## [1.3.1](v1.3.0...v1.3.1) (2026-11-16) ### Features * add httpx2 support ([#1439](#1439)) ([a59bb68](a59bb68)) * **cluster:** Introduce ServerCallContext to DatabaseTaskEventStream ([#1399](#1399)) ([6168d59](6168d59)) ### Bug Fixes * **client:** handle case-insensitive SSE media types ([#1464](#1464)) ([3932982](3932982)) * **client:** keep tenant defaults local to each call ([#1463](#1463)) ([569b94f](569b94f)) * **client:** percent-encode ids in REST transport paths ([#1436](#1436)) ([1bbe69c](1bbe69c)) * **client:** split SSE lines only on CR, LF and CRLF ([#1456](#1456)) ([c8ccea9](c8ccea9)) * **compat:** get a v0.3 push config by task id alone ([#1380](#1380)) ([aa8e966](aa8e966)) * **compat:** list push notification configs in the v0.3 REST client ([#1424](#1424)) ([d830036](d830036)), closes [#1423](#1423) * **compat:** map v0.3 gRPC errors from their ErrorInfo reason ([#1466](#1466)) ([caab6a2](caab6a2)) * **compat:** parse the v0.3 REST extended agent card as JSON ([#1420](#1420)) ([076e0ec](076e0ec)) * **compat:** percent-encode ids in v0.3 REST transport paths ([#1458](#1458)) ([1ff86d5](1ff86d5)) * **compat:** return -32602 for invalid v0.3 JSON-RPC params ([#1419](#1419)) ([05aaff6](05aaff6)) * **compat:** return 400 for a non-integer v0.3 REST historyLength ([#1382](#1382)) ([9c90c48](9c90c48)), closes [#1381](#1381) * **compat:** return HTTP errors from v0.3 REST streams that fail early ([#1403](#1403)) ([11f1116](11f1116)) * **compat:** send no v0.3 configuration when the request has none ([#1429](#1429)) ([01483cb](01483cb)) * **compat:** send v0.3 REST request bodies with json_name keys ([#1455](#1455)) ([2399993](2399993)) * **compat:** serve DELETE for v0.3 REST push notification configs ([#1442](#1442)) ([14e799c](14e799c)) * reject decoded values that are not objects in parse_lenient ([#1431](#1431)) ([257626b](257626b)) * reject invalid REST boolean query values ([#1383](#1383)) ([babc3f5](babc3f5)) * **server:** close the event queues when ActiveTask.start() fails ([#1422](#1422)) ([5e0d415](5e0d415)) * **server:** create the cluster tables lazily in VersionedDatabaseTaskStore get and delete ([#1357](#1357)) ([4e133b7](4e133b7)) * **server:** fail fast when an executor produces no events ([#1345](#1345)) ([ab7e36f](ab7e36f)) * **server:** fail streaming sends when an executor produces no events ([#1460](#1460)) ([c16cab1](c16cab1)) * **server:** forward CancelTaskRequest.metadata to AgentExecutor.cancel ([#1416](#1416)) ([f666ba3](f666ba3)), closes [#1415](#1415) * **server:** infer contextId from task when only taskId is provided ([#1453](#1453)) ([2ba8e7b](2ba8e7b)), closes [#1411](#1411) * **server:** match input modes on type and subtype, ignoring case ([#1425](#1425)) ([28f8a62](28f8a62)) * **server:** prevent failed cancel from overwriting terminal task state ([#1405](#1405)) ([ac48ce1](ac48ce1)) * **server:** record FAILED when a task's terminal save fails ([#1400](#1400)) ([4e916d8](4e916d8)) * **server:** reject out-of-range ListTasks cursor timestamps ([#1451](#1451)) ([f451ed7](f451ed7)) * **server:** run after_handler_run when a handler call is cancelled ([#1427](#1427)) ([2cc1dd5](2cc1dd5)) * **server:** treat request bodies that are not valid UTF-8 as parse errors ([#1401](#1401)) ([56ec855](56ec855)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Iwaniukooo11
added a commit
that referenced
this pull request
Nov 18, 2026
…1486) # Description The v0.3 REST client built the `DELETE /v1/tasks/{task_id}/pushNotificationConfigs/{id}` path without percent-encoding the ids. #1458 added `_quote_id` to the other six path builders in `compat/v0_3/rest_transport.py`, but the delete call was missed (its server route only landed later, in #1442). So deleting `alerts#ops` sent `.../pushNotificationConfigs/alerts#ops`; the `#ops` became a URL fragment and the server deleted `alerts` instead, leaving `alerts#ops` in place. Ids with `?` or `%` are mangled the same way. **Fix:** wrap both ids in `_quote_id`, as the get, list and create calls already do. ## Testing New case in the existing path-encoding tests in `tests/compat/v0_3/test_rest_transport.py` (real handler + real client: create `alerts` and `alerts#ops`, delete `alerts#ops`, check what's left). Before the fix: ``` AssertionError: assert ['alerts#ops'] == ['alerts'] 1 failed, 2 passed ``` After: ``` 3 passed ``` Full suite on main (a59bb68): ``` $ pytest tests --ignore=tests/integration/cross_version 2618 passed, 215 skipped, 4 xfailed, 1 xpassed ``` `ruff check` and `ruff format` pass. - [x] Follow the [`CONTRIBUTING` Guide](https://github.com/a2aproject/a2a-python/blob/main/CONTRIBUTING.md). - [x] Make your Pull Request title in the <https://www.conventionalcommits.org/> specification. - [x] Ensure the tests and linter pass - [x] Appropriate docs were updated (if necessary) Fixes #1485 🦕 Co-authored-by: Mateusz Iwaniuk <45974414+Iwaniukooo11@users.noreply.github.com>
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
REST03AdaptermountsGET/POST /v1/tasks/{id}/pushNotificationConfigsandGET /v1/tasks/{id}/pushNotificationConfigs/{push_id}, but noDELETE. The v0.3 binding definesDELETE /v1/tasks/{id}/pushNotificationConfigs/{configId}(spec section 3.5.6, and thegoogle.api.httpoption onDeleteTaskPushNotificationConfigina2a_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 tenantv1, so a v0.3 client gets a 400 with reasonVERSION_NOT_SUPPORTED("A2A version '0.3' is not supported by this handler. Expected version '1.0'.").To reproduce on main: serve a
DefaultRequestHandlerthroughcreate_rest_routes(..., enable_v0_3_compat=True), create a push config over v0.3 REST, then sendDELETE /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.3DeleteTaskPushNotificationConfigRequestfrom the path and calls the v1.0 handler throughRequestHandler03, and mounts it. It returns{}, the JSON form ofgoogle.protobuf.Empty, as the v1.0 REST dispatcher does.CompatRestTransport.delete_task_push_notification_configraisedNotImplementedError, which #1424 left in place because the server had no route. It now sends the sameDELETE, so the v0.3 REST client can delete a config too (added after review).Tests:
test_delete_push_notification(handler) andtest_delete_push_notification_config_v03(route) fail on main and pass with this change. After review:test_compat_rest_transport_delete_task_push_notification_confignow checks the request the client sends instead of expectingNotImplementedError,test_compat_rest_client_deletes_push_notification_configsends the delete from the client through the real v0.3 REST routes, andtest_delete_push_notification_config_v03_unknown_task_returns_404coversTaskNotFoundError. 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 changeuv run pytest --cov=a2a --cov-fail-under=88after merging current main: 2576 passed, 207 skipped, 4 xfailed, 1 xpassed; coverage 93.57%. In one of three runstest_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(againsta2a-sdk0.3.24): 4 passeduv run ruff checkanduv 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 namedv1deleting 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.Fixes #1441