Skip to content

fix(ai): rename providerMetadata -> metadata in makeToolCall test helper#546

Merged
AlemTuzlak merged 1 commit into
mainfrom
fix/ai-test-types-tool-call-metadata-rename
May 11, 2026
Merged

fix(ai): rename providerMetadata -> metadata in makeToolCall test helper#546
AlemTuzlak merged 1 commit into
mainfrom
fix/ai-test-types-tool-call-metadata-rename

Conversation

@AlemTuzlak
Copy link
Copy Markdown
Contributor

@AlemTuzlak AlemTuzlak commented May 11, 2026

Summary

Root cause

In #459 (87f305c), ToolCall.providerMetadata: Record<string, unknown> became ToolCall<TMetadata>.metadata?: TMetadata everywhere except the makeToolCall test helper, whose conditional spread still references the old field name. The helper is typed against the current ToolCall, so tsc rejects it.

Test plan

  • pnpm --filter @tanstack/ai test:types passes locally
  • pnpm --filter @tanstack/ai test:lib passes locally (751 tests)
  • pnpm --filter @tanstack/ai test:eslint clean
  • Release workflow on main goes green after merge, allowing the changesets release PR to be created

Summary by CodeRabbit

  • Chores
    • Updated internal test infrastructure to refine mock data structure handling.

Review Change Stack

Follow-up to #459, which renamed ToolCall.providerMetadata to
ToolCall<TMetadata>.metadata across src/ but missed this test
helper. tsc fails on main with TS2339 on tests/middlewares/fake-otel.ts,
breaking pnpm test:ci and blocking the changesets release PR from
being created.
@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented May 11, 2026

View your CI Pipeline Execution ↗ for commit 8fcfe24

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

☁️ Nx Cloud last updated this comment at 2026-05-11 14:17:51 UTC

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 11, 2026

Open in StackBlitz

@tanstack/ai

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

@tanstack/ai-anthropic

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

@tanstack/ai-client

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

@tanstack/ai-code-mode

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

@tanstack/ai-code-mode-skills

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

@tanstack/ai-devtools-core

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

@tanstack/ai-elevenlabs

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

@tanstack/ai-event-client

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

@tanstack/ai-fal

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

@tanstack/ai-gemini

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

@tanstack/ai-grok

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

@tanstack/ai-groq

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

@tanstack/ai-isolate-cloudflare

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

@tanstack/ai-isolate-node

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

@tanstack/ai-isolate-quickjs

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

@tanstack/ai-ollama

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

@tanstack/ai-openai

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

@tanstack/ai-openrouter

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

@tanstack/ai-preact

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

@tanstack/ai-react

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

@tanstack/ai-react-ui

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

@tanstack/ai-solid

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

@tanstack/ai-solid-ui

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

@tanstack/ai-svelte

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

@tanstack/ai-utils

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

@tanstack/ai-vue

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

@tanstack/ai-vue-ui

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

@tanstack/openai-base

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

@tanstack/preact-ai-devtools

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

@tanstack/react-ai-devtools

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

@tanstack/solid-ai-devtools

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

commit: 8fcfe24

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 11, 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: 1cffa0dd-3104-4e16-86c9-2a740052b506

📥 Commits

Reviewing files that changed from the base of the PR and between 87f305c and 8fcfe24.

📒 Files selected for processing (1)
  • packages/typescript/ai/tests/middlewares/fake-otel.ts

📝 Walkthrough

Walkthrough

The test utility makeToolCall in the fake OpenTelemetry middleware is updated to use overrides.metadata instead of overrides.providerMetadata when constructing the returned ToolCall object for test scenarios.

Changes

Mock Tool Call Builder Update

Layer / File(s) Summary
Mock Tool Call Factory
packages/typescript/ai/tests/middlewares/fake-otel.ts
The makeToolCall function now conditionally spreads overrides.metadata instead of overrides.providerMetadata into the returned ToolCall object.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A tiny tweak in the test mock's nest,
From providerMetadata to metadata blessed,
The helper now spreads the correct property name,
Test utilities hop forward, all staying the same! 🌟

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely summarizes the main change: renaming providerMetadata to metadata in the makeToolCall test helper.
Description check ✅ Passed The description is comprehensive and well-structured, covering the root cause, fix, and test plan, though it deviates slightly from the template structure.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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/ai-test-types-tool-call-metadata-rename

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


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.

@github-actions
Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

3 package(s) bumped directly, 31 bumped as dependents.

🟥 Major bumps

Package Version Reason
@tanstack/ai-event-client 0.2.9 → 1.0.0 Changeset
@tanstack/ai-gemini 0.10.2 → 1.0.0 Changeset
@tanstack/ai-anthropic 0.8.5 → 1.0.0 Dependent
@tanstack/ai-code-mode 0.1.9 → 1.0.0 Dependent
@tanstack/ai-code-mode-skills 0.1.9 → 1.0.0 Dependent
@tanstack/ai-elevenlabs 0.2.2 → 1.0.0 Dependent
@tanstack/ai-fal 0.7.2 → 1.0.0 Dependent
@tanstack/ai-grok 0.7.2 → 1.0.0 Dependent
@tanstack/ai-groq 0.1.10 → 1.0.0 Dependent
@tanstack/ai-isolate-node 0.1.9 → 1.0.0 Dependent
@tanstack/ai-isolate-quickjs 0.1.9 → 1.0.0 Dependent
@tanstack/ai-ollama 0.6.12 → 1.0.0 Dependent
@tanstack/ai-openai 0.8.4 → 1.0.0 Dependent
@tanstack/ai-openrouter 0.8.4 → 1.0.0 Dependent
@tanstack/ai-preact 0.6.21 → 1.0.0 Dependent
@tanstack/ai-react 0.8.1 → 1.0.0 Dependent
@tanstack/ai-react-ui 0.6.3 → 1.0.0 Dependent
@tanstack/ai-solid 0.7.1 → 1.0.0 Dependent
@tanstack/ai-solid-ui 0.6.3 → 1.0.0 Dependent
@tanstack/ai-svelte 0.7.1 → 1.0.0 Dependent
@tanstack/ai-vue 0.7.1 → 1.0.0 Dependent
@tanstack/openai-base 0.2.0 → 1.0.0 Dependent

🟨 Minor bumps

Package Version Reason
@tanstack/ai 0.15.0 → 0.16.0 Changeset

🟩 Patch bumps

Package Version Reason
@tanstack/ai-client 0.9.0 → 0.9.1 Dependent
@tanstack/ai-code-mode-models-eval 0.0.14 → 0.0.15 Dependent
@tanstack/ai-devtools-core 0.3.26 → 0.3.27 Dependent
@tanstack/ai-isolate-cloudflare 0.2.0 → 0.2.1 Dependent
@tanstack/ai-vue-ui 0.1.32 → 0.1.33 Dependent
@tanstack/preact-ai-devtools 0.1.30 → 0.1.31 Dependent
@tanstack/react-ai-devtools 0.2.30 → 0.2.31 Dependent
@tanstack/solid-ai-devtools 0.2.30 → 0.2.31 Dependent
ts-svelte-chat 0.1.40 → 0.1.41 Dependent
ts-vue-chat 0.1.40 → 0.1.41 Dependent
vanilla-chat 0.0.36 → 0.0.37 Dependent

@AlemTuzlak AlemTuzlak merged commit f8d5b9e into main May 11, 2026
8 checks passed
@AlemTuzlak AlemTuzlak deleted the fix/ai-test-types-tool-call-metadata-rename branch May 11, 2026 14:36
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.

1 participant