feat:增加「显示的模型」白名单筛选功能 - #25
Merged
Merged
Conversation
- 新增可选配置 visibleModels: string[],未配置/空数组表示显示全部,
非空时选择器只显示名单内模型,作用在套餐过滤之后
- listModels 支持 { unfiltered: true },目录接口走全量做候选项,
LLM 运行时走默认过滤路径
- 设置页新增「显示的模型」卡片,复用 ModelMultiSelect,支持勾选/显示全部,
走正常保存-放弃流程,中英文案齐备
- 新增 3 个单测:白名单收窄、空名单全显、unfiltered 全量
Closes Mars-Sea#24
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:#24
做什么
给 Command Code 供应商增加「显示的模型」白名单筛选,模型目录大时可以只保留常用模型,模型选择器更清爽。
改动
visibleModels: string[](model id 白名单)。未配置 / 空数组 = 显示全部(默认行为不变);非空 = 选择器只显示名单内模型,作用在套餐过滤(filterModelsByPlan)之后。落盘llm-commandcode.visibleModels。listModels(provider, opts)支持{ unfiltered: true };目录接口(commandcode/models)走全量做候选项,避免"显示全部"保存后候选项被清空;LLM 运行时走默认过滤路径。ModelMultiSelect多选下拉,支持勾选 N 个 / "显示全部"(清空名单),走正常的保存-放弃流程,中英文案齐备,无新增 CSS。验证
npx tsc --noEmit通过;npm test297/297 通过(含新增 3 个单测:白名单收窄、空名单全显、unfiltered 全量)。默认关闭(空名单),对现有用户零影响。