Skip to content

Add a way to retrieve the ID for a given request #2086

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

Open
jakemac53 opened this issue May 2, 2025 · 0 comments
Open

Add a way to retrieve the ID for a given request #2086

jakemac53 opened this issue May 2, 2025 · 0 comments

Comments

@jakemac53
Copy link
Contributor

jakemac53 commented May 2, 2025

This is a blocker for dart-lang/ai#37

Cancellation notifications are by ID but we don't get direct access to the ID (see the MCP spec).

We could hack this by passing a custom ID generator, but it would require relying on implementation details to avoid race conditions (relying on the id function being called synchronously when we call sendRequest).

It isn't obvious how best to expose this - possibly it could be via an Expando on the returned Future from sendRequest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant