User Story 07: Task Handover
Implementation-oriented user story for SDK development.
Card Agent Delegates Task to a Spawned Agent Instance
Goal
Agent A sends a request to a card-owning agent (Agent B). Agent B accepts the request, delegates the task to a spawned or specialized agent instance (Agent C), and signals the handover so Agent A routes follow-up operations directly to Agent C.
Preconditions
- Agent B is discoverable on:
$a2a/v1/discovery/{org_id}/{unit_id}/{agent_b_id}
- Agent C is a spawned instance managed by Agent B. Agent C does not publish its own Agent Card but has a distinct Client ID (
{org_id}/{unit_id}/{agent_c_id}). - Agent A has a subscribed reply topic and can publish to Agent B's request topic.
End-to-End Flow
- Agent A subscribes to reply topic:
$a2a/v1/reply/{org_id}/{unit_id}/{agent_a_id}/{reply_suffix}
- Agent A publishes request to Agent B:
$a2a/v1/request/{org_id}/{unit_id}/{agent_b_id}- MQTT v5 properties:
Response Topic: reply topic aboveCorrelation Data: unique request correlation bytes
- Payload includes requester-generated
Task.id(UUIDv4)
- Agent B receives the request, accepts the
Task.id, and decides to delegate to Agent C. - Agent B (or Agent C on behalf of Agent B) publishes reply to
Response Topic:- Echoes the same
Correlation Data - Includes User Property:
- key:
a2a-responder-agent-id - value:
{agent_c_id}
- key:
- Payload echoes
Task.id
- Echoes the same
- Agent A persists:
Task.id- Responder agent:
{org_id}/{unit_id}/{agent_c_id}
- Agent A sends follow-up task operations to Agent C's direct request topic:
$a2a/v1/request/{org_id}/{unit_id}/{agent_c_id}
SDK Requirements Checklist
- Parse
a2a-responder-agent-idUser Property on any reply or stream message. - Update task routing table when handover is received: subsequent operations for that
Task.idtarget the new agent. - Honor the most recently received
a2a-responder-agent-idif multiple are received for the sameTask.id. Task.iddoes not change across handover.- Generate new
Correlation Datafor follow-up requests to the handover target.
Failure Cases to Test
- Responder agent unreachable: requester applies retry profile against the new agent's direct topic; if exhausted, requester may fall back to the original card agent.
- Missing
a2a-responder-agent-idon reply: requester continues routing to the original card agent (no handover). - Multiple handovers in a streaming session: requester honors the latest
a2a-responder-agent-idvalue.