blog: type-safe provider tools in TanStack AI#847
blog: type-safe provider tools in TanStack AI#847tannerlinsley merged 2 commits intoTanStack:mainfrom
Conversation
Adds a blog post introducing per-model compile-time type safety for provider tools, announcing the new /tools subpath on every adapter and the phantom-branded ProviderTool type that gates incompatible model + tool pairings at compile time.
👷 Deploy request for tanstack pending review.Visit the deploys page to approve it
|
📝 WalkthroughWalkthroughA new blog post has been added documenting TanStack AI type safety improvements. The article explains how provider tool factories now return phantom-branded types and adapters carry per-model tool capability information, preventing provider-tool/model mismatches at compile time. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/blog/type-safe-provider-tools-tanstack-ai.md (1)
134-134: Consider hyphenating compound modifier (minor style)."per-model type gating" could be hyphenated as "per-model type-gating" to follow compound modifier conventions, though the current phrasing is clear and aligns with the informal tone used throughout the post.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/blog/type-safe-provider-tools-tanstack-ai.md` at line 134, Summary: Hyphenate the compound modifier "per-model type gating" to "per-model type-gating" in the sentence beginning "The tradeoff of the native approach is obvious..." to follow compound modifier conventions; locate that sentence and replace the phrase "per-model type gating" with "per-model type-gating" so the compound modifier is correctly hyphenated while preserving the existing tone and punctuation.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/blog/type-safe-provider-tools-tanstack-ai.md`:
- Around line 23-31: Update the outdated model identifiers in the table: replace
`claude-3-haiku` and `claude-3-5-haiku` with `claude-haiku-4.5`, change
`claude-opus-4-6` to `claude-opus-4.7`, replace `gpt-3.5-turbo` with the current
GPT lineup entries (`gpt-5.4`, `gpt-5.4-mini`, `gpt-5.4-nano`) (you can list
them as separate rows or comma-separated under the Model column), and change
`gemini-3-pro` to `gemini-3.1-pro` and `gemini-lite` to `gemini-3.1-flash-lite`;
keep the Provider tools supported column values unchanged for each corresponding
model entry so the tool support matrix remains accurate.
---
Nitpick comments:
In `@src/blog/type-safe-provider-tools-tanstack-ai.md`:
- Line 134: Summary: Hyphenate the compound modifier "per-model type gating" to
"per-model type-gating" in the sentence beginning "The tradeoff of the native
approach is obvious..." to follow compound modifier conventions; locate that
sentence and replace the phrase "per-model type gating" with "per-model
type-gating" so the compound modifier is correctly hyphenated while preserving
the existing tone and punctuation.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 854f106a-5c6e-484c-aa1d-86a922f92a93
⛔ Files ignored due to path filters (1)
public/blog-assets/type-safe-provider-tools-tanstack-ai/header.pngis excluded by!**/*.png
📒 Files selected for processing (1)
src/blog/type-safe-provider-tools-tanstack-ai.md
| | Model | Provider tools supported | | ||
| | ------------------ | ----------------------------------------------------------------------- | | ||
| | `claude-3-haiku` | `web_search` only | | ||
| | `claude-3-5-haiku` | web tools only (`web_search`, `web_fetch`) | | ||
| | `claude-opus-4-6` | full superset (web, code execution, computer use, bash, editor, memory) | | ||
| | `gpt-3.5-turbo` | none | | ||
| | `gpt-5` family | full superset | | ||
| | `gemini-3-pro` | full superset | | ||
| | `gemini-lite` | narrower subset | |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
What are the current Claude, GPT, and Gemini model names available as of April 2026, and which provider tools (web search, code interpreter, computer use) does each support?
💡 Result:
As of April 2026: Claude (Anthropic): - Current models: Claude Opus 4.7 (most capable), Claude Sonnet 4.6, Claude Haiku 4.5 (primary generally available); older like Opus 4.6, Sonnet 4.5 still available but migrate recommended. - Provider tools: Web search (yes, with dynamic filtering on newer versions), Code interpreter/execution (yes, code_execution tool), Computer use (yes, computer tool available in beta). GPT (OpenAI): - Current models: GPT-5.4 (flagship), GPT-5.4-mini, GPT-5.4-nano (frontier); GPT-5.4 Pro for max performance. - Provider tools: Web search (yes, improved agentic web search), Code interpreter (yes, via Codex and API), Computer use (yes, native state-of-the-art computer-use capabilities). Gemini (Google): - Current models: Gemini 3.1 Pro (latest for complex tasks), Gemini 3.1 Flash-Lite (fastest). - Provider tools: Web search (yes, Grounding with Google Search), Code interpreter (yes, code execution tool with Python), Computer use (not explicitly confirmed in sources; strong agentic/coding support but no direct computer use tool mentioned).
Citations:
- 1: https://platform.claude.com/docs/en/about-claude/models/overview
- 2: https://docs.anthropic.com/en/docs/about-claude/models
- 3: https://docs.anthropic.com/en/docs/about-claude/models/all-models
- 4: https://developers.openai.com/api/docs/models
- 5: https://docs.claude.com/en/docs/agents-and-tools/tool-use/web-search-tool
- 6: https://platform.claude.com/docs/en/agents-and-tools/tool-use/web-search-tool
- 7: https://platform.claude.com/docs/en/agents-and-tools/tool-use/tool-reference
- 8: http://openai.com/index/introducing-gpt-5-4/
- 9: https://openai.com/index/introducing-gpt-5-4/
- 10: http://openai.com/index/introducing-gpt-5-3-codex/
- 11: https://blog.google/innovation-and-ai/models-and-research/gemini-models/gemini-3-1-pro
- 12: https://ai.google.dev/gemini-api/docs/code-execution
- 13: https://blog.google/innovation-and-ai/technology/developers-tools/gemini-api-tooling-updates/
Update model names and versions to match current provider documentation.
The table contains outdated or incorrect model identifiers that no longer align with current offerings as of April 2026:
claude-3-haikuandclaude-3-5-haikushould beclaude-haiku-4.5claude-opus-4-6should be updated toclaude-opus-4.7(current flagship; 4.6 may still be available but migration is recommended)gpt-3.5-turbois significantly outdated; current models aregpt-5.4,gpt-5.4-mini, andgpt-5.4-nanogemini-3-proshould begemini-3.1-pro;gemini-liteshould begemini-3.1-flash-lite
The tool support matrix itself is accurate, but using stale model names undermines the technical credibility of the post, especially for a blog published in April 2026.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/blog/type-safe-provider-tools-tanstack-ai.md` around lines 23 - 31,
Update the outdated model identifiers in the table: replace `claude-3-haiku` and
`claude-3-5-haiku` with `claude-haiku-4.5`, change `claude-opus-4-6` to
`claude-opus-4.7`, replace `gpt-3.5-turbo` with the current GPT lineup entries
(`gpt-5.4`, `gpt-5.4-mini`, `gpt-5.4-nano`) (you can list them as separate rows
or comma-separated under the Model column), and change `gemini-3-pro` to
`gemini-3.1-pro` and `gemini-lite` to `gemini-3.1-flash-lite`; keep the Provider
tools supported column values unchanged for each corresponding model entry so
the tool support matrix remains accurate.
Summary
New blog post announcing per-model compile-time type safety for provider tools in TanStack AI, plus the new
/toolssubpath on every adapter.ProviderTool<TProvider, TKind>phantom-branded subtype that gatestools: [...]at the type leveltoolDefinition/customToolescape hatch that stays universally assignable/toolssubpath on every adapter for tree-shakeable importsAdds:
src/blog/type-safe-provider-tools-tanstack-ai.mdpublic/blog-assets/type-safe-provider-tools-tanstack-ai/header.pngTest plan
/ai/latest/docs/tools/provider-toolsresolves once the docs page is deployedSummary by CodeRabbit
/toolssubpath for importing provider tools from TanStack AI provider packages.