The parts of a server, in the order a request meets them
One SendStreamingMessage request enters the kit server at Handler.jsonrpc or Handler.rest. It passes authenticate, which answers HTTP 401 for a bad token, check_version, which answers VersionNotSupportedError -32009, and the capability check on the card, which answers UnsupportedOperationError -32004. Agent.send then validates the message and stores a task in Agent.tasks as TASK_STATE_SUBMITTED. Agent.work runs the behavior, the agent logic, in a thread. Agent.apply writes each event to the task record and Agent.broadcast copies it to every subscriber queue, which Handler.pump writes as SSE data frames, and to Agent.deliver, which POSTs it to each webhook URL.
THE REQUEST, TOP TO BOTTOM
WHAT A FAILED CHECK RETURNS
SendStreamingMessage request
POST /a2a/jsonrpc, A2A-Version: 1.0
Handler.jsonrpc, Handler.rest
one method per binding, same checks
authenticate
bearer token, deployer only
HTTP 401
WWW-Authenticate: Bearer
check_version
A2A-Version must be 1.0
VersionNotSupportedError
-32009, FAILED_PRECONDITION
card["capabilities"]
streaming, pushNotifications
UnsupportedOperationError
-32004, or -32003 for push
Agent.send
validate_message, then one task
Agent.tasks
the task record, TASK_STATE_SUBMITTED
Agent.work, behavior
the agent logic, in its own thread
a thread per request
Agent.apply, Agent.broadcast
the record, then every subscriber
yields events
writes the task
Handler.pump
data: frames on each SSE stream
Agent.deliver
POST to each webhook URL
each event
each event