Repository navigation
A2A communication drops state context by invoking 4-argument runner.runAsync #1240
Description
Activity
Hi @anastasiiapeleshok-festcloud, Thank you for reporting this issue. I have tried to reproduce this issue using the latest version but was unable to observe the reported behavior. Could you please try with the Latest version
1.4.0and if you are observing the same, Could you please share the repro steps and a minimal reproducible example along with the error logs? having this information will help us to investigate further and provide a solution.- addedwaiting on reporterWaiting for reaction by reporter. Failing that, maintainers will eventually closed it as stale.Waiting for reaction by reporter. Failing that, maintainers will eventually closed it as stale.
on Jun 3, 2026 anastasiiapeleshok-festcloud commented
on Jun 11, 2026 AuthorMore actionsHi @anastasiiapeleshok-festcloud, Thank you for reporting this issue. I have tried to reproduce this issue using the latest version but was unable to observe the reported behavior. Could you please try with the Latest version
1.4.0and if you are observing the same, Could you please share the repro steps and a minimal reproducible example along with the error logs? having this information will help us to investigate further and provide a solution.Hi @hemasekhar-p,
Thank you for looking into this! I realize my initial description might not have been clear enough.
To clarify, this issue doesn't produce any error logs or exceptions, which is likely why you couldn't observe it via standard reproduction attempts. Instead, it is a silent logical bug where data is being dropped at the code level.
I've attached two screenshots from the codebase (which is still present in the latest version) that highlight the exact execution path:
AgentExecutor.java (Screenshot 1): Starting at line 216, the execute method calls
runner.runAsync(...). It only passes 4 arguments (userId, sessionId, content, runConfig).Runner.java (Screenshot 2): Starting at line 365, the 4-argument
runAsyncoverload acts as a wrapper. It calls the 5-argument method but explicitly hardcodes /* stateDelta= */ null as the final parameter.
Because
AgentExecutorrelies on this 4-argument wrapper, anystateDeltaor metadata passed during Agent-to-Agent communication is instantly dropped and overwritten by that hardcoded null. It never reaches the underlying session processing.To fix this,
AgentExecutorneeds to be updated to extract the state/metadata from theRequestContext, and directly invoke the 5-argument version ofrunAsyncso the context is preserved.Let me know if this helps clarify the problem.
Hi @anastasiiapeleshok-festcloud, Thank you for the detailed information. I have created this PR to resolve this problem. hope this PR will resolve your issue?
- addedwaiting on reporterWaiting for reaction by reporter. Failing that, maintainers will eventually closed it as stale.Waiting for reaction by reporter. Failing that, maintainers will eventually closed it as stale.and removedwaiting on reporterWaiting for reaction by reporter. Failing that, maintainers will eventually closed it as stale.Waiting for reaction by reporter. Failing that, maintainers will eventually closed it as stale.
on Jun 16, 2026 Hello, @anastasiiapeleshok-festcloud. We decided to go with the approach that aligns the functionality with ADK Python.
Instead of writing
a2a:task_id/a2a:context_idinto session state,AgentExecutornow routes the incoming request metadata (ctx.getParams().metadata()) intoRunConfig.customMetadataunder thea2a_metadatakey and leaves the state deltanull. This mirrors ADK Python a2a/converters/request_converter.py:A2A_METADATA_KEY = 'a2a_metadata'(L31),custom_metadata[A2A_METADATA_KEY] = request_metadata(L104),run_config=RunConfig(custom_metadata=custom_metadata)(L120;state_deltadefaults toNone(L42) and is never forwarded (a2a_agent_executor.py L211).
The issue has been resolved in commit 410ff81 and will be included in the next release.
- removedwaiting on reporterWaiting for reaction by reporter. Failing that, maintainers will eventually closed it as stale.Waiting for reaction by reporter. Failing that, maintainers will eventually closed it as stale.
on Jul 13, 2026
Description
During Agent-to-Agent (A2A) communication,
AgentExecutor.javatriggers execution by callingrunner.runAsync. However, it uses the 4-argument signature. Looking atRunner.java, this specific overload explicitly hardcodes/* stateDelta= */ null, completely dropping any custom state or metadata passed during the interaction.To support agents that pass metadata or state deltas to guide downstream processing,
AgentExecutorshould extract this context and pass it into the 5-argument version ofrunAsync.Code Reference
AgentExecutor invokes the 4-argument method inside the execute pipeline:
In Runner.java, the 4-argument variant forces the state delta to be null:
Expected Behavior
AgentExecutor should extract the incoming state/metadata from the RequestContext ctx (or the incoming Message) and invoke the 5-argument version of
runAsyncso that thestateDeltais properly propagated into the session history.Runner.java
AgentExecutor.java