[Bug]: v0.3 JSON-RPC `tasks/pushNotificationConfig/delete` succeeds with no `result` member
I maintainer di solito rispondono entro 2 giorni
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
What happened?
With enable_v0_3_compat=True, a successful v0.3 tasks/pushNotificationConfig/delete is answered with
{"id": 1, "jsonrpc": "2.0"}
There is no result and no error. JSON-RPC 2.0 §5 says "result: This member is REQUIRED on success" and "Either the result member or error member MUST be included" (https://www.jsonrpc.org/specification#response_object). The v0.3 A2A schema says the same for this method: DeleteTaskPushNotificationConfigSuccessResponse requires result, with type null. The SDK's own v0.3 model, a2a.compat.v0_3.types.DeleteTaskPushNotificationConfigResponse, rejects the body.
The v1.0 binding already gets this right: DeleteTaskPushNotificationConfig answers {"result": null, "id": 1, "jsonrpc": "2.0"}.
Root cause: JSONRPC03Adapter._process_non_streaming_request dumps the whole response envelope with exclude_none=True. That is meant to drop unset optional fields inside the result. For delete, the result itself is None, so the result key is dropped too:
The in-repo v0.3 client only works because it patches the missing member back in before parsing:
A stricter v0.3 client (or a JSON-RPC library that validates the envelope) treats the reply as malformed.
Repro (DefaultRequestHandler behind create_jsonrpc_routes(..., enable_v0_3_compat=True)):
from starlette.applications import Starlette
from starlette.testclient import TestClient
from a2a.compat.v0_3 import types as types_v03
from a2a.helpers.proto_helpers import new_task_from_user_message
from a2a.server.agent_execution import AgentExecutor
from a2a.server.request_handlers import DefaultRequestHandler
from a2a.server.routes import create_jsonrpc_routes
from a2a.server.tasks import InMemoryPushNotificationConfigStore, InMemoryTaskStore, TaskUpdater
from a2a.types.a2a_pb2 import AgentCapabilities, AgentCard
class Agent(AgentExecutor):
async def execute(self, context, event_queue):
await event_queue.enqueue_event(new_task_from_user_message(context.message))
await TaskUpdater(event_queue, context.task_id, context.context_id).complete()
async def cancel(self, context, event_queue):
pass
card = AgentCard(name='demo', capabilities=AgentCapabilities(push_notifications=True))
handler = DefaultRequestHandler(Agent(), InMemoryTaskStore(), card, push_config_store=InMemoryPushNotificationConfigStore())
client = TestClient(Starlette(routes=create_jsonrpc_routes(handler, rpc_url='/', enable_v0_3_compat=True)))
def call(method, params):
return client.post('/', json={'jsonrpc': '2.0', 'id': 1, 'method': method, 'params': params}).json()
task_id = call('message/send', {'message': {'kind': 'message', 'messageId': 'm1', 'role': 'user', 'parts': [{'kind': 'text', 'text': 'hi'}]}})['result']['id']
call('tasks/pushNotificationConfig/set', {'taskId': task_id, 'pushNotificationConfig': {'id': 'cfg', 'url': 'https://example.com/hook'}})
body = call('tasks/pushNotificationConfig/delete', {'id': task_id, 'pushNotificationConfigId': 'cfg'})
print(body)
types_v03.DeleteTaskPushNotificationConfigResponse.model_validate(body)
print('valid')
Output on main (c16cab1):
{'id': 1, 'jsonrpc': '2.0'}
pydantic_core._pydantic_core.ValidationError: 2 validation errors for DeleteTaskPushNotificationConfigResponse
JSONRPCErrorResponse.error
Field required [type=missing, input_value={'id': 1, 'jsonrpc': '2.0'}, input_type=dict]
DeleteTaskPushNotificationConfigSuccessResponse.result
Field required [type=missing, input_value={'id': 1, 'jsonrpc': '2.0'}, input_type=dict]
Expected: {"id": 1, "jsonrpc": "2.0", "result": null}, which is what the v1.0 binding sends and what the v0.3 schema requires.
Actual: the result member is missing, so the response is neither a valid success nor a valid error.
I have a fix with a test and can open a PR.
Code of Conduct
- I agree to follow this project's Code of Conduct
- Lingua principale
- Python
- Stelle
- 2.2k
- Fork
- 540
- Merge medio
- 2g 10h
- PR unite (30g)
- 57
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di a2aproject/a2a-python
-
[Bug]: REST task/request id sanitizationForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Apertamaintainers-only
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
a2aproject/a2a-python#805 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
[Bug]: A2ACardResolver.get_agent_card raises UnicodeDecodeError and RecursionError instead of AgentCardResolutionErrorForse già presa @rohityan l’ha presa 1 giorno fa. Aperta
a2aproject/a2a-python#1478 · 2 assegnatari ·
I maintainer di solito rispondono entro 2 giorni
-
[Bug]: JSON-RPC client ignores the JSON-RPC error body when the HTTP status is not 2xxForse già presa @rohityan l’ha presa 1 giorno fa. Aperta
a2aproject/a2a-python#1475 · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
[Feat]: validate_input_modes: match media ranges such as image/* declared in the agent cardForse già presa @rohityan l’ha presa 3 giorni fa. Apertacomponent: core status:awaiting response
a2aproject/a2a-python#1468 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
Required extensions aren't enforced, so ExtensionSupportRequiredError is never raisedForse già presa @rohityan l’ha presa 4 giorni fa. Apertacomponent: server status:awaiting response
a2aproject/a2a-python#1467 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di a2aproject/a2a-python
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
readthedocs/readthedocs-builder#73 ·
I maintainer di solito rispondono entro 1 giorno
-
area: ci bug good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
hffgzktbcc-blip/ounce-core#484 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
vllm-project/vllm-torchtpu#3395 ·
I maintainer di solito rispondono entro 1 giorno
-
Hermes plugin: MITM-domain discovery misses the model: block (provider/base_url nested under model:) — traffic blind-tunnels silently, zero compressionForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
ranxianglei/billion-context#7063 ·
I maintainer di solito rispondono entro 1 giorno