-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feature: Async support without using Resource #650
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: Async support without using Resource #650
Conversation
|
I don't believe this is the right level of abstraction to take for async processes and resumability. Thinking about A2A flows, we need a primitive that's resumable, pollable, and updatable -- basically the lifecycle that you describe here -- but that flow can have multiple tool calls and other operations happening on it. I think that we should introduce a notion of a "Task", which could contain tool calls or other operations (e.g. A2A messages). E.g. a Task that contains only a tool call might be represented as
Having a task lifecycle that extends outside of a single request is the building block of A2A flows, e.g.
This is just off the top of my head and obviously need some more details here like TTLs and so on, but imo we should have a vision of how async support composes later on so we don't have to reinvent the wheel as soon as we start talking about A2A flows. |
|
What is the reasoning behind |
|
Having been the original author of #617 I think I've come to the conclusion that with a little creative use of a zero progress notification and some juggling of logic on the client side the existing protocol is able to support much of this use case already. See modelcontextprotocol/python-sdk#1209 for an example of how this can be implemented in the python client. Caveat to the above is I'm not sure I'm a big fan of the zero progress notification (even though it does minimise protocol changes) as it feels a bit to implicit and would need good documentation for all client and servers so they know how to implement this behaviour properly. A more robust solution might be to create a specific protocol notification as an acknowledgement that a call tool has been received which then gives the client an sse event id to resume later. That could be then handled within the sdks rather than relying on clients and tool builders to implement long running tool calls in a specific way. |
|
Tasks is a very similar feature that supports this now. |
|
Looks like it satisfies what I was looking for, has anyone picked up the python implementation of this that anyone is aware of? |
Added support for long-running operations by implementing a basic polling mechanism. Inspired from 617 and 549
Motivation and Context
** Client -> Server - GetToolAsyncRequest
** Server -> Client - GetToolAsyncResult(returns CallToolResult)
How Has This Been Tested?
Breaking Changes
Non breaking changes
Types of changes
Checklist
Additional context