You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Python: A2AExecutor: accept forwarded run kwargs from request metadata #9191
A2AExecutor receives the inbound A2A RequestContext, including context.metadata (SendMessageRequest.metadata), but ignores it. run_kwargs is fixed when the executor is constructed, so runtime context a caller passes as function_invocation_kwargs and client_kwargs cannot reach the hosted agent. Middleware and tools on a hosted agent therefore see different context.kwargs than they would if the agent ran locally in the same workflow.
function_invocation_kwargs and client_kwargs are the only run-time inputs in the SupportsAgentRun.run contract besides messages, session and stream, so they are the natural thing to rehydrate on the server.
Proposal
Let A2AExecutor opt in to accepting selected keys of the kwargs a client forwards in SendMessageRequest.metadata["agent_framework"] (client side: #7973), and pass them to agent.run(function_invocation_kwargs=..., client_kwargs=...):
Opt-in via a key allowlist (A2AExecutor(agent, accepted_kwargs=[...])). Nothing is accepted by default, because the values are chosen by a remote caller and client_kwargs can reach a provider client.
run_kwargs configured on the executor win on conflict.
Framework-owned names (stream, messages, options, session, middleware and similar, plus underscore-prefixed names) are rejected with ValueError at construction, so a remote caller cannot cause duplicate keyword errors.
A caller that forwards function_invocation_kwargs={"tenant": "acme"} then gets context.kwargs["tenant"] == "acme" in function middleware and tools on the hosted agent.
changed the title [-]Python: A2AExecutor: add prepare_session hook to initialize session from request metadata[/-][+]Python: A2AExecutor: accept forwarded run kwargs from A2A request metadata[/+]on Oct 8, 2026
changed the title [-]Python: A2AExecutor: accept forwarded run kwargs from A2A request metadata[/-][+]Python: A2AExecutor: accept forwarded run kwargs from request metadata[/+]on Oct 8, 2026
Activity
[-]Python: A2AExecutor: add prepare_session hook to initialize session from request metadata[/-][+]Python: A2AExecutor: accept forwarded run kwargs from A2A request metadata[/+][-]Python: A2AExecutor: accept forwarded run kwargs from A2A request metadata[/-][+]Python: A2AExecutor: accept forwarded run kwargs from request metadata[/+]