TanStack AI version#
0.54.0
Framework/Library version#
@tanstack/ai-gemini: 0.29.2 | @google/genai: 2.21.0
Describe the bug and the steps to reproduce it#
Calling abortController.abort() on a Gemini chat does not cancel the Google SDK's in-flight HTTP request. The caller's signal becomes aborted, but the signal passed to the SDK's fetch remains un-aborted.
The chat engine passes its effective request to adapter.chatStream(), including the caller's abort signal.
The Gemini adapter builds GenerateContentParameters without forwarding options.request.signal, then passes those parameters to generateContentStream().
Expected behavior#
Forward options.request?.signal to Google's config.abortSignal so cancellation reaches the SDK request. The OpenAI-compatible adapter already forwards the request signal.
Your Minimal, Reproducible Example - (Sandbox Highly Recommended)#
https://stackblitz.com/edit/vitejs-vite-yiald2ts?file=package.json,src%2Fmain.ts
Do you intend to try to help solve this bug with your own PR?#
None
Terms & Code of Conduct#