Skip to content

Support A2A metadata in A2aAgentExecutor #3160

@matiasanaya

Description

@matiasanaya

Is your feature request related to a problem? Please describe.

A2A <> x402 integration relies on metadata which is discarded by convert_a2a_request_to_adk_run_args within the A2aAgentExecutor. For now I'm doing:

def override_convert_a2a_request_to_adk_run_args(
    request: RequestContext,
    part_converter: A2APartToGenAIPartConverter = convert_a2a_part_to_genai_part,
) -> dict[str, Any]:
    og = convert_a2a_request_to_adk_run_args(request, part_converter)
    if request.current_task and request.current_task.metadata:
        og["state_delta"] = {}
        for key, value in request.current_task.metadata.items():
            og["state_delta"][key] = value
    return og  # type: ignore[no-any-return]

and monkey patching, but it would be great to get native support for this.

Describe the solution you'd like
Ideally I'd like for arbitrary A2A metadata to be made available to the ADK agent as part of the state (unless there is a better spot, maybe add request_metadata to InvocationContext?). At a minimum, I'd like the A2aAgentExecutorConfig to support a full A2A request to ADK run args, not just the partial a2a_part_converter.

Describe alternatives you've considered
Ad-hoc transfer like above.

Additional context
This is required by the A2A <> x402 spec.

Metadata

Metadata

Labels

core[Component] This issue is related to the core interface and implementation

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions