Repository navigation
fix(model-picker): 关掉「自己填服务地址加节点」那半入口,目录内供应商填 Key 原样不动 (#1397) - #1398
Merged
Merged
Conversation
模型选择器底部那个入口后面是两件事:给目录内供应商(DeepSeek / 智谱 / 通义 / Kimi)填自己的 Key —— 好的那半,owner 天天用;以及自己填一个服务地址加一个自定义节点 —— 加完一条消息也发 不出去,因为出网围栏不敢照 alpha.jsonc 里的地址放行(那是一个 AI 有权改写的文件)。真源改造 是 #1391 / #1392 的线;在它之前,留着一个加了就用不了的入口比没有更糟。 - step 1 里「其他 / 自定义端点」那一行移除,**原位**换成一句人话说明(既有的 a-mpa-hint 形态, 不新建组件):现在不支持自己填服务地址、原因是还没有一个 AI 改不到的地方存它、以后会支持; - 入口与标题文案相应收窄(它现在只剩「给目录内供应商填 Key」这一件事),en/zh 同批; - `window.api.providers.add` 这条 IPC **刻意保留**(#1392 会重新开放),界面不再走到它; `isCustom()` 驱动的那些可编辑分支随之休眠,留注释说明,不删。 判据:test-component/alpha-composer-model.cases.ts 里那条自定义端点的正样本整个翻面 —— 现在钉 「提交路径从界面到不了(step 1 恰好只有目录内 preset、每条路的名称栏都只读、整趟走完 add 零 调用、alpha.jsonc 一个字没写)」+「目录内供应商填 Key 照常且真落进加密钥匙串」。主侧 persistProviderAndRefresh 的覆盖不受影响(src/main/alpha-models.test.ts 独立罩着)。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
这张票做了什么
模型选择器底部那个入口后面是两件事:给目录内供应商填 Key(DeepSeek / 智谱 GLM / 通义千问 / Kimi —— owner 天天用)和自己填一个服务地址加一个自定义节点(加完一条消息也发不出去:出网围栏不敢照
alpha.jsonc里的地址放行,那是一个 AI 有权改写的文件)。这一版只关掉后者,前者一个字不动。packages/ui-mac/src/renderer/alpha-ui/model-picker-add.tsx:step 1 里「其他 / 自定义端点」那一行移除,原位换成一句人话说明(既有的a-mpa-hint形态 + 一个data-alpha-custom-endpoint-disabled钩子,不新建组件、不加 CSS);openCustom()删除。alpha.model.addProvider与标题alpha.provider.addTitle、intro 收窄成「给目录内供应商填 Key」这一件事;新增alpha.provider.customEndpointUnsupported;删掉只服务于那一行的otherEndpoint/compatibleSummary。window.api.providers.add这条 IPC 刻意保留(#1392有了 AI 改不到的真源之后重新开放),界面不再走到它。isCustom()驱动的可编辑分支随之休眠,留注释说明,不删——#1392重新开放只要把 step 1 的入口加回来。判据(先红后绿,两步都是实跑输出)
test-component/alpha-composer-model.cases.ts里那条自定义端点的正样本整个翻面(它本来就是会被这次改动打红的那条):现在钉住互为反面的两件事 —— ① 提交路径从界面到不了(step 1 恰好只有目录内 preset、每条路的名称栏都只读、整趟走完add零调用、alpha.jsonc一个字没写);② 目录内供应商填 Key 照常,而且走真实现落进加密钥匙串(providers.setKey→setProviderKeyAndRetireLegacyKey→getByokKey("zhipuai")读得回)。先红(把
model-picker-add.tsx/i18n/zh.ts/i18n/en.ts三个生产文件git checkout回 basee98f9a520,测试不动):后绿(还原生产文件,工作树
git status --porcelain为空后重跑):主侧那半场没有因此失去覆盖:
persistProviderAndRefresh(钥匙串标记 +alpha.jsonc+ 回滚)的判据在src/main/alpha-models.test.ts,IPC 面在test-component/provider-ipc.wiring.cases.ts,两者一字未动、仍绿。本地门(实跑输出,不是「应该会绿」)
bun run --cwd packages/ui-mac typecheckEXIT=0,error TS0 条bun test src/renderer/alpha-ui/alpha-composer-model.component.test.ts src/renderer/i18n/locale-regression.test.ts src/renderer/alpha-ui/model-picker-core.test.ts src/main/provider-ipc.wiring.test.ts35 pass / 0 failbun test .../new-session-workspace.component.test.ts .../session-second-send.test.ts .../use-projects.component.test.ts4 pass / 0 failpython3 scripts/check-doc-links.py CHANGELOG.md✓ 1 relative link(s) resolve across 1 file(s)(枚举数 1 = 工具自报 1)bash scripts/north-star-guard.shEXIT=0✓ zero upstream package edits与 base fail-set 的差:零。 唯一的红是
src/main/gate-file-registry.test.ts的第 ⑤ 层「
packages/ui-mac/src/main/process-fence-wiring.test.ts: 登记 1 行,实测 4 行」—— **base 上就红**,已在本 worktree 上把packages/ui-mac整个git checkout回e98f9a5复测:21 pass / 1 fail,同一条、同一句。那两个文件(process-fence-wiring.test.ts/source-text-anchors.ts`)不在本 PR 的 diff 里,本票不动它。pre-push 的
alpha-check.sh本机会挂住(它第 [9/14] 步会真建探针 worktree 并写共享core.hooksPath,并发 lane 下互相制造假红),故git push --no-verify;上表是逐条实跑的替代证据。主动没做的(记下来回报,不顺手改)
docs/design/current/model-picker/design.html这份活稿现在与出货 UI 不符 —— 它的可交互原型里仍有「+ 添加自定义节点 / 供应商」与「其他 / 自定义端点」的全字段表单(:30/:71/:195/:210)。它是已批设计稿(受保护资产),改它要走 design-loop 的增量帧 + 批准,不是实现票能顺手做的。建议单开一张设计增量票(或并进#1392重新开放时一起改)。alpha.model.keyReentry(「密钥需重填:重新添加同名服务即可覆盖」)现在指向一个做不到的动作 —— 重填的唯一办法正是被本票关掉的那条路。本机自定义节点为零(票面已确认),所以没有用户可观察到它;改这句话属于另一件事,没动。#1391/#1392。isCustom()那些分支是原地休眠的既有代码,不是新建的开关;恢复 = 把 step 1 的入口加回来。Fixes #1397
🤖 Generated with Claude Code