Commit aa4a5ae
fix(core): fix build error in embedding router doEmbed return type (#13461)
## Summary
`pnpm build:core` fails on `main` with:
```
TS2353: Object literal may only specify known properties, and 'warnings' does not exist in type ...
```
This was introduced by #13369 which added a `warnings` array to the
`doEmbed()` return for AI SDK v6 compatibility. The runtime behavior is
correct, but the TypeScript return type (`EmbeddingModelV2.doEmbed`)
does not include `warnings`, causing a build error.
## Fix
Added a type assertion (`as Awaited<ReturnType<...>>`) so TypeScript
accepts the return value while preserving the runtime `warnings` array
that AI SDK v6 needs.
## Test plan
- `pnpm build:core` — passes (previously failed)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* Fixed a build error in the embedding model router that prevented
successful compilation. The issue involved inconsistent handling of
warnings in the return type, causing type validation failures. This
patch ensures proper type alignment and consistency, restoring the
ability to build the package successfully.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Co-authored-by: Mastra Code (anthropic/claude-opus-4-6) <noreply@mastra.ai>1 parent 861f111 commit aa4a5ae
2 files changed
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
| 222 | + | |
| 223 | + | |
222 | 224 | | |
223 | | - | |
| 225 | + | |
224 | 226 | | |
225 | 227 | | |
0 commit comments