Skip to content

refactor!: 删掉统一供应商编辑器已替代的旧 llm-settings 面板 - #375

Merged
Phantivia merged 2 commits into
mainfrom
refactor/drop-llm-settings-panel
Nov 4, 2026
Merged

Phantivia merged 2 commits into
mainfrom
refactor/drop-llm-settings-panel

Conversation

@Phantivia

Copy link
Copy Markdown
Member

中文

删掉统一供应商编辑器已经替代的旧 llm-settings 面板:服务端的声明与专属操作、WebUI 的面板实现与内置面板表、只服务它的文案和测试。@kwk1001 这次按你在 issue 里列的边界做:保留 ProviderSettings、sources()、模块自定义栏目与它们的 invoke 分发、底层的保存、密钥状态、探测与报价能力;报价编辑器连同十一种语言的文案先迁进 features/providers/ 再删旧目录;公共协议的 builtin 字段保留;旧的 #/provider/llm:<kind> 链接照旧跳到供应商页。

两个提交:

  • refactor(webui)!:pricing-panel.ts 移到 src/web/client/features/providers/pricing.ts,用到的十九条文案并入供应商页的语言表;删掉 webui-pages/builtins/ 与 builtins.ts。WebUiPageHost 不再接 builtins,面板声明了 builtin 时页签、插槽、端点编辑页三条挂载路径都在那一块显示「内置面板不存在」,不去加载页面扩展。
  • refactor(providers/webui)!:llm:<模块> 页不再声明 settings 面板,页面 invoke 只转给模块自己的面板;删掉只为它服务的 ProviderSettings.activate/delete/setSecret 和私有的 assertNewName/directoryExtras/probe,以及七条只有它用的文案。ProviderHub.action 不带草稿时直接用已保存端点的实例(模型列表走 registry.resolve,测试走 ProviderSettings.probeClient),请求和回执形状不变,仍然不要求带草稿;端点没有模型时的报错改成和草稿相同的「请选择模型」。

BREAKING

/api/webui/providers/llm:<模块>/panels/settings/<方法> 删除,方法有 state、create、activate、save、delete、duplicate、setSecret、models、probe、extras。改用 /api/providers:列表 GET /api/providers,详情 GET /api/providers/:name,新建 POST /api/providers(复制是带 copyFrom 的新建),保存 POST /api/providers/:name/save(整条提交,带 expectedRevision,密钥值放 secretValue),设为当前 POST /api/providers/:name/activate,删除 POST /api/providers/:name/delete,测试与模型列表 POST /api/providers/:name/test、/models;模块的推理档、服务档与默认地址在 GET /api/provider-modules。extras(列端点目录里的文件)没有替代。WebUI 不再带 llm-settings 面板,面板声明 builtin: 'llm-settings' 会显示错误卡。不设弃用期。

测试

  • 只覆盖旧面板界面的测试删除(llm-settings-open-ui、model-temperature-ui、service-tier-ui 与它们的夹具)。
  • 报价编辑器的六条测试改为直接挂编辑器(tests/web/feature-providers-pricing.test.ts)。
  • webui-builtins 去掉注册表断言,挂载、插槽、错误隔离与卸载改用页面扩展的面板,并断言声明了 builtin 的面板显示错误卡且不加载扩展。
  • 旧数据面测试按能力改挂:密钥状态、模型名与探测提示留在 provider-settings;已保存端点不带草稿的模型列表与探测移到 hub.test.ts;Cormini 与全系统集成测试改走 /api/providers。

验证

  • pnpm run typecheck、pnpm typecheck:web、pnpm test(全量)、pnpm build:web 通过。
  • scripts/dev-webui.ts 假数据(端口 8871)里打开供应商页:旧链接 #/provider/llm:llamacpp 落到 #/providers;llamacpp 端点的运行时、模型两块模块面板照常挂上;对 local 端点「测试连接」出回执(假 llama-server 不答 /chat/completions,回执是 404 提示)、「获取模型列表」列出 2 个模型;报价三格表填币种和输出单价后完整规则 JSON 同步更新、卡片标草稿,保存后 GET /api/providers/local 读回这份报价;新建 llamacpp 连接 llama-two,取模型列表后选一个保存,列表里显示可连接。
  • curl 不带草稿:POST /api/providers/local/models 回 2 个模型,/test 回 404 提示的回执,没选模型的 external 回 400「请选择模型。」;旧的 /api/webui/providers/llm%3Allamacpp/panels/settings/state 回 404;manifest 里 llm:* 页只剩编辑页段落与模块面板。

没验证

  • 真实模型服务上的测试连接(dev 假数据里只有本机假 llama-server,它不答 /chat/completions,所以测试回执是 404 的失败提示)。
  • 外部客户端是否还在调旧接口:仓内与 extensions/ 下的 provider 扩展都没有调用。

Fixes #365

English

Removes the old llm-settings panel that the unified provider editor replaced: its server-side declaration and operations, the WebUI panel and the built-in panel registry, and the strings and tests that served only it. @kwk1001 this follows the boundary you listed in the issue: ProviderSettings, sources(), module sections with their invoke dispatch, and the underlying save, secret status, probe and pricing capabilities stay; the pricing editor and its strings in all eleven languages move into features/providers/ before the old directory goes; the public builtin protocol field stays; old #/provider/llm:<kind> links still redirect to the providers page.

Two commits:

  • refactor(webui)!: pricing-panel.ts moves to src/web/client/features/providers/pricing.ts and its nineteen strings join the providers page tables; webui-pages/builtins/ and builtins.ts are deleted. WebUiPageHost no longer takes builtins; a panel that declares builtin gets an error card on all three mount paths (tab, slot, connection editor) without loading the page's extension.
  • refactor(providers/webui)!: llm:<module> pages no longer declare the settings panel and the page invoke forwards only to the module's own panels; ProviderSettings.activate/delete/setSecret, the private assertNewName/directoryExtras/probe and seven strings used only by them are deleted. ProviderHub.action without a draft now uses the saved endpoint's instance directly (registry.resolve for models, ProviderSettings.probeClient for the probe); request and receipt shapes are unchanged and a draft is still optional. An endpoint without a model now reports the same "Model is required." as a draft.

BREAKING

/api/webui/providers/llm:<module>/panels/settings/<method> is removed, covering state, create, activate, save, delete, duplicate, setSecret, models, probe and extras. Use /api/providers: list GET /api/providers, detail GET /api/providers/:name, create POST /api/providers (duplicate is a create with copyFrom), save POST /api/providers/:name/save (whole entry, with expectedRevision, key value in secretValue), activate POST /api/providers/:name/activate, delete POST /api/providers/:name/delete, probe and model list POST /api/providers/:name/test and /models; module reasoning tiers, service tiers and default URL are in GET /api/provider-modules. extras (listing files in the endpoint directory) has no replacement. The WebUI no longer ships the llm-settings panel; a panel declaring builtin: 'llm-settings' shows an error card. No deprecation period.

Verified

  • pnpm run typecheck, pnpm typecheck:web, full pnpm test, pnpm build:web.
  • With scripts/dev-webui.ts fake data (port 8871): #/provider/llm:llamacpp lands on #/providers; the llamacpp runtime and models module panels mount; on the local endpoint "Test connection" returns a receipt (the fake llama-server does not answer /chat/completions, so it is the 404 hint) and "Fetch models" lists 2 models; filling currency and output rate in the three-rate pricing form updates the full-rules JSON and marks the card as a draft, and after saving GET /api/providers/local returns that pricing; a new llamacpp connection llama-two was created, given a model from the fetched list, saved, and listed as ready.
  • curl without a draft: POST /api/providers/local/models returns 2 models, /test returns the 404-hint receipt, external (no model) returns 400 "请选择模型。"; the old /api/webui/providers/llm%3Allamacpp/panels/settings/state returns 404; llm:* pages in the manifest carry only the editor blocks and module panels.

Not verified

  • A probe against a real model service (the dev fixture's local fake llama-server does not answer /chat/completions, so the probe receipt is the 404 hint).
  • Whether any external client still calls the old routes; no provider extension in this repository or under extensions/ does.

🤖 Generated with Claude Code

Phantivia and others added 2 commits November 4, 2026 13:50
- pricing-panel.ts 移到 features/providers/pricing.ts,它用的十九条文案并入供应商页的
  十一种语言表;表单、币种校验、完整 JSON 规则、报价快照与草稿行为不变。
- WebUiPageHost 不再接 builtins:面板声明了 builtin 时,页签、插槽与端点编辑页三条挂载
  路径都在那一块显示「内置面板不存在」,不去加载页面扩展。
- 只覆盖旧面板界面的测试删除;报价编辑器的六条测试改为直接挂编辑器,宿主的挂载、插槽与
  错误隔离测试改用页面扩展的面板,llamacpp 运行时面板测试自建端点配置。

BREAKING CHANGE: WebUI 不再带 llm-settings 面板。面板声明 builtin: 'llm-settings' 时显示错误卡;
builtin 只在 llm:* 页上点名端点编辑页自带的四块段落(CONNECTION_EDITOR_BLOCKS)。端点在供应商页
编辑。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- ProviderSettings 不再声明 settings 面板,页面 invoke 只转给模块自己的面板;只为它服务的
  activate、delete、setSecret 与私有的 assertNewName、directoryExtras、probe 一并删除,
  文案表删掉七条只有它用的。
- ProviderHub.action 不带草稿时直接用已保存端点的实例:模型列表走 registry.resolve,
  测试走 ProviderSettings.probeClient。请求与回执形状不变;端点没有模型时的报错改用与草稿
  相同的「请选择模型」。
- 旧数据面测试按能力改挂:密钥状态、模型名与探测提示留在 provider-settings 测试,已保存
  端点的模型列表与探测移到 hub 测试;Cormini 与全系统集成测试改走 /api/providers。

BREAKING CHANGE: /api/webui/providers/llm:<模块>/panels/settings/<方法> 删除,方法有 state、
create、activate、save、delete、duplicate、setSecret、models、probe、extras。改用 /api/providers:
列表 GET /api/providers,详情 GET /api/providers/:name,新建 POST /api/providers(复制是带
copyFrom 的新建),保存 POST /api/providers/:name/save(整条提交,带 expectedRevision,密钥值放
secretValue),设为当前 POST /api/providers/:name/activate,删除 POST /api/providers/:name/delete,
测试与模型列表 POST /api/providers/:name/test、/models;模块的推理档、服务档与默认地址在
GET /api/provider-modules。extras(列端点目录里的文件)没有替代。不设弃用期。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Phantivia
Phantivia merged commit 5f2bd08 into main Nov 4, 2026
4 checks passed
@Phantivia
Phantivia deleted the refactor/drop-llm-settings-panel branch November 4, 2026 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

清理统一供应商编辑器已替代的 llm-settings 面板声明与操作接口

1 participant