chore(web): upgrade Vercel AI SDK to v7#4652
Conversation
Upgrade ai and affiliated @ai-sdk/* packages to the latest major v7 line. Versions are pinned to the newest releases that satisfy the workspace minimumReleaseAge policy. - ai 6.0.224 -> 7.0.29 - @ai-sdk/anthropic 3.0.96 -> 4.0.15 - @ai-sdk/gateway 3.0.148 -> 4.0.21 - @ai-sdk/mistral 3.0.48 -> 4.0.12 - @ai-sdk/openai 3.0.84 -> 4.0.15 - @ai-sdk/openai-compatible 2.0.59 -> 3.0.11 Apply v7 breaking renames in the bot agent runner: - stepCountIs -> isStepCount - onStepFinish -> onStepEnd
Code Review SummaryStatus: 3 Issues Found | Recommendation: Address before merge Executive SummaryThe disputed AI SDK identifiers Overview
Issue Details (click to expand)CRITICAL
Files Reviewed (4 files)
Fix these issues in Kilo Cloud Previous Review Summary (commit 2145eed)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 2145eed)Status: 3 Issues Found | Recommendation: Address before merge Executive SummaryThe renamed AI SDK identifiers Overview
Issue Details (click to expand)CRITICAL
Files Reviewed (3 files)
Reviewed by claude-sonnet-5 · Input: 32 · Output: 12.1K · Cached: 720.3K Review guidance: REVIEW.md from base branch |
AI SDK v7 is ESM-only (no CJS build), so Jest must transform the `ai` package and its ESM dependency closure instead of loading them as CommonJS. Add them to the transformIgnorePatterns exception list: - ai - @ai-sdk/* (gateway, provider, provider-utils, openai, anthropic, ...) - @standard-schema/spec - @workflow/serde - eventsource-parser Fixes 'Cannot use import statement outside a module' failures in web test suites that transitively import the AI SDK.
Review note: automated "CRITICAL" flags are false positivesThe Kilo Code Review bot re-flags
Verified directly against the installed
Both renames are documented in the official v6→v7 migration guide (codemods All 64 CI checks are green (2 intentionally skipped: CodeQL, notify-main). |
Summary
Upgrades the Vercel AI SDK (
ai) and affiliated@ai-sdk/*provider packages to the latest major v7 line.ai@ai-sdk/anthropic@ai-sdk/gateway@ai-sdk/mistral@ai-sdk/openai@ai-sdk/openai-compatibleVersions are pinned to the newest releases that satisfy the workspace
minimumReleaseAgepolicy (6842 min), keeping the provider set internally consistent on@ai-sdk/provider@4.0.3/@ai-sdk/provider-utils@5.0.10.Breaking changes applied
Per the v6 → v7 migration guide, in
apps/web/src/lib/bot/agent-runner.ts:stepCountIs→isStepCountonStepFinish→onStepEndNotes
@ai-sdk/otelpackage is not required.engines(Node >=24) already satisfies v7's Node 22+ requirement.generateText,embed/embedMany,Output.object,createGateway,createOpenAICompatible,createOpenAI, provider option types) verified present in the target versions.