fix(ai-gemini): resolve GeminiClientConfig from concrete module in adapter types #919
main fromrefs/pull/919/head·merged by tombeckenham View on GitHubProblem#
The built .d.ts files for the Gemini adapters import GeminiClientConfig from '../utils.js', but the utils barrel builds to utils/index.js — no utils.js file exists. Under a consumer's skipLibCheck this import silently resolves GeminiClientConfig to any, which:
- disables client-config type-checking for every Gemini adapter (the inherited
GoogleGenAIOptionsfields —httpOptions,apiVersion,vertexai, … — vanish from the public types), and - for the one config with an own member (
GeminiVideoConfig.allowUrlFetch), the collapsedOmitbecomes a non-empty weak type, surfacing a spurious`httpOptions` does not existexcess-property error at call sites.
This is what caused @tanstack/ai-e2e:test:types to fail after #820 enabled type-checking of testing/**.
Fix#
Import the client utilities from the concrete '../utils/client' module (matching the ai-openai convention) so the emitted declarations point at a file that actually exists and resolve to the real type. Gemini config options are fully typed for consumers again.
Verification#
nx run-many --targets=test:types,test:eslint,test:lib,test:build,build --projects=@tanstack/ai-gemini— all green- Confirmed the emitted
.d.tsnow imports'../utils/client.js'and thathttpOptions(and the otherGoogleGenAIOptionsfields) are genuine, type-checked keys on the Gemini configs.
Once merged, the test/gemini-tts-e2e branch (#—, harshlocham's Gemini TTS matrix PR) will be rebased to pick this up.
🤖 Generated with Claude Code
Summary by CodeRabbit#
- Bug Fixes
- Corrected type resolution for Gemini adapter configurations, improving TypeScript accuracy for consumers.
- Prevented missing-type and
anyfallback issues that could affect editor feedback and type-checking. - Fixed a declaration issue that could cause incorrect errors when using video generation features.
- 1
View your CI Pipeline Execution ↗ for commit 7868e45f9745789b05de607692bc9099d5f4914c
Command Status Duration Result nx run-many --targets=build --exclude=examples/...✅ Succeeded 1s View ↗
☁️ Nx Cloud last updated this comment at
2026-07-09 02:08:55UTCNo actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID:
934d10ee-8846-4d02-a806-b7f415cdc7f0📥 Commits
Reviewing files that changed from the base of the PR and between f2ded503fcf6c3152d2f5eca0194a8548cd0a9bd and 7868e45f9745789b05de607692bc9099d5f4914c.
📒 Files selected for processing (7)
.changeset/gemini-client-config-dts-import.mdpackages/ai-gemini/src/adapters/audio.tspackages/ai-gemini/src/adapters/image.tspackages/ai-gemini/src/adapters/summarize.tspackages/ai-gemini/src/adapters/text.tspackages/ai-gemini/src/adapters/tts.tspackages/ai-gemini/src/adapters/video.ts
📝 Walkthrough
Walkthrough#
The
GeminiClientConfigtype import is corrected across six adapter files in@tanstack/ai-gemini, switching from the non-resolvable../utilspath to the concrete../utils/clientmodule. A changeset documents this patch fix.Changes#
GeminiClientConfig Import Fix
Layer / File(s) Summary Corrected type import source
packages/ai-gemini/src/adapters/audio.ts,packages/ai-gemini/src/adapters/image.ts,packages/ai-gemini/src/adapters/summarize.ts,packages/ai-gemini/src/adapters/text.ts,packages/ai-gemini/src/adapters/tts.ts,packages/ai-gemini/src/adapters/video.ts,.changeset/gemini-client-config-dts-import.mdEach adapter's type-only import of GeminiClientConfigis redirected from../utilsto../utils/client; a changeset records the patch-level fix.Estimated code review effort: 1 (Trivial) | ~3 minutes
Suggested reviewers:
AlemTuzlak🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)#
Check name Status Explanation Resolution Description check ⚠️ Warning The description is informative, but it does not follow the required template sections for Changes, Checklist, and Release Impact. Reformat the PR description to include the template sections: ## 🎯 Changes, ## ✅ Checklist, and ## 🚀 Release Impact, with the required checklist items. ✅ Passed checks (4 passed)
Check name Status Explanation Title check ✅ Passed The title is concise and accurately summarizes the main fix to GeminiClientConfig imports in ai-gemini adapters. Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request. Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request. ✨ Finishing Touches
📝 Generate docstrings
- Create stacked PR
- Commit on current branch
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Commit unit tests in branch `fix/gemini-client-config-dts-import`
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 `@coderabbitai help` to get the list of available commands.@tanstack/ai
npm i https://pkg.pr.new/@tanstack/ai@919@tanstack/ai-acp
npm i https://pkg.pr.new/@tanstack/ai-acp@919@tanstack/ai-angular
npm i https://pkg.pr.new/@tanstack/ai-angular@919@tanstack/ai-anthropic
npm i https://pkg.pr.new/@tanstack/ai-anthropic@919@tanstack/ai-bedrock
npm i https://pkg.pr.new/@tanstack/ai-bedrock@919@tanstack/ai-claude-code
npm i https://pkg.pr.new/@tanstack/ai-claude-code@919@tanstack/ai-client
npm i https://pkg.pr.new/@tanstack/ai-client@919@tanstack/ai-code-mode
npm i https://pkg.pr.new/@tanstack/ai-code-mode@919@tanstack/ai-code-mode-skills
npm i https://pkg.pr.new/@tanstack/ai-code-mode-skills@919@tanstack/ai-codex
npm i https://pkg.pr.new/@tanstack/ai-codex@919@tanstack/ai-devtools-core
npm i https://pkg.pr.new/@tanstack/ai-devtools-core@919@tanstack/ai-elevenlabs
npm i https://pkg.pr.new/@tanstack/ai-elevenlabs@919@tanstack/ai-event-client
npm i https://pkg.pr.new/@tanstack/ai-event-client@919@tanstack/ai-fal
npm i https://pkg.pr.new/@tanstack/ai-fal@919@tanstack/ai-gemini
npm i https://pkg.pr.new/@tanstack/ai-gemini@919@tanstack/ai-grok
npm i https://pkg.pr.new/@tanstack/ai-grok@919@tanstack/ai-grok-build
npm i https://pkg.pr.new/@tanstack/ai-grok-build@919@tanstack/ai-groq
npm i https://pkg.pr.new/@tanstack/ai-groq@919@tanstack/ai-isolate-cloudflare
npm i https://pkg.pr.new/@tanstack/ai-isolate-cloudflare@919@tanstack/ai-isolate-node
npm i https://pkg.pr.new/@tanstack/ai-isolate-node@919@tanstack/ai-isolate-quickjs
npm i https://pkg.pr.new/@tanstack/ai-isolate-quickjs@919@tanstack/ai-mcp
npm i https://pkg.pr.new/@tanstack/ai-mcp@919@tanstack/ai-mistral
npm i https://pkg.pr.new/@tanstack/ai-mistral@919@tanstack/ai-ollama
npm i https://pkg.pr.new/@tanstack/ai-ollama@919@tanstack/ai-openai
npm i https://pkg.pr.new/@tanstack/ai-openai@919@tanstack/ai-opencode
npm i https://pkg.pr.new/@tanstack/ai-opencode@919@tanstack/ai-openrouter
npm i https://pkg.pr.new/@tanstack/ai-openrouter@919@tanstack/ai-preact
npm i https://pkg.pr.new/@tanstack/ai-preact@919@tanstack/ai-react
npm i https://pkg.pr.new/@tanstack/ai-react@919@tanstack/ai-react-ui
npm i https://pkg.pr.new/@tanstack/ai-react-ui@919@tanstack/ai-sandbox
npm i https://pkg.pr.new/@tanstack/ai-sandbox@919@tanstack/ai-sandbox-cloudflare
npm i https://pkg.pr.new/@tanstack/ai-sandbox-cloudflare@919@tanstack/ai-sandbox-daytona
npm i https://pkg.pr.new/@tanstack/ai-sandbox-daytona@919@tanstack/ai-sandbox-docker
npm i https://pkg.pr.new/@tanstack/ai-sandbox-docker@919@tanstack/ai-sandbox-local-process
npm i https://pkg.pr.new/@tanstack/ai-sandbox-local-process@919@tanstack/ai-sandbox-sprites
npm i https://pkg.pr.new/@tanstack/ai-sandbox-sprites@919@tanstack/ai-sandbox-vercel
npm i https://pkg.pr.new/@tanstack/ai-sandbox-vercel@919@tanstack/ai-solid
npm i https://pkg.pr.new/@tanstack/ai-solid@919@tanstack/ai-solid-ui
npm i https://pkg.pr.new/@tanstack/ai-solid-ui@919@tanstack/ai-svelte
npm i https://pkg.pr.new/@tanstack/ai-svelte@919@tanstack/ai-utils
npm i https://pkg.pr.new/@tanstack/ai-utils@919@tanstack/ai-vue
npm i https://pkg.pr.new/@tanstack/ai-vue@919@tanstack/ai-vue-ui
npm i https://pkg.pr.new/@tanstack/ai-vue-ui@919@tanstack/openai-base
npm i https://pkg.pr.new/@tanstack/openai-base@919@tanstack/preact-ai-devtools
npm i https://pkg.pr.new/@tanstack/preact-ai-devtools@919@tanstack/react-ai-devtools
npm i https://pkg.pr.new/@tanstack/react-ai-devtools@919@tanstack/solid-ai-devtools
npm i https://pkg.pr.new/@tanstack/solid-ai-devtools@919commit:
7868e45This is blocking tests. Merging
tombeckenham merged thisd453647
tombeckenham closed this
Sign in to join this conversation.
🚀 Changeset Version Preview#
2 package(s) bumped directly, 0 bumped as dependents.
🟨 Minor bumps#
@tanstack/ai-gemini@tanstack/ai-openai