Skip to content

A2A communication drops state context by invoking 4-argument runner.runAsync #1240

@anastasiiapeleshok-festcloud

Description

Description

During Agent-to-Agent (A2A) communication, AgentExecutor.java triggers execution by calling runner.runAsync. However, it uses the 4-argument signature. Looking at Runner.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, AgentExecutor should extract this context and pass it into the 5-argument version of runAsync.

Code Reference

  1. The Call Site (AgentExecutor.java)
    AgentExecutor invokes the 4-argument method inside the execute pipeline:
return runner.runAsync(
    getUserId(ctx),
    session.id(),
    content,
    agentExecutorConfig.runConfig()); // <-- ISSUE: Invokes 4-arg variant
  1. The Root Cause Overload (Runner.java)
    In Runner.java, the 4-argument variant forces the state delta to be null:
public Flowable<Event> runAsync(
    String userId, String sessionId, Content newMessage, RunConfig runConfig) {
  return runAsync(userId, sessionId, newMessage, runConfig, /* stateDelta= */ null); // <-- ISSUE: Hardcoded 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 runAsync so that the stateDelta is properly propagated into the session history.

Runner.java

AgentExecutor.java

Metadata

Metadata

Assignees

Labels

waiting on reporterWaiting for reaction by reporter. Failing that, maintainers will eventually closed it as stale.

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions