a2aproject/a2a-python

[Feat]: Support non-blocking message sends

Tehsmash opened this issue · 1 comments

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

I want to avoid persistent connections via SSE and do not have infrastructure or the network setup to support push notifications from the Agent back to the client.

After sending the message to the Agent I would like to poll the Task from the client to get updates and monitor for completion, however the send message request blocks until the Task is completed so the client never receives the TaskId to poll.

For long running Agents the blocking send message request can time out and as we have not yet received the TaskId we are unable to recover / move onto polling.

Describe the solution you'd like

The MessageSendConfiguration.blocking flag should be used:

If MessageSendConfiguration.blocking = True | None, the server behaves as it does today and blocks until the Task completes.

If MessageSendConfiguration.blocking = False, the server returns the Task after it is created and concurrently executes the Agent code.

This will allow clients to set MessageSendConfiguration.blocking = False, receive the Task in the response, and then begin polling using the GetTask(taskId) request.

Describe alternatives you've considered

No response

Additional context

This matches the behaviour described by the specification for message/send: https://a2aproject.github.io/A2A/specification/#71-messagesend

Code of Conduct

  • I agree to follow this project's Code of Conduct

Addressed by #349