You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Expose a transport-level cancel/close handle on async streaming responses (so they can be cancelled from another task) #2425
priority: p3Desirable enhancement or fix. May not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.
While working on pydantic/pydantic-ai#1524 I hit: generate_content_stream only exposes the generator, so cancelling it from another task while we're iterating raises RuntimeError: aclose(): asynchronous generator is already running.
Describe the solution you'd like
A transport handler we could close with or cancel with would be great
Describe alternatives you've considered
There are some things we could do to maybe mimic this but given that most SDKs have this it would be nice if genai did too
priority: p3Desirable enhancement or fix. May not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.
Activity
Venkaiahbabuneelam commentedon May 14, 2026
Hi @adtyavrdhn, Thanks for reaching out us!
Thank you for your feedback. We appreciate you taking the time to share your thoughts with us, and we'll be filing a feature request.
Thanks