Commit 6f3b353
feat(ai-gemini): upgrade @google/genai to v2 + migrate Interactions API (#781)
* chore: update project agent configuration
* chore: update project agent configuration
* chore: update project agent configuration
* feat(ai-gemini): upgrade @google/genai to v2 and migrate Interactions 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>
* chore: update project agent configuration
* chore: update project agent configuration
* chore: update project agent configuration
* test(e2e): quarantine gemini stateful-interactions pending aimock SDK 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>
* ci: apply automated fixes
* fix(ai-gemini): address review feedback on Interactions v2 migration
- Stream function-call args via partial-json instead of strict JSON.parse:
incomplete `arguments_delta` fragments no longer log a parse error each,
and a truncated buffer keeps the last good args instead of resetting to {}
(tombeckenham, CodeRabbit).
- Drop the unnecessary `as Record<string, unknown>` cast on step.arguments;
FunctionCallStep.arguments is already an index-signature object
(tombeckenham).
- Remove accidentally-committed `.agentsroom/` tooling (incl. a personal
claudeSessionId), unrelated to this change (CodeRabbit).
- Add unit tests: multi-fragment arguments_delta accumulation, args-stream
truncation preserving last good args, and thought_summary -> REASONING_*.
- Add changeset for the @google/genai v2 upgrade.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* ci: apply automated fixes
* test(ai-gemini): enable stateful-interactions e2e on aimock 1.34.0
aimock 1.34.0 emits the SDK 2.x Gemini Interactions event format
(interaction.created/completed, step.start/delta/stop, arguments_delta),
so the migrated geminiTextInteractions adapter can now be exercised
end-to-end. Bump @copilotkit/aimock to ^1.34.0, un-fixme the two-turn
stateful-interactions spec, and drop the now-obsolete AIMOCK-TODO doc.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Exlcuding aimock from minimum age restrictions
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Tom Beckenham <34339192+tombeckenham@users.noreply.github.com>1 parent 037e15a commit 6f3b353
10 files changed
Lines changed: 696 additions & 250 deletions
File tree
- .changeset
- packages/ai-gemini
- src/experimental/text-interactions
- tests
- testing/e2e
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
68 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
| |||
0 commit comments