Repository navigation
Conversation
Contributor
Author
|
@Wei-Shaw CC |
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.
Closes #8081
Related: #7017, #7689
中文
问题与原因
OpenAI 兼容账号保存了模型白名单或映射后,如果上游
/models成功返回的目录没有包含配置目标,账号测试列表会丢失这些配置名称,甚至变成空列表。projectAccountModelsBody只保留目标精确存在于上游目录的条目;FetchOpenAIAccountModels将投影后的空列表作为成功结果返回,因此管理接口的错误回退不会执行。带日期的上游 ID 与 CodingPlan 请求名称不同,是一种复现方式;该问题也影响使用此发现流程的其他 OpenAI 兼容供应商。本次改动
FetchOpenAIAccountModels中,完成现有目录投影和 OAuth 图片选项补充后,追加尚未展示的显式配置请求名称(model_mapping的左侧键,包括白名单的同名映射)。实现集中在测试模型列表服务及其测试,共两个文件。共享上游目录、缓存、公开
/v1/models投影、管理 handler 和前端不变。回归覆盖与验证
以下定向单元测试已通过:
未逐一验证真实供应商的模型推理调用;本 PR 修复测试列表的展示。
English
Problem and cause
An OpenAI-compatible account can have an explicit model whitelist or mapping, yet lose those choices in the account test picker when a successful upstream
/modelsresponse omits the configured targets. The picker can become completely empty.projectAccountModelsBodyretains an entry only when its mapped target exactly exists in the upstream catalog.FetchOpenAIAccountModelsreturns the projected empty list as a successful result, so the admin handler's discovery-error fallback does not run. Dated upstream IDs differing from CodingPlan request names are one reproduction; other OpenAI-compatible providers using this discovery path are affected as well.Changes
FetchOpenAIAccountModels: the left-hand keys ofmodel_mapping, including identity mappings used by a whitelist.This is a focused alternative addressing the same root cause as #7689. Only the test-picker service and its tests change. The shared upstream catalog/cache, public
/v1/modelsprojection, admin handler, and frontend remain unchanged.Regression coverage and validation
The targeted unit-test command shown above passed.
Live inference was not individually verified for every provider model; this PR fixes account test-picker visibility.