Skip to content

fix(compat): return result: null for v0.3 pushNotificationConfig/delete - #1481

Merged
Iwaniukooo11 merged 2 commits into
a2aproject:mainfrom
saquibjawedbit:fix/v03-jsonrpc-delete-result
Nov 17, 2026
Merged

Iwaniukooo11 merged 2 commits into
a2aproject:mainfrom
saquibjawedbit:fix/v03-jsonrpc-delete-result

Conversation

@saquibjawedbit

Copy link
Copy Markdown
Contributor

Description

With enable_v0_3_compat=True, a successful v0.3 tasks/pushNotificationConfig/delete was answered with {"id": 1, "jsonrpc": "2.0"}, with neither result nor error. JSON-RPC 2.0 §5 requires result on success, the v0.3 schema requires result: null here, and the SDK's own v0.3 response type rejects the body. The v1.0 JSON-RPC path already returns "result": null.

Cause: JSONRPC03Adapter._process_non_streaming_request dumps the response with exclude_none=True, which also drops the None result of the delete success response.

Fix: keep exclude_none=True (so unset optional fields stay out) and put result back with content.setdefault('result', None). Only success responses go through this code path, so error responses are unaffected; for every other method result is already set.

Testing

New test in tests/compat/v0_3/test_jsonrpc_app_compat.py.

Before the fix:

AssertionError: assert {'id': '5', 'jsonrpc': '2.0'} == {'id': '5', 'jsonrpc': '2.0', 'result': None}

After:

$ pytest tests/compat/v0_3 -k delete
1 passed

Full suite on main (c16cab1):

$ pytest tests --ignore=tests/integration/cross_version
2618 passed, 215 skipped, 4 xfailed, 1 xpassed

ruff check, ruff format and ty check pass on the changed files.

Fixes #1480 🦕

A successful v0.3 `tasks/pushNotificationConfig/delete` was answered with
`{"jsonrpc": "2.0", "id": 1}`: no `result` and no `error`. JSON-RPC 2.0
requires the `result` member on every success response, and the v0.3
schema (`DeleteTaskPushNotificationConfigSuccessResponse`) requires
`result: null`. The SDK's own v0.3 response model rejects the body.

Root cause: `JSONRPC03Adapter._process_non_streaming_request` serializes
the response envelope with `model_dump(exclude_none=True)`. That is meant
to drop unset optional fields inside the result, but for delete the
result itself is `None`, so the whole member is dropped.

Keep `exclude_none` for the payload and put `result` back when it was
dropped. The v1.0 JSON-RPC dispatcher already answers with
`"result": null`.
@saquibjawedbit
saquibjawedbit requested a review from a team as a code owner November 16, 2026 13:43
@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

🧪 Code Coverage (vs main)

⬇️ Download Full Report

Base PR Delta
src/a2a/compat/v0_3/jsonrpc_adapter.py 72.87% 75.57% 🟢 +2.70%
Total 93.59% 93.62% 🟢 +0.03%

Generated by coverage-comment.yml

@Iwaniukooo11 Iwaniukooo11 self-assigned this Nov 17, 2026

@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 af9437f into a2aproject:main Nov 17, 2026
21 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 JSON-RPC tasks/pushNotificationConfig/delete succeeds with no result member

2 participants