fix(settings): provider 覆写语义修复 + 移除表单清除 Key 功能 - #33
Merged
Conversation
背景:设置页 LM provider 逻辑优化(内置 provider 端点覆写、空模型列表 共享官方目录、编辑保留 pi 手写字段)的 review 修复。 Bug 修复: - assertModelsMeaningful 改用静态 BUILTIN_PROVIDER_IDS 判定:runtime.getProvider 对 models.json 已注册的自定义 provider 也返回真值,「编辑已有自定义 provider 时清空模型」会漏拦、落盘零模型死 provider - buildCustomEntry 补 baseUrl http(s):// 校验,与 setProviderBaseUrl 口径一致 功能移除(按 review 决定): - 彻底删除「清除已保存的 Key」勾选全链路(表单 state/IPC 第 4 参/ shared 类型/i18n 键);删凭证走行上的「移除凭证」/「删除」按钮 - key 语义统一:留空 = 不动,填写 = 写入 UI 修复: - ProviderRow 新增 fullEdit 判定:纯 baseUrl 覆写(内置 id、无自定义 模型)永远走端点覆写表单,防保存后同一按钮换表单的跳变;编辑按钮 label 同步跟随 - 清理 i18n 死键(providers.keyPlaceholder/configKey/updateKey) 测试:settings-custom-provider.test.ts 回归用例(空模型拦截/baseUrl 校验),settings.test.ts 改为「不传 key = 保持不变」;INDEX.md 同步
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.
背景
设置页 LM provider 逻辑优化(内置 provider 端点覆写、空模型列表共享官方目录、编辑保留 pi 手写字段)的 review 修复。
Bug 修复
assertModelsMeaningful改用静态BUILTIN_PROVIDER_IDS判定——runtime.getProvider()对 models.json 已注册的自定义 provider 也返回真值(SDKproviderIds()= builtins ∪ config ids),「编辑已有自定义 provider 时清空模型」会漏拦、落盘零模型死 providerbuildCustomEntry补http(s)://开头校验,与setProviderBaseUrl口径一致功能移除(review 决定)
runtime.logout)/「删除」(自定义,连条目删)UI 修复
ProviderRow新增fullEdit判定:纯 baseUrl 覆写(内置 id、无自定义模型)永远走端点覆写表单,防止保存后同一按钮换表单的跳变;编辑按钮 label 同步跟随providers.keyPlaceholder/configKey/updateKey,zh + en)测试
settings-custom-provider.test.ts:回归用例(空模型拦截 / baseUrl 校验)settings.test.ts:clearApiKey 用例改为「不传 key = 保持不变」验证
typecheck / backend 494 tests / desktop 237 tests / biome 全绿