Skip to content
Source
Sign inSign up
TanStack/ai

fix(ai-gemini): report failed or cancelled agentic video interactions as RUN_ERROR #2310

Openpcbeingused33(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/2310/headopened View on GitHub

Showing 6 changed files with 33 additions and 2 deletions (loading 3).

x
0 of 6 viewed, 6 left
5 additions and 0 deletions.changeset/gemini-agentic-video-status.mdAdded
View file
@@ -0,0 +1,5 @@
+---
+'@tanstack/ai-gemini': patch
+---
+​
+The agentic video path (Interactions API) now emits `RUN_ERROR` when the interaction status is `failed` or `cancelled`, instead of closing the run as a successful `stop`.
1 addition and 1 deletiondocs/adapters/gemini-advanced.mdModified
View file
@@ -67,7 +67,7 @@
- `gemini-3.6-flash`
- `gemini-3.5-flash-lite`
​
-With `agentic`, the adapter sends the request through the Interactions API of Gemini. You give the sampling rate in your prompt ("watch it at 2 fps"), not with `fps`. The result is deeper but slower, because the model looks at the video again on each turn.
+With `agentic`, the adapter sends the request through the Interactions API of Gemini. You give the sampling rate in your prompt ("watch it at 2 fps"), not with `fps`. The result is deeper but slower, because the model looks at the video again on each turn. If Gemini ends the interaction as `failed` or `cancelled`, the run ends with `RUN_ERROR` and the code `failed` or `cancelled`, not `RUN_FINISHED`.
​
## Stateful conversations: Interactions API (experimental)
​
27 additions and 1 deletionpackages/ai-gemini/src/adapters/text.tsModified
View file
@@ -626,8 +626,34 @@
{ signal: withHttpTimeout(options.request?.signal, this.timeoutMs) },
​
- const text = interaction.output_text ?? ''
const usage = buildGeminiInteractionsUsage(interaction.usage)
+​
+ // A failed or cancelled interaction carries no usable result; surface it
+ // as an error instead of closing the run as a successful `stop`.