Skip to content

chore(deps): upgrade AI SDK family to v4/v7 (supersedes #255, #249, #253, #250) - #275

Merged
qnbs merged 1 commit into
mainfrom
feat/ai-sdk-v4-upgrade
Jul 28, 2026
Merged

chore(deps): upgrade AI SDK family to v4/v7 (supersedes #255, #249, #253, #250)#275
qnbs merged 1 commit into
mainfrom
feat/ai-sdk-v4-upgrade

Conversation

@qnbs

@qnbs qnbs commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Summary

Supersedes and closes the need for #255, #249, #253, #250 β€” those four Dependabot PRs each bump one package in the same AI SDK family, but only merging all four together actually works.

Root cause for why they couldn't merge individually: @ai-sdk/google@4 (proposed by #255) emits the new LanguageModelV4 spec, but the ai package's LanguageModel type only recognizes LanguageModelV4 from v7 onward. Merging #255 alone left services/ai/providerFactory.ts with a real tsc error:

error TS2322: Type 'LanguageModelV4' is not assignable to type 'LanguageModel'.
  Type 'LanguageModelV4' is not assignable to type 'LanguageModelV2 | LanguageModelV3 | (string & {})'.

Bumping ai 6β†’7, @ai-sdk/google 3β†’4, @ai-sdk/openai 3β†’4, and @ai-sdk/react 3β†’4 together resolves this with no application code changes β€” streamText/toTextStreamResponse/onFinish's usage shape (services/ai/worldScriptCompletionFetch.ts) and createLanguageModelForWorldScript's LanguageModel return type (services/ai/providerFactory.ts) are unaffected by the major bump.

Test plan

  • pnpm run typecheck β€” clean (no LanguageModelV4 mismatch)
  • pnpm run lint β€” clean
  • Full AI-provider/completion-fetch suite β€” 171 tests passing: aiProviderService.test.ts (52), geminiService.test.ts (28), providerFactory.test.ts (13), useWorldScriptAI.test.ts (7), worldScriptCompletionFetch.test.ts (19), plus the 52 in aiProviderService again post-bump for a clean re-run
  • Verified only 3 files in the codebase import from ai/@ai-sdk/react directly (providerFactory.ts, worldScriptCompletionFetch.ts, useWorldScriptAI.ts) β€” all covered by the above

Follow-up

Once this merges, I'll close #255, #249, #253, #250 as superseded by this PR.

πŸ€– Generated with Claude Code

Summary by CodeRabbit

  • Changes
    • Upgraded the AI SDK packages to their latest major versions.
    • Preserved existing AI streaming, completion, and provider integration behavior.
  • Documentation
    • Updated the changelog with upgrade details and verification results.

…i/react)

Bumps ai 6.0.206 -> 7.0.37, @ai-sdk/google 3.0.82 -> 4.0.24,
@ai-sdk/openai 3.0.71 -> 4.0.20, @ai-sdk/react 3.0.201 -> 4.0.40 as one
coordinated unit, superseding Dependabot PRs #255, #249, #253, #250.

Root cause for not merging them individually: @ai-sdk/google@4 emits
the new LanguageModelV4 spec, but the `ai` package's LanguageModel type
only recognizes it from v7 onward -- upgrading @ai-sdk/google alone
(as #255 proposed) left services/ai/providerFactory.ts with a real
tsc error (LanguageModelV4 not assignable to LanguageModelV2 |
LanguageModelV3). Bumping the whole family together resolves it with
no application code changes needed.

Verified: pnpm run typecheck (clean), pnpm run lint (clean), and the
full AI-provider/completion-fetch test suites (171 tests across
aiProviderService.test.ts, geminiService.test.ts, providerFactory.test.ts,
useWorldScriptAI.test.ts, worldScriptCompletionFetch.test.ts) all passing.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
worldscript-studio Ready Ready Preview, Comment Jul 28, 2026 6:35am

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. πŸŽ‰

ℹ️ Recent review info
βš™οΈ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 01f2d5a3-9970-4f94-beae-411cbc3bff61

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 7201da3 and 8d1e11b.

β›” Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
πŸ“’ Files selected for processing (2)
  • CHANGELOG.md
  • package.json

πŸ“ Walkthrough

Walkthrough

The AI SDK dependencies were upgraded to ai v7 and @ai-sdk/* v4. The changelog documents the coordinated version change, type compatibility requirement, unchanged usage patterns, and verification steps.

Changes

AI SDK upgrade

Layer / File(s) Summary
Dependency and documentation update
package.json, CHANGELOG.md
@ai-sdk/google, @ai-sdk/openai, and @ai-sdk/react moved to v4 ranges; ai moved to v7, with compatibility and verification details documented.

Estimated code review effort: 1 (Trivial) | ~5 minutes

πŸš₯ Pre-merge checks | βœ… 5
βœ… Passed checks (5 passed)
Check name Status Explanation
Description Check βœ… Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check βœ… Passed The title clearly describes the coordinated AI SDK dependency upgrade and matches the main change in the PR.
Docstring Coverage βœ… Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
πŸ§ͺ Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/ai-sdk-v4-upgrade

Comment @coderabbitai help to get the list of available commands.

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​@​ai-sdk/​google@​4.0.24721008898100
Addednpm/​@​ai-sdk/​react@​4.0.40981007598100
Addednpm/​@​ai-sdk/​openai@​4.0.20771008898100
Addednpm/​ai@​7.0.379910010099100

View full report

@codeant-ai

codeant-ai Bot commented Jul 28, 2026

Copy link
Copy Markdown

🏁 CodeAnt Quality Gate Results

Commit: 8d1e11b4
Scan Time: 2026-07-28 06:37:08 UTC

βœ… Overall Status: PASSED

Quality Gate Details

Quality Gate Status Details
Secrets βœ… PASSED 0 secrets found
Duplicate Code βœ… PASSED 0.0% duplicated
SAST βœ… PASSED No security issues
Bugs βœ… PASSED Rating S: No bugs
IAC βœ… PASSED Rating S: No issues

View Full Results

@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

βœ… All modified and coverable lines are covered by tests.

πŸ“’ Thoughts on this report? Let us know!

@qnbs
qnbs merged commit 88f6c39 into main Jul 28, 2026
25 checks passed
@qnbs
qnbs deleted the feat/ai-sdk-v4-upgrade branch July 28, 2026 08:25
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