BerriAI/litellm · error · A2AError
A2A error
Error message
A2A error: {error.get('message', 'Unknown error')} What it means
A2A JSON-RPC error branch: the agent's response contains an 'error' object, so the call failed at the protocol level; the error's message is raised as A2AError, surfacing the agent-side failure to the caller.
Solutions
- Inspect the A2A error message returned by the agent and fix the request accordingly.
- Check the A2A agent's availability and task configuration.
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at litellm/llms/a2a/chat/transformation.py:289 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/6bb94d8f1ecfbe67.
Report an issue: GitHub.
Appendix: source
Thrown at litellm/llms/a2a/chat/transformation.py:289
api_key: API key
json_mode: JSON mode flag
Returns:
Populated ModelResponse object
"""
try:
response_json: Final = raw_response.json()
except Exception as e:
raise A2AError(
status_code=raw_response.status_code,
message=f"Failed to parse A2A response: {e}",
headers=dict(raw_response.headers),
)
# Check for JSON-RPC error
if "error" in response_json:
error: Final = response_json["error"]
raise A2AError(
status_code=raw_response.status_code,
message=f"A2A error: {error.get('message', 'Unknown error')}",
headers=dict(raw_response.headers),
)
# Extract text from A2A response
text: Final = extract_text_from_a2a_response(response_json)
# Populate model response
model_response.choices = [
Choices(
finish_reason="stop",
index=0,
message=Message(
content=text,
role="assistant",
),
)View on GitHub (pinned to 77b7c6c40c)