Open
Conversation
When getCachedModels('env') returns a partial list (e.g. only Sonnet),
the env provider group loses models like Opus because the SDK result
completely replaces DEFAULT_MODELS.
Change the logic to merge: SDK models take precedence (richer metadata),
but any default models missing from the SDK response are preserved.
Fixes op7418#367
|
Someone is attempting to deploy a commit to the op7418's projects Team on Vercel. A member of the Team first needs to authorize it. |
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.
关联 Issue
Fixes #367
问题
/api/providers/models的 env provider 处理逻辑中,getCachedModels('env')返回的 SDK 模型列表会完全替换DEFAULT_MODELS。如果
supportedModels()只返回了部分模型(比如只有 Sonnet),其他模型(Opus、Haiku)就从选择器里消失了。重启后缓存为空,又会显示完整的默认列表,所以表现为"用着用着模型就少了,重启又好了"。修复
把替换改为合并:SDK 返回的模型优先(带有
supportsEffort等更丰富的元数据),但 SDK 没返回的默认模型保留在列表末尾。改动很小,只动了
route.ts一个文件,+9 -2 行。