Skip to content

fix(embed): default missing warnings to [] for v2 embedding models - #14933

Closed
SAY-5 wants to merge 1 commit into
vercel:mainfrom
SAY-5:say5/embed-warnings-undefined-14926
Closed

fix(embed): default missing warnings to [] for v2 embedding models#14933
SAY-5 wants to merge 1 commit into
vercel:mainfrom
SAY-5:say5/embed-warnings-undefined-14926

Conversation

@SAY-5

@SAY-5 SAY-5 commented May 2, 2026

Copy link
Copy Markdown

Fixes #14926.

EmbeddingModelV2 providers may omit warnings from doEmbed. Three sites in packages/ai/src/embed propagated modelResponse.warnings directly into the result; downstream logWarnings reads .length and embed-many's chunked path spreads ...result.warnings, both crash on undefined. Coerce with ?? [] at each boundary, and add a regression test using MockEmbeddingModelV2 with no warnings field.

@aayush-kapoor aayush-kapoor left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

marking closed in favour of #15324

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.

embed() and embedMany() crash with EmbeddingModelV2 providers that omit warnings

2 participants