chore(deps): update @google/genai from 1.30.0 to 2.6.0 - #4485
Conversation
wenshao
left a comment
There was a problem hiding this comment.
No review findings. Downgraded from Approve to Comment: CI failing (Test on macos-latest, windows-latest, ubuntu-latest + Lint). The code changes are clean — SDK bump is correct, FinishReason exhaustiveness enforced by TypeScript, all 16k tests pass locally. Please investigate the CI failures before merging. — qwen3.7-max via Qwen Code /review
wenshao
left a comment
There was a problem hiding this comment.
[Suggestion] Test coverage gap: the two new FinishReason values (IMAGE_RECITATION, IMAGE_OTHER) added to the finishReasonMessages mapping in useGeminiStream.ts have no corresponding entries in the testCases array of useGeminiStream.test.tsx (~line 3910). Consider adding test cases for these new values (and the pre-existing IMAGE_PROHIBITED_CONTENT / NO_IMAGE which are also untested).
— qwen3.7-max via Qwen Code /review
| [FinishReason.NO_IMAGE]: 'Response stopped due to no image.', | ||
| [FinishReason.IMAGE_RECITATION]: | ||
| 'Response stopped due to image recitation policy.', | ||
| [FinishReason.IMAGE_OTHER]: |
There was a problem hiding this comment.
[Suggestion] The IMAGE_OTHER message says "other image safety reasons" but the SDK defines IMAGE_OTHER as "Image generation stopped for a reason not otherwise specified" — not necessarily safety-related. Consider rewording:
| [FinishReason.IMAGE_OTHER]: | |
| [FinishReason.IMAGE_OTHER]: | |
| 'Response stopped due to other image-related reasons.', |
— qwen3.7-max via Qwen Code /review
| "dependencies": { | ||
| "@anthropic-ai/sdk": "^0.36.1", | ||
| "@google/genai": "1.30.0", | ||
| "@google/genai": "2.6.0", |
There was a problem hiding this comment.
[Suggestion] @google/genai@2.6.0 declares @modelcontextprotocol/sdk@^1.25.2 as an optional peer dependency, but the lockfile resolves 1.25.1 which does not satisfy ^1.25.2. Since the peer dep is optional, npm install won't warn — but mcpToTool() (used in packages/core/src/tools/mcp-client.ts) may run against a version the SDK wasn't tested with. Consider bumping @modelcontextprotocol/sdk to ^1.25.2.
— qwen3.7-max via Qwen Code /review
…nish reason handling - bump @modelcontextprotocol/sdk from ^1.25.1 to ^1.25.2 in all 4 packages - fix IMAGE_OTHER message to accurately describe non-safety reasons - add test coverage for IMAGE_RECITATION, IMAGE_OTHER, IMAGE_PROHIBITED_CONTENT, NO_IMAGE - map RECITATION, IMAGE_SAFETY, IMAGE_RECITATION, IMAGE_PROHIBITED_CONTENT, IMAGE_OTHER, NO_IMAGE to content_filter in mapGeminiFinishReasonToOpenAI - remove dead RECITATION fallback code
| case FinishReason.MAX_TOKENS: | ||
| return 'length'; | ||
| case FinishReason.SAFETY: | ||
| case FinishReason.RECITATION: |
There was a problem hiding this comment.
[Suggestion] The 6 new switch cases (RECITATION, IMAGE_SAFETY, IMAGE_RECITATION, IMAGE_PROHIBITED_CONTENT, IMAGE_OTHER, NO_IMAGE) in mapGeminiFinishReasonToOpenAI have no test coverage in converter.test.ts. The coverage added in useGeminiStream.test.tsx tests the display messages (a separate code path), not the finish_reason mapping. A regression that changes one of these mappings would not be caught.
Consider adding a parameterized test:
it.each([
[FinishReason.RECITATION, 'content_filter'],
[FinishReason.IMAGE_SAFETY, 'content_filter'],
[FinishReason.IMAGE_RECITATION, 'content_filter'],
[FinishReason.IMAGE_PROHIBITED_CONTENT, 'content_filter'],
[FinishReason.IMAGE_OTHER, 'content_filter'],
[FinishReason.NO_IMAGE, 'content_filter'],
])('maps %s to %s', (reason, expected) => {
// test via convertGeminiResponseToOpenAI or export mapGeminiFinishReasonToOpenAI
});— qwen3.7-max via Qwen Code /review
…rter; add BLOCKLIST/PROHIBITED_CONTENT/SPII finish reasons
wenshao
left a comment
There was a problem hiding this comment.
No review findings. Previous R4 Critical issues (TS2352 cast + eslint type-import) are resolved. tsc clean, eslint clean, 216 tests pass. — qwen3.7-max via Qwen Code /review
tanzhenxin
left a comment
There was a problem hiding this comment.
Approving — merging after an end-to-end smoke test of the 1.x→2.x bump, to cover what CI's compile-time checks can't.
Smoke test summary
Built and bundled the branch with @google/genai@2.6.0 actually installed, then made real model calls through the OpenAI-compatible path (where the new finish-reason conversion and the 2.6.0 types run at runtime):
- ✅ Build + esbuild bundle both succeed against 2.6.0
- ✅ Text generation —
finish_reason=stophandled, correct response, token usage accounted - ✅ Structured side-query (auto-memory recall) and subagent calls run clean
- ✅ Tool-calling round-trip —
tool_callsparsed, tool executed, multi-turn loop completes
Both runs exit cleanly with no runtime errors.
Scope notes (non-blocking): this PR also bundles @modelcontextprotocol/sdk 1.25.1→1.25.2 and @types/react/-dom ^18→^19 (web-templates devDeps) — the squash commit records all three so history stays honest. The native Gemini (Google AI / Vertex) path wasn't exercised here; the only change touching it is the streaming finish-reason display strings. The new content_filter mappings are covered by this PR's unit tests.
Thanks @InfiniteUselessness!
Summary
@google/genaidependency to a newer version (2.6.0).Validation
Commands run:
Observed result:
npm-preflight.txt