{"record":{"id":"91dfdfd1edf34284","repo":"BerriAI/litellm","slug":"a2a-send-message-failed-no-response-received-from","errorCode":null,"errorMessage":"A2A send_message failed: no response received from agent.","messagePattern":"A2A send_message failed: no response received from agent\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"litellm/a2a_protocol/main.py","lineNumber":257,"sourceCode":") -> \"SendStreamingMessageSuccessResponse\":\n    from a2a.compat.v0_3 import conversions\n\n    return conversions.to_compat_stream_response(event, request_id=request_id)\n\n\nasync def _send_message(a2a_client: \"A2AClientType\", request: \"SendMessageRequest\") -> \"SendMessageResponse\":\n    \"\"\"Send a non-streaming message via a2a-sdk 1.x and return JSON-RPC response.\"\"\"\n    if _a2a_conversions is None:\n        raise ImportError(\n            \"The 'a2a' package is required for A2A agent invocation. Install it with: pip install a2a-sdk\"\n        )\n\n    pb_request: Final = _to_core_send_message_request(request)\n    last_event = None\n    async for event in a2a_client.send_message(pb_request, context=_get_a2a_call_context(a2a_client)):\n        last_event = event\n    if last_event is None:\n        raise RuntimeError(\"A2A send_message failed: no response received from agent.\")\n\n    stream_compat: Final = _to_compat_stream_response(last_event, request_id=request.id)\n    result: Final = stream_compat.result\n    if not isinstance(result, (Message, Task)):\n        raise RuntimeError(\n            \"A2A send_message failed: non-streaming message/send expects the \"\n            \"agent's final event to be a Message or Task result.\"\n        )\n    return SendMessageResponse(\n        root=SendMessageSuccessResponse(\n            id=request.id,\n            result=result,\n        )\n    )\n\n\nasync def _execute_a2a_send_with_retry(\n    a2a_client: \"A2AClientType\",","sourceCodeStart":239,"sourceCodeEnd":275,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/a2a_protocol/main.py#L239-L275","documentation":"_send_message iterates the a2a-sdk event stream for a non-streaming message/send and keeps the last event. If the agent completes the exchange without yielding a single protocol event (empty/aborted JSON-RPC response, or the connection dropping before any event arrives), last_event stays None and this RuntimeError is raised. It means the transport technically succeeded but zero events were produced.","triggerScenarios":"Agent accepts the request (HTTP 200) but returns an empty or immediately-closed stream; an intermediary proxy or sidecar cuts the response body; the agent crashes after sending headers.","commonSituations":"Half-deployed or crashing agents; reverse proxies buffering or truncating SSE/JSON-RPC streams; agents returning 200 with empty body on internal errors.","solutions":["Check the target agent's logs/health — it accepted the request but emitted nothing","Reproduce outside litellm with a direct a2a-sdk or curl JSON-RPC message/send to isolate agent vs client","Retry the call once; genuinely transient stream drops surface as this error","If a proxy fronts the agent, disable response buffering and raise idle/stream timeouts"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"# Pre-flight: confirm the agent answers a cheap JSON-RPC call before\n# relying on message/send.\nimport httpx\nasync with httpx.AsyncClient() as hc:\n    r = await hc.get(f'{api_base.rstrip(\"/\")}/.well-known/agent-card.json')\n    r.raise_for_status()  # agent down/unreachable surfaces here, with a clear error","typeGuard":null,"tryCatchPattern":"for attempt in range(3):\n    try:\n        resp = await asend_message(a2a_client=client, request=req)\n        break\n    except RuntimeError as e:\n        if 'no response received from agent' not in str(e):\n            raise\n        if attempt == 2:\n            raise  # agent consistently emits nothing — its bug, escalate\n        await asyncio.backoff_sleep(attempt)  # transient empty stream","preventionTips":["Health-check agents with a card fetch before routing user traffic","Disable proxy response buffering for A2A endpoints","Log request ids so an agent-side 'accepted but emitted nothing' can be correlated"],"tags":["a2a","empty-response","runtime-error","protocol"],"backgroundTag":"empty-server-response","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}