Repository navigation
fix(compat): return result: null for v0.3 pushNotificationConfig/delete - #1481
Open
saquibjawedbit wants to merge 1 commit into
Open
saquibjawedbit wants to merge 1 commit into
saquibjawedbit wants to merge 1 commit into
Conversation
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`.
🧪 Code Coverage (vs
|
| Base | PR | Delta | |
|---|---|---|---|
| src/a2a/compat/v0_3/jsonrpc_adapter.py | 72.87% | 75.57% | 🟢 +2.70% |
| src/a2a/server/cluster/database_event_stream.py | 97.27% | 93.64% | 🔴 -3.64% |
| Total | 93.71% | 93.70% | 🔴 -0.01% |
Generated by coverage-comment.yml
This branch has not been deployed
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
With
enable_v0_3_compat=True, a successful v0.3tasks/pushNotificationConfig/deletewas answered with{"id": 1, "jsonrpc": "2.0"}, with neitherresultnorerror. JSON-RPC 2.0 §5 requiresresulton success, the v0.3 schema requiresresult: nullhere, 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_requestdumps the response withexclude_none=True, which also drops theNoneresult of the delete success response.Fix: keep
exclude_none=True(so unset optional fields stay out) and putresultback withcontent.setdefault('result', None). Only success responses go through this code path, so error responses are unaffected; for every other methodresultis already set.Testing
New test in
tests/compat/v0_3/test_jsonrpc_app_compat.py.Before the fix:
After:
Full suite on main (c16cab1):
ruff check,ruff formatandty checkpass on the changed files.CONTRIBUTINGGuide.Fixes #1480 🦕