fix(cli): add @ai-sdk/openai, anthropic, google as direct dependencies#1667
Merged
Conversation
Global CLI installs don't auto-install peerDependencies, so providers like DeepSeek (which normalises to provider=openai internally) silently fail with "Cannot find package '@ai-sdk/openai'". The CLI is the final consumer and must list all provider SDKs it dynamically imports as direct dependencies, the same way apps/studio previously did for Vercel deployments. Fixes: "Could not build adapter for provider=deepseek"
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
全局安装的 CLI(
npm install -g @objectstack/cli)不会自动安装peerDependencies,导致用户配置 DeepSeek 等 provider 后报错:根本原因
service-ai将@ai-sdk/openai等声明为 optional peerDependencies,设计意图是让消费方按需安装。但 CLI 作为消费方一直缺少这三个包的显式声明,而normalisePresetProvider()会将 deepseek / siliconflow / dashscope / openrouter / cloudflare 等 5 个预设 provider 全部重写为provider=openai,再去动态import('@ai-sdk/openai'),包不存在就报错。修复
在
packages/cli/package.json里将三个 provider SDK 加为直接依赖,与@ai-sdk/gateway保持一致。Test plan
Cannot find package '@ai-sdk/openai'