[WIP] feat(ai-gemini): upgrade @google/genai to v2 + migrate Interactions API#781
[WIP] feat(ai-gemini): upgrade @google/genai to v2 + migrate Interactions API#781jherr wants to merge 10 commits into
Conversation
… API Bump @google/genai from ^1.43.0 to ^2.8.0. The v2 SDK replaces the legacy flat Interactions schema with the new step-based model, so migrate the experimental text-interactions adapter to the renamed SSE events (interaction.created / step.start / step.delta / step.stop / interaction.completed) and the Step data model, switch structured output to the polymorphic response_format, and drop the deprecated response_mime_type. Update the 25 text-interactions tests to the new event/step schema and set allowBuilds['@google/genai'] to false (its install scripts are no-ops for consumers). Co-authored-by: Cursor <cursoragent@cursor.com>
# Conflicts: # pnpm-workspace.yaml
… 2.x The @google/genai v2 migration moved geminiTextInteractions onto the SDK 2.x Interactions event protocol (step.start/step.delta/step.stop, interaction.created/completed). All published @copilotkit/aimock versions (≤1.31.0) still emit the SDK 1.x shapes (content.* / interaction.start / interaction.complete), so the e2e mock and adapter no longer agree on the wire format and the assistant message comes back empty. Mark the test test.fixme (skipped, not failing) and document the exact event shapes aimock must emit to re-enable it. SDK 2.x adapter behaviour stays covered by unit tests in packages/ai-gemini/tests/text-interactions-adapter.test.ts. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🚀 Changeset Version Preview8 package(s) bumped directly, 24 bumped as dependents. 🟥 Major bumps
🟨 Minor bumps
🟩 Patch bumps
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
View your CI Pipeline Execution ↗ for commit 396b731
☁️ Nx Cloud last updated this comment at |
@tanstack/ai
@tanstack/ai-angular
@tanstack/ai-anthropic
@tanstack/ai-client
@tanstack/ai-code-mode
@tanstack/ai-code-mode-skills
@tanstack/ai-devtools-core
@tanstack/ai-elevenlabs
@tanstack/ai-event-client
@tanstack/ai-fal
@tanstack/ai-gemini
@tanstack/ai-grok
@tanstack/ai-groq
@tanstack/ai-isolate-cloudflare
@tanstack/ai-isolate-node
@tanstack/ai-isolate-quickjs
@tanstack/ai-mcp
@tanstack/ai-ollama
@tanstack/ai-openai
@tanstack/ai-openrouter
@tanstack/ai-preact
@tanstack/ai-react
@tanstack/ai-react-ui
@tanstack/ai-solid
@tanstack/ai-solid-ui
@tanstack/ai-svelte
@tanstack/ai-utils
@tanstack/ai-vue
@tanstack/ai-vue-ui
@tanstack/openai-base
@tanstack/preact-ai-devtools
@tanstack/react-ai-devtools
@tanstack/solid-ai-devtools
commit: |
Summary
Upgrades
@tanstack/ai-geminito the@google/genaiv2 SDK and migrates thestateful
geminiTextInteractionsadapter to the SDK 2.x Interactions eventprotocol (the May-2026 Interactions breaking changes):
response_mime_type+ flatresponse_format→ polymorphicresponse_format: { type, mime_type, schema }.indexand consumestep.start/step.delta/step.stopandinteraction.created/interaction.completed, including streamedfunction-call
arguments_deltafragments.The existing
geminiTextInteractionssupport is carried forward, notremoved — this PR builds on PR #502 and adapts it to the new SDK.
Verification
packages/ai-gemini— 201 passed, incl. all 25text-interactions-adaptertests (rewritten to emit SDK 2.xstep.*events).SDK against aimock.
Known open item — aimock lags SDK 2.x
The
stateful-interactionse2e test is markedtest.fixme(skipped, notfailing). Every published
@copilotkit/aimock(≤ 1.31.0, latest as of2026-06-17) still emits the SDK 1.x Interactions events
(
content.*/interaction.start/interaction.complete), which the migrated2.x adapter doesn't consume — so the mock can't exercise this path yet. This is a
mock/adapter format mismatch, not an adapter bug; 2.x behaviour is covered by
unit tests.
The exact event shapes aimock must emit to re-enable the test are documented in
testing/e2e/tests/stateful-interactions.AIMOCK-TODO.md.TODO before un-drafting
un-
fixmethe e2e test.pnpm test:prpass.🤖 Generated with Claude Code