fix(deps): migrate from deprecated @genkit-ai/googleai to @genkit-ai/google-genai - #73
Open
chenyuan99 wants to merge 1 commit into
Open
fix(deps): migrate from deprecated @genkit-ai/googleai to @genkit-ai/google-genai#73chenyuan99 wants to merge 1 commit into
chenyuan99 wants to merge 1 commit into
Conversation
…google-genai
npm deprecates @genkit-ai/googleai with "Use @genkit-ai/google-genai package
instead." The project was pinned to ^1.28.0, last published 2026-03-26, while
the successor tracks genkit core at 1.41.0.
This is step one of two: swap the plugin with no behaviour change. The model
mandate stays gemini-2.5-flash.
The change is one import. Model reference strings are unchanged because the
new plugin registers under the same namespace — googleAI.model('gemini-2.5-flash')
resolves to "googleai/gemini-2.5-flash", the exact string already used in
flows/accountant.ts, flows/auditor.ts, and flows/extractor.ts.
Verified:
- npx tsc --noEmit clean; 60/60 tests pass; build emits lib/index.js
- Under the new plugin, "googleai/gemini-2.5-flash" resolves through the real
getAI() registry, reporting supports.multiturn and supports.tools
- genkit init and defineTool round-trip offline against the new plugin
Docs: CLAUDE.md's "Why not gemini-3-flash-preview" note said to revisit when
Genkit shipped a fix. It has, in the successor package. The old plugin's
fromFunctionCall returned { toolRequest: { name, input, ref } }, dropping the
signature; google-genai round-trips it via maybeAddThoughtSignatureAndMetadata
on the way in and maybeAddGeminiThoughtSignatureAndMetadata on the way out.
The old plugin also knows no gemini-3 model names; the new one ships ten.
That was established by reading the published sources, not a live run, so the
note now records what still has to be proven before switching to gemini-3: a
real multi-turn tool-calling loop with no 400s. The offline suite never reaches
the model and cannot catch it.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
@genkit-ai/googleaiis deprecated. npm's own message: "Use @genkit-ai/google-genai package instead."@genkit-ai/googleai(before)@genkit-ai/google-genai(after)This is step one of two: swap the plugin, change no behaviour. The model mandate stays
gemini-2.5-flash. Switching to gemini-3 is deliberately separate, because it needs a live test this PR cannot provide.The change is one import
No model strings change. The new plugin registers under the same namespace:
googleAI.model('gemini-2.5-flash')resolves to"googleai/gemini-2.5-flash"— the exact string already inflows/accountant.ts,flows/auditor.ts, andflows/extractor.ts.Verification
npx tsc --noEmitclean, 60/60 tests pass,npm run buildemitslib/index.jsgetAI()and resolved"googleai/gemini-2.5-flash"through the real registry — it reportssupports.multiturn: trueandsupports.tools: truegenkit({ plugins: [googleAI()] })anddefineToolround-trip offline against the new pluginWhy this matters: the gemini-3 blocker is resolved upstream
CLAUDE.mdsaid to revisit gemini-3 "when Genkit ships the fix." Genkit shipped it — in the successor package, which is why it never reached this project.I traced the exact function the note names:
Old —
gemini.js:718, signature dropped:It handles
thoughtSignaturefor thought parts (fromThought/toThought) but not for function-call parts, so the signature is lost on the first hop and can never be replayed. That is the 400.New — round-tripped in both directions:
fromGeminiToolCall→maybeAddThoughtSignatureAndMetadatageminiPart.thoughtSignatureintopart.metadata.thoughtSignaturetoGeminiToolRequest→maybeAddGeminiThoughtSignatureAndMetadatafunctionCallpartThe helper is applied at 11 call sites covering every part type — a deliberate general fix, not a special case.
Corroborating: the old plugin knows zero gemini-3 model names; the new one ships ten, including
gemini-3-flash-previewandgemini-3.5-flash. It was frozen before Gemini 3 existed.What is NOT proven here
The above is static analysis of the published bundles, not a live run. I have not exercised a real gemini-3 tool-calling loop — that needs an API key and would spend quota.
So this PR does not switch models.
CLAUDE.mdnow records exactly what must be demonstrated first: a real multi-turn tool-calling loop against the API with no 400s. The offline suite never reaches the model and structurally cannot catch this.Docs updated
CLAUDE.md— plugin name, version line (also corrected a stale "Genkit 1.34"; the lockfile has been on 1.41.0 since #70), and the gemini-3 note rewritten from "blocked, revisit later" to "SDK blocker resolved, pending live verification."README.md— plugin name.Suggested follow-up
Step two: run one live multi-turn tool-calling check against
gemini-3-flash-preview; if clean, flip the mandate and dropmaxTurnsguidance if it is no longer needed.🤖 Generated with Claude Code