{"record":{"id":"8475320a69731d5b","repo":"BerriAI/litellm","slug":"a2a-send-message-streaming-failed-no-response-rec","errorCode":null,"errorMessage":"A2A send_message_streaming failed: no response received after retry attempts.","messagePattern":"A2A send_message_streaming failed: no response received after retry attempts\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"litellm/a2a_protocol/main.py","lineNumber":375,"sourceCode":"            card_url = get_agent_card_url(agent_card) if agent_card else None\n            continue\n        except Exception as e:\n            if response_started:\n                raise\n            try:\n                map_a2a_exception(e, card_url, api_base, model=agent_name)\n            except A2ALocalhostURLError as localhost_err:\n                a2a_client = await handle_a2a_localhost_retry(\n                    error=localhost_err,\n                    agent_card=agent_card,\n                    a2a_client=a2a_client,\n                    is_streaming=True,\n                )\n                card_url = get_agent_card_url(agent_card) if agent_card else None\n                continue\n            raise\n    if not stream_succeeded:\n        raise RuntimeError(\"A2A send_message_streaming failed: no response received after retry attempts.\")\n\n\n@client\nasync def asend_message(\n    a2a_client: Optional[\"A2AClientType\"] = None,\n    request: Optional[\"SendMessageRequest\"] = None,\n    api_base: str | None = None,\n    litellm_params: dict[str, object] | None = None,\n    agent_id: str | None = None,\n    agent_extra_headers: dict[str, str] | None = None,\n    **kwargs: object,\n) -> LiteLLMSendMessageResponse:\n    \"\"\"\n    Async: Send a message to an A2A agent.\n\n    Uses the @client decorator for LiteLLM logging and tracking.\n    If litellm_params contains custom_llm_provider, routes through the completion bridge.\n","sourceCodeStart":357,"sourceCodeEnd":393,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/a2a_protocol/main.py#L357-L393","documentation":"_execute_a2a_stream_with_retry iterates the streaming send (retrying once after a localhost-card rewrite) and tracks a stream_succeeded flag set only when at least one chunk was yielded. If the loop ends with the flag still false — no chunk was ever produced across attempts — this RuntimeError is raised. It is the streaming aggregate 'attempted but never got a chunk' error.","triggerScenarios":"api_base unreachable so the iterator raises before the first chunk; the localhost-card rewrite happened but the retried stream still produced nothing; agent closing streams before emitting any event.","commonSituations":"Stopped/misaddressed agent containers; wrong port in api_base; proxies killing streams on connect; agent crashing on the first JSON-RPC message.","solutions":["Verify agent reachability: curl <api_base>/.well-known/agent-card.json","Check logs for the localhost-retry warning and fix the agent's advertised URL if present","Test a direct streaming call against the agent to see whether it yields any chunks at all","Add caller-side retry with backoff around asend_message_streaming for transient failures"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"import httpx\n\nasync with httpx.AsyncClient(timeout=5) as hc:\n    r = await hc.get(f'{api_base.rstrip(\"/\")}/.well-known/agent-card.json')\n    if not r.is_success:\n        raise RuntimeError(f'Streaming target not reachable: {api_base} ({r.status_code})')","typeGuard":null,"tryCatchPattern":"for attempt in range(3):\n    try:\n        async for chunk in asend_message_streaming(api_base=api_base, request=req):\n            handle(chunk)\n        break\n    except RuntimeError as e:\n        if 'after retry attempts' not in str(e):\n            raise\n        await asyncio.sleep(2 ** attempt)\nelse:\n    raise RuntimeError(f'A2A streaming never produced a chunk from {api_base}')","preventionTips":["Probe the agent's card endpoint before opening streams","Set sane read/idle timeouts on proxies in front of agents so streams are not silently cut","Monitor first-chunk latency; zero chunks ever is the signature of this failure"],"tags":["a2a","retry","streaming","runtime-error","connection"],"backgroundTag":"retry-exhausted","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}