-
Notifications
You must be signed in to change notification settings - Fork 2k
Description
Is your feature request related to a problem?
Currently, when an A2A request is made to an ADK agent, the metadata
associated with the A2A request is not propagated to the InvocationContext
. This makes it difficult to implement end-to-end traceability in a distributed multi-agent system, as there is no way to access the A2A request metadata from within the agent's execution context.
Describe the solution you'd like
The A2A request metadata
should be accessible as an element of the InvocationContext
. This would allow developers to access the metadata within their agents and tools, enabling them to implement custom logic based on the metadata, such as routing requests, applying specific policies, or adding traceability information to logs and metrics.
This can be achieved by:
- Adding a
metadata
field to theRunConfig
class. - Updating the
convert_a2a_request_to_adk_run_args
function to extract themetadata
from theRequestContext
and place it into theRunConfig
. - Adding an
a2a_metadata
field to theInvocationContext
class. - Modifying the
_new_invocation_context
method in theRunner
to transfer themetadata
from theRunConfig
to the newly createdInvocationContext
.
Testing plan
Perform manual end to end testing
Additional context
This change is essential for building robust, traceable, and observable multi-agent systems with ADK, especially when integrating with other systems via the A2A protocol.