One extra field turned an A2A error into a TypeError. Fixed in a2a-sdk 1.3.0
Description and use
In a2a-sdk 1.3.0, error responses from agents are now processed correctly: an extra field no longer triggers a TypeError but maps to a typed A2A exception or A2AClientError.
Problem
When an agent sent back an error, the A2A Python SDK passed the reply to a third‑party JSON‑RPC library before inspecting it, causing a TypeError when the reply contained an unexpected field.
Outcome
The change eliminates unexpected TypeErrors, provides consistent typed exceptions, and improves error handling for third‑party agents.
Workflow
- 1. Agent sends an error response with an extra field or malformed body.
- 2. SDK receives the raw reply and checks if the body is an object, contains an error object, or a result field.
- 3. If an error object exists, the SDK maps the error code to a typed A2A exception; otherwise it raises A2AClientError.
- 4. For streaming, each event’s data is parsed and any JSONDecodeError is converted to A2AClientError.
- 5. Client code can now catch specific A2A exceptions (e.g., TaskNotFoundError) or a single A2AClientError for all other failures.
Evidence
When an agent sent back an error, the SDK handed the reply to a third‑party library before looking at it itself. That library is strict about which fields an error may carry, so one extra field, the kind the A2A spec says to ignore, made it throw a raw TypeError.
Version 1.3.0 reads the reply itself first, at one place, and the library only builds requests now.
The tests live in a new class, TestMalformedJsonRpcResponses, with 11 cases. Ten fail on main with the exceptions in the table and pass with the change.
- Record date: 2026-11-01T02:58:45.521Z