Skip to content

agentEmitter.requiresInput(a2aMessage) does not trigger a TaskStatusUpdateEvent #1037

Description

@mescaja

I have come across an issue when setting the A2A Agent task to TaskState.TASK_STATE_INPUT_REQUIRED

These are the steps to reproduce with latest 1.2.0.Final version

Step 1: A2A client agent sends a a2aMessage1 with null contextId and null taskId
Step 2: A2A Server agent

agentEmitter.submit();
agentEmitter.startWork();
agentEmitter.updateStatus(TaskState.TASK_STATE_WORKING, null);

//Do some stuff, call APIs and MCPs endpoint to run tools feeding back the result
.....

//Send a message
agentEmitter.sendMessage(a2aMessage2);

//Do some more stuff, workout logic to see if the task status needs changing
....

// Change task status
agentEmitter.requiresInput(a2aMessage3);

//Do some more stuff, send an artifact and workout logic to see if the task needs to be completed
....
agentEmitter.addArtifact(List.of(textPart));
agentEmitter.complete(a2aMessage4);

Step 3: A2A Client agent

  • Received MessageEvent and a2aMessage2 successfully returned using messageEvent.getMessage()
  • taskStatusUpdateEvent was not received for the task status update to TaskState.TASK_STATE_INPUT_REQUIRED hence a2aMessage3 got lost.
  • Received TaskArtifactUpdateEvent along with the TextPart using taskArtifactUpdateEvent.artifact().parts()
  • Received taskStatusUpdateEvent and a2aMessage4 successfully returned using taskStatusUpdateEvent.status().message()

I tried setting a task status update using the code below. The outcome was the same

agentEmitter.updateStatus(TaskState.TASK_STATE_INPUT_REQUIRED, a2aMessage3);

i need to be able to send a few messages and for the A2A client to be able to stream the corresponing MessageEvent and also to be able to set the task status to TASK_STATE_INPUT_REQUIRED and stream the associated message with it afterwards.

For some reason setting a task to INPUT_REQUIRED does not trigger the TaskStatusUpdateEvent on the client side.

I think the combination of agentEmitter.sendMessage follow by an agentEmitter.requiresInput is what causes this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions