Skip to content

fix(ai): infer provider options for media activities - #858

Merged
tombeckenham merged 1 commit into
TanStack:mainfrom
AdemBenAbdallah:fix/provider-options-extraction-593
Aug 10, 2026
Merged

fix(ai): infer provider options for media activities#858
tombeckenham merged 1 commit into
TanStack:mainfrom
AdemBenAbdallah:fix/provider-options-extraction-593

Conversation

@AdemBenAbdallah

@AdemBenAbdallah AdemBenAbdallah commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Fixes #593.

Summary

  • Use structural ~types.providerOptions inference for TTS, transcription, and summarize provider options.
  • Keep summarize's public adapter constraint broad enough to support runtime-selected adapter unions, while still deriving modelOptions from the selected adapter's ~types metadata.
  • Add a patch changeset for @tanstack/ai.

Validation

  • pnpm --filter @tanstack/ai test:types
  • pnpm --filter @tanstack/ai test:build
  • pnpm test:sherif
  • pnpm test:knip
  • pnpm test:kiira

Release impact

  • Patch changeset included for @tanstack/ai.

Summary by CodeRabbit

  • Bug Fixes
    • Improved provider-specific providerOptions inference for speech, transcription, and summarization based on adapter-provided type metadata.
    • Updated exported provider option types to more accurately reflect adapter configuration, improving compatibility for consumer code.
  • Chores
    • Marked this release for @tanstack/ai as a patch update.

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@tombeckenham, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 49 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 64151ed8-2ef6-4e3a-a944-c4d7a86b1138

📥 Commits

Reviewing files that changed from the base of the PR and between 888e8b7 and 0ca690b.

📒 Files selected for processing (4)
  • .changeset/soft-falcons-summarize.md
  • packages/ai/src/activities/generateSpeech/index.ts
  • packages/ai/src/activities/generateTranscription/index.ts
  • packages/ai/src/activities/summarize/index.ts
📝 Walkthrough

Walkthrough

This PR updates provider-options inference for TTS, transcription, and summarize activities to derive providerOptions from adapter ~types metadata. Summarize also updates its related type assertions. A changeset records the patch release.

Changes

Provider-options inference fix

Layer / File(s) Summary
Speech and transcription helpers
.changeset/soft-falcons-summarize.md, packages/ai/src/activities/generateSpeech/index.ts, packages/ai/src/activities/generateTranscription/index.ts
TTSProviderOptions and TranscriptionProviderOptions now infer providerOptions from adapter ~types metadata with structural conditionals, and the changeset notes the patch release.
Summarize typing
packages/ai/src/activities/summarize/index.ts
SummarizeProviderOptions now infers providerOptions from adapter metadata, and the summarize branches update their type assertions to use SummarizeActivityOptions<TAdapter, true/false>.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • TanStack/ai#854: Also changes summarize() adapter typing, so it touches the same SummarizeProviderOptions path.

Suggested reviewers

  • AlemTuzlak

Poem

A rabbit hopped through type-safe grass,
and brand-based options now can pass.
TTS hums, transcription sings,
summarize keeps its tidy wings. 🐇

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is clear, but it doesn't follow the required template sections or checklist items from the repository. Rewrite it to match the template: add 🎯 Changes, ✅ Checklist, and 🚀 Release Impact sections with the required checkboxes.
Linked Issues check ⚠️ Warning TTS and transcription match the issue, but summarize's F-bounded SummarizeAdapter<string, ...> constraint appears unaddressed. Update summarize's public constraints to extends SummarizeAdapter<string, SummarizeProviderOptions<TAdapter>> at all affected signatures.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: inferring provider options for media activities.
Out of Scope Changes check ✅ Passed The changes stay within the requested provider-option inference fix and the required changeset update.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@tombeckenham

Copy link
Copy Markdown
Contributor

Niice. There's a couple of PRs to merge before this, but thanks

@nx-cloud

nx-cloud Bot commented Jun 26, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 0ca690b

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

☁️ Nx Cloud last updated this comment at 2026-08-10 09:40:34 UTC

@pkg-pr-new

pkg-pr-new Bot commented Jun 26, 2026

Copy link
Copy Markdown

Open in StackBlitz

@tanstack/ai

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

@tanstack/ai-acp

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-acp@858

@tanstack/ai-angular

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-angular@858

@tanstack/ai-anthropic

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

@tanstack/ai-bedrock

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-bedrock@858

@tanstack/ai-byteplus

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-byteplus@858

@tanstack/ai-claude-code

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-claude-code@858

@tanstack/ai-client

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

@tanstack/ai-code-mode

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

@tanstack/ai-code-mode-skills

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

@tanstack/ai-codex

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-codex@858

@tanstack/ai-devtools-core

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

@tanstack/ai-durable-stream

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-durable-stream@858

@tanstack/ai-elevenlabs

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

@tanstack/ai-event-client

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

@tanstack/ai-fal

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

@tanstack/ai-gemini

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

@tanstack/ai-grok

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

@tanstack/ai-grok-build

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-grok-build@858

@tanstack/ai-groq

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

@tanstack/ai-isolate-cloudflare

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

@tanstack/ai-isolate-daytona

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-isolate-daytona@858

@tanstack/ai-isolate-node

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

@tanstack/ai-isolate-quickjs

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

@tanstack/ai-isolate-quickjs-bun

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-isolate-quickjs-bun@858

@tanstack/ai-mcp

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-mcp@858

@tanstack/ai-memory

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-memory@858

@tanstack/ai-mistral

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-mistral@858

@tanstack/ai-ollama

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

@tanstack/ai-openai

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

@tanstack/ai-opencode

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-opencode@858

@tanstack/ai-openrouter

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

@tanstack/ai-persistence

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-persistence@858

@tanstack/ai-preact

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

@tanstack/ai-react

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

@tanstack/ai-react-ui

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

@tanstack/ai-sandbox

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-sandbox@858

@tanstack/ai-sandbox-cloudflare

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-sandbox-cloudflare@858

@tanstack/ai-sandbox-daytona

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-sandbox-daytona@858

@tanstack/ai-sandbox-docker

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-sandbox-docker@858

@tanstack/ai-sandbox-local-process

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-sandbox-local-process@858

@tanstack/ai-sandbox-sprites

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-sandbox-sprites@858

@tanstack/ai-sandbox-vercel

npm i https://pkg.pr.new/TanStack/ai/@tanstack/ai-sandbox-vercel@858

@tanstack/ai-solid

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

@tanstack/ai-solid-ui

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

@tanstack/ai-svelte

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

@tanstack/ai-utils

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

@tanstack/ai-vue

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

@tanstack/ai-vue-ui

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

@tanstack/openai-base

npm i https://pkg.pr.new/TanStack/ai/@tanstack/openai-base@858

@tanstack/preact-ai-devtools

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

@tanstack/react-ai-devtools

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

@tanstack/solid-ai-devtools

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

commit: 0ca690b

@AdemBenAbdallah
AdemBenAbdallah force-pushed the fix/provider-options-extraction-593 branch 2 times, most recently from 4154021 to 563cbf0 Compare June 27, 2026 11:03
@tombeckenham
tombeckenham force-pushed the fix/provider-options-extraction-593 branch from 563cbf0 to 0ca690b Compare August 10, 2026 09:16
@tombeckenham

Copy link
Copy Markdown
Contributor

Maintainer sweep: rebased onto main (force-with-lease). CI approval handled if it was waiting.

@tombeckenham tombeckenham self-assigned this Aug 10, 2026
@tombeckenham
tombeckenham self-requested a review August 10, 2026 10:22
@tombeckenham
tombeckenham merged commit 7aa4ae9 into TanStack:main Aug 10, 2026
9 checks passed
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.

Apply audio's brand-based provider-options extraction to TTS, Transcription, Summarize

2 participants