lingo.dev icon indicating copy to clipboard operation
lingo.dev copied to clipboard

feat: upgrade to ai sdk 5

Open The-Best-Codes opened this issue 2 months ago • 6 comments

Closes #1556

This upgrades the project to use the latest version of the AI SDK (v5.0.89). It also upgrades provider packages to versions compatible with AI SDK 5. Note: The ollama-ai-provider package doesn't support AI SDK 5, so I swapped it out for the ollama-ai-provider-v2 package, which is recommended in AI SDK's docs.

The point of these upgrades is to address a security advisory which, though minor, was affecting some users' ability to ship Lingo.dev in production as it failed SOC 2 checks.

The-Best-Codes avatar Nov 10 '25 14:11 The-Best-Codes

Don't merge yet, please, as I am still manually testing locally. I'll provide an update here if all my manual tests do fine. cc @maxprilutskiy

The-Best-Codes avatar Nov 10 '25 14:11 The-Best-Codes

@The-Best-Codes have a look - a couple of interesting comments, and some prefault vs default issues that look a bit odd to me (is "prefault" a thing? what does it do?)

maxprilutskiy avatar Nov 17 '25 12:11 maxprilutskiy

@maxprilutskiy Copilot mostly doesn't have a clue what it's talking about. Zod v4 change the .default behavior. The Zod v3 .default behavior is moved to the .prefault function in Zod v4, which they recommend using for backwards compatibility:

https://zod.dev/v4/changelog#default-updates:~:text=To%20replicate%20the%20old%20behavior%2C%20Zod%20implements%20a%20new%20.prefault()%20API.%20This%20is%20short%20for%20%22pre%2Dparse%20default%22

The-Best-Codes avatar Nov 17 '25 15:11 The-Best-Codes

hi @The-Best-Codes please resolve the merge conflicts. Thanks!

sumitsaurabh927 avatar Nov 19 '25 05:11 sumitsaurabh927

Just need maintainer feedback on this: lingodotdev/lingo.dev/pull/1559/#discussion_r2530204932

Also need to test the MCP server manually. Otherwise, this is read to merge.

The-Best-Codes avatar Nov 19 '25 17:11 The-Best-Codes

Merge conflict nightmare :face_with_peeking_eye: I will fix those when I get a chance. Any feedback on my comment?

The-Best-Codes avatar Nov 29 '25 00:11 The-Best-Codes