Skip to content
Source
Sign inSign up
TanStack/ai

Gemini chat adapter does not forward the request abort signal to the Google SDK #1374

Closedkolaworld(GitHub profile, opens in a new tab) opened this issue 0 comments

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.

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

  • I agree to follow this project's Code of Conduct
  • I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
  1. github-actions[bot](GitHub profile, opens in a new tab) added labelswaiting-on: maintainer

  2. AlemTuzlak closed this

Sign in to join this conversation.