Skip to content

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

Merged
AlemTuzlak merged 1 commit into
mainfrom
fix/openrouter-model-gen-web-fetch
May 29, 2026
Merged

fix(scripts): retain web_fetch in OpenRouter tool-capability codegen#657
AlemTuzlak merged 1 commit into
mainfrom
fix/openrouter-model-gen-web-fetch

Conversation

@AlemTuzlak
Copy link
Copy Markdown
Contributor

@AlemTuzlak AlemTuzlak commented May 29, 2026

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

generateChatToolCapabilitiesType emitted readonly ['web_search'] only, so regenerating model-meta.ts dropped web_fetch from every chat model's tool capabilities. Emit both web_search and web_fetch to match the committed model-meta.ts, and update the doc comment accordingly.
@AlemTuzlak AlemTuzlak requested a review from a team as a code owner May 29, 2026 14:41
@github-actions
Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

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

🟥 Major bumps

Package Version Reason
@tanstack/ai-openrouter 0.9.8 → 1.0.0 Changeset
@tanstack/ai-preact 0.6.35 → 1.0.0 Changeset
@tanstack/ai-react 0.12.1 → 1.0.0 Changeset
@tanstack/ai-solid 0.10.10 → 1.0.0 Changeset
@tanstack/ai-svelte 0.10.10 → 1.0.0 Changeset
@tanstack/ai-vue 0.10.11 → 1.0.0 Changeset
@tanstack/ai-anthropic 0.11.0 → 1.0.0 Dependent
@tanstack/ai-code-mode 0.1.22 → 1.0.0 Dependent
@tanstack/ai-code-mode-skills 0.1.22 → 1.0.0 Dependent
@tanstack/ai-elevenlabs 0.2.13 → 1.0.0 Dependent
@tanstack/ai-event-client 0.4.0 → 1.0.0 Dependent
@tanstack/ai-fal 0.7.15 → 1.0.0 Dependent
@tanstack/ai-gemini 0.12.0 → 1.0.0 Dependent
@tanstack/ai-grok 0.9.0 → 1.0.0 Dependent
@tanstack/ai-groq 0.2.7 → 1.0.0 Dependent
@tanstack/ai-isolate-node 0.1.22 → 1.0.0 Dependent
@tanstack/ai-isolate-quickjs 0.1.22 → 1.0.0 Dependent
@tanstack/ai-ollama 0.6.22 → 1.0.0 Dependent
@tanstack/ai-openai 0.10.3 → 1.0.0 Dependent
@tanstack/ai-react-ui 0.8.3 → 1.0.0 Dependent
@tanstack/ai-solid-ui 0.7.3 → 1.0.0 Dependent
@tanstack/openai-base 0.4.0 → 1.0.0 Dependent

🟨 Minor bumps

Package Version Reason
@tanstack/ai 0.22.1 → 0.23.0 Changeset
@tanstack/ai-client 0.13.0 → 0.14.0 Changeset

🟩 Patch bumps

Package Version Reason
@tanstack/ai-devtools-core 0.4.0 → 0.4.1 Dependent
@tanstack/ai-isolate-cloudflare 0.2.13 → 0.2.14 Dependent
@tanstack/ai-vue-ui 0.2.6 → 0.2.7 Dependent
@tanstack/preact-ai-devtools 0.1.43 → 0.1.44 Dependent
@tanstack/react-ai-devtools 0.2.43 → 0.2.44 Dependent
@tanstack/solid-ai-devtools 0.2.43 → 0.2.44 Dependent

@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented May 29, 2026

View your CI Pipeline Execution ↗ for commit f4c304d

Command Status Duration Result
nx run-many --targets=build --exclude=examples/... ✅ Succeeded 1s View ↗

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

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 29, 2026

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 29, 2026

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 980ff9b and f4c304d.

📒 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

Possibly related PRs

  • 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 name Status Explanation Resolution
Description check ⚠️ Warning The 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 ⚠️ Warning Docstring 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 name Status Explanation
Title check ✅ Passed The title clearly and specifically identifies the fix: retaining web_fetch in OpenRouter's tool-capability code generation.
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.

✏️ 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.

@AlemTuzlak AlemTuzlak merged commit 50c0c61 into main May 29, 2026
10 checks passed
@AlemTuzlak AlemTuzlak deleted the fix/openrouter-model-gen-web-fetch branch May 29, 2026 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants