Skip to content
Source
Sign inSign up
TanStack/ai

fix(scripts): retain web_fetch in OpenRouter tool-capability codegen #657

MergedAlemTuzlakmerged 1 commit intomain fromrefs/pull/657/headmerged by AlemTuzlak View on GitHub

AlemTuzlakcommented

Problem

generateChatToolCapabilitiesType() in scripts/convert-openrouter-models.ts emitted only readonly ['web_search'] for the OpenRouterChatModelToolCapabilitiesByName mapped type. The committed packages/ai-openrouter/src/model-meta.ts correctly declares readonly ['web_search', 'web_fetch'], so the next regeneration of the model meta would have silently dropped web_fetch from every chat model's tool capabilities.

Both web_search and web_fetch are real OpenRouter gateway tools available across all chat models (see packages/ai-openrouter/src/tools/web-search-tool.ts and web-fetch-tool.ts).

Fix

  • Emit readonly ['web_search', 'web_fetch'] from the codegen so regenerating model-meta.ts matches the committed source.
  • Update the doc comment to mention both plugins.

Notes

Script-only change — no published package output changes (the committed model-meta.ts already has the correct value), so no changeset is needed.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Chat models now support expanded tool capabilities, including both web search and web fetch functionalities.

Review Change Stack

    1. 🚀 Changeset Version Preview

      8 package(s) bumped directly, 22 bumped as dependents.

      🟥 Major bumps

      PackageVersionReason
      @tanstack/ai-openrouter0.9.8 → 1.0.0Changeset
      @tanstack/ai-preact0.6.35 → 1.0.0Changeset
      @tanstack/ai-react0.12.1 → 1.0.0Changeset
      @tanstack/ai-solid0.10.10 → 1.0.0Changeset
      @tanstack/ai-svelte0.10.10 → 1.0.0Changeset
      @tanstack/ai-vue0.10.11 → 1.0.0Changeset
      @tanstack/ai-anthropic0.11.0 → 1.0.0Dependent
      @tanstack/ai-code-mode0.1.22 → 1.0.0Dependent
      @tanstack/ai-code-mode-skills0.1.22 → 1.0.0Dependent
      @tanstack/ai-elevenlabs0.2.13 → 1.0.0Dependent
      @tanstack/ai-event-client0.4.0 → 1.0.0Dependent
      @tanstack/ai-fal0.7.15 → 1.0.0Dependent
      @tanstack/ai-gemini0.12.0 → 1.0.0Dependent
      @tanstack/ai-grok0.9.0 → 1.0.0Dependent
      @tanstack/ai-groq0.2.7 → 1.0.0Dependent
      @tanstack/ai-isolate-node0.1.22 → 1.0.0Dependent
      @tanstack/ai-isolate-quickjs0.1.22 → 1.0.0Dependent
      @tanstack/ai-ollama0.6.22 → 1.0.0Dependent
      @tanstack/ai-openai0.10.3 → 1.0.0Dependent
      @tanstack/ai-react-ui0.8.3 → 1.0.0Dependent
      @tanstack/ai-solid-ui0.7.3 → 1.0.0Dependent
      @tanstack/openai-base0.4.0 → 1.0.0Dependent

      🟨 Minor bumps

      PackageVersionReason
      @tanstack/ai0.22.1 → 0.23.0Changeset
      @tanstack/ai-client0.13.0 → 0.14.0Changeset

      🟩 Patch bumps

      PackageVersionReason
      @tanstack/ai-devtools-core0.4.0 → 0.4.1Dependent
      @tanstack/ai-isolate-cloudflare0.2.13 → 0.2.14Dependent
      @tanstack/ai-vue-ui0.2.6 → 0.2.7Dependent
      @tanstack/preact-ai-devtools0.1.43 → 0.1.44Dependent
      @tanstack/react-ai-devtools0.2.43 → 0.2.44Dependent
      @tanstack/solid-ai-devtools0.2.43 → 0.2.44Dependent
    2. View your CI Pipeline Execution ↗ for commit f4c304dbc7dc62aa416fb72fd917f5e92efdd43e

      CommandStatusDurationResult
      nx run-many --targets=build --exclude=examples/...✅ Succeeded1sView ↗

      ☁️ Nx Cloud last updated this comment at 2026-05-29 14:42:14 UTC

    3. Open in StackBlitz

      @tanstack/ai

      npm i https://pkg.pr.new/@tanstack/ai@657

      @tanstack/ai-anthropic

      npm i https://pkg.pr.new/@tanstack/ai-anthropic@657

      @tanstack/ai-client

      npm i https://pkg.pr.new/@tanstack/ai-client@657

      @tanstack/ai-code-mode

      npm i https://pkg.pr.new/@tanstack/ai-code-mode@657

      @tanstack/ai-code-mode-skills

      npm i https://pkg.pr.new/@tanstack/ai-code-mode-skills@657

      @tanstack/ai-devtools-core

      npm i https://pkg.pr.new/@tanstack/ai-devtools-core@657

      @tanstack/ai-elevenlabs

      npm i https://pkg.pr.new/@tanstack/ai-elevenlabs@657

      @tanstack/ai-event-client

      npm i https://pkg.pr.new/@tanstack/ai-event-client@657

      @tanstack/ai-fal

      npm i https://pkg.pr.new/@tanstack/ai-fal@657

      @tanstack/ai-gemini

      npm i https://pkg.pr.new/@tanstack/ai-gemini@657

      @tanstack/ai-grok

      npm i https://pkg.pr.new/@tanstack/ai-grok@657

      @tanstack/ai-groq

      npm i https://pkg.pr.new/@tanstack/ai-groq@657

      @tanstack/ai-isolate-cloudflare

      npm i https://pkg.pr.new/@tanstack/ai-isolate-cloudflare@657

      @tanstack/ai-isolate-node

      npm i https://pkg.pr.new/@tanstack/ai-isolate-node@657

      @tanstack/ai-isolate-quickjs

      npm i https://pkg.pr.new/@tanstack/ai-isolate-quickjs@657

      @tanstack/ai-ollama

      npm i https://pkg.pr.new/@tanstack/ai-ollama@657

      @tanstack/ai-openai

      npm i https://pkg.pr.new/@tanstack/ai-openai@657

      @tanstack/ai-openrouter

      npm i https://pkg.pr.new/@tanstack/ai-openrouter@657

      @tanstack/ai-preact

      npm i https://pkg.pr.new/@tanstack/ai-preact@657

      @tanstack/ai-react

      npm i https://pkg.pr.new/@tanstack/ai-react@657

      @tanstack/ai-react-ui

      npm i https://pkg.pr.new/@tanstack/ai-react-ui@657

      @tanstack/ai-solid

      npm i https://pkg.pr.new/@tanstack/ai-solid@657

      @tanstack/ai-solid-ui

      npm i https://pkg.pr.new/@tanstack/ai-solid-ui@657

      @tanstack/ai-svelte

      npm i https://pkg.pr.new/@tanstack/ai-svelte@657

      @tanstack/ai-utils

      npm i https://pkg.pr.new/@tanstack/ai-utils@657

      @tanstack/ai-vue

      npm i https://pkg.pr.new/@tanstack/ai-vue@657

      @tanstack/ai-vue-ui

      npm i https://pkg.pr.new/@tanstack/ai-vue-ui@657

      @tanstack/openai-base

      npm i https://pkg.pr.new/@tanstack/openai-base@657

      @tanstack/preact-ai-devtools

      npm i https://pkg.pr.new/@tanstack/preact-ai-devtools@657

      @tanstack/react-ai-devtools

      npm i https://pkg.pr.new/@tanstack/react-ai-devtools@657

      @tanstack/solid-ai-devtools

      npm i https://pkg.pr.new/@tanstack/solid-ai-devtools@657

      commit: f4c304d

    4. No actionable comments were generated in the recent review. 🎉

      ℹ️ Recent review info
      ⚙️ Run configuration

      Configuration used: defaults

      Review profile: CHILL

      Plan: Pro

      Run ID: d3aa96db-ad3e-4948-9d6d-770ac4119db6

      📥 Commits

      Reviewing files that changed from the base of the PR and between 980ff9ba925f5dbae62a9318cc1e787d0ae24314 and f4c304dbc7dc62aa416fb72fd917f5e92efdd43e.

      📒 Files selected for processing (1)
      • scripts/convert-openrouter-models.ts

      📝 Walkthrough

      Walkthrough

      The pull request updates a TypeScript code generation script to extend OpenRouter chat model tool capabilities. The generateChatToolCapabilitiesType() function now emits type definitions annotating each chat model with both web_search and web_fetch tool capabilities instead of web_search alone.

      Changes

      OpenRouter Tool Capabilities Expansion

      Layer / File(s)Summary
      Extend chat tool capabilities type
      scripts/convert-openrouter-models.ts
      The OpenRouterChatModelToolCapabilitiesByName mapped type is updated to extend the tool-capability tuple from readonly ['web_search'] to readonly ['web_search', 'web_fetch'] for each chat model.

      Estimated code review effort

      🎯 1 (Trivial) | ⏱️ ~3 minutes

      • TanStack/ai#582: Both PRs modify the same OpenRouter tool capabilities type; #582 restored the web_search tuple while this PR extends it to include web_fetch.

      Suggested reviewers

      • crutchcorn
      • KevinVandy

      Poem

      🐰 A script did whisper, "More tools for the chat! Web search was lonely, so now web fetch's at bat, Two capabilities dance in the tuple so tight, OpenRouter's models now see more light." ✨

      🚥 Pre-merge checks | ✅ 3 | ❌ 2

      ❌ Failed checks (2 warnings)

      Check nameStatusExplanationResolution
      Description check⚠️ WarningThe description provides clear problem statement, fix details, and implementation notes, but lacks checklist items required by the repository template.Complete the checklist items in the description to confirm testing and changeset requirements have been addressed.
      Docstring Coverage⚠️ WarningDocstring coverage is 33.33% which is insufficient. The required threshold is 80.00%.Write docstrings for the functions missing them to satisfy the coverage threshold.
      ✅ Passed checks (3 passed)
      Check nameStatusExplanation
      Title check✅ PassedThe title clearly and specifically identifies the fix: retaining web_fetch in OpenRouter's tool-capability code generation.
      Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
      ✏️ Tip: You can configure your own custom pre-merge checks in the settings.
      ✨ 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/openrouter-model-gen-web-fetch`

      Warning

      There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

      🔧 ESLint

      If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

      ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.


      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.

      ❤️ Share
      Comment `@coderabbitai help` to get the list of available commands and usage tips.
    5. crutchcorn(GitHub profile, opens in a new tab) approved these changes

    6. AlemTuzlak merged this50c0c61

    7. AlemTuzlak closed this

Sign in to join this conversation.