Skip to content

fix(providers/webui): 获取模型列表不再要求先填模型 - #364

Merged
Phantivia merged 2 commits into
Pal-AI-Lab:mainfrom
Voemp:fix/webui-fetch-models-without-model
Nov 4, 2026
Merged

Phantivia merged 2 commits into
Pal-AI-Lab:mainfrom
Voemp:fix/webui-fetch-models-without-model

Conversation

@Voemp

@Voemp Voemp commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

中文

在「模型供应商」编辑页,未填模型名就点「获取模型列表」会返回 400「模型名不能为空」,而这个按钮的用途正是先取回列表、再从中选模型。改动在 ProviderHub.action:models 动作按去掉 spec 的草稿条目做校验并建立实例,spec 不参与列模型;test 动作仍要求模型。新增回归用例覆盖空模型列模型,修复前它以同一条错误失败,修复后通过。

English

On the model providers page, pressing "Fetch models" before typing a model name returned HTTP 400 "Model name cannot be empty", although the list is how the operator picks a model. ProviderHub.action now validates the draft entry without spec for the models action, which does not use it; the test action still requires a model. The new regression test fails with the same message before the fix and passes after it.

Checks

  • pnpm test
  • pnpm run typecheck
  • pnpm typecheck:web (browser code changed / 改了浏览器代码)
  • A bug fix carries a test that fails before the fix / 修 bug 附带修复前会失败的测试

pnpm test locally: all Node-side suites pass; the jsdom suites (tests/web/*.test.ts, 61 cases) fail identically on unmodified main in this environment (localStorage undefined), so they are unrelated to this change.

Voemp and others added 2 commits November 1, 2026 12:07
- 根因:编辑页草稿带着空 spec.model 走 validateEntry,模型名必填把它拦下;列模型用不到 spec。
- 列模型按去掉 spec 的条目校验并建立实例,测试连接仍要求模型。
- tests/providers/hub.test.ts 新增空模型列模型的用例;修复前报 Model name cannot be empty。
- 草稿用例已经有同一套 fetch 替身和「探测缺模型时报错」的断言,新加的
  一行只断言模型名为空时仍能列出模型;单独那条用例与它重复,删掉。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Phantivia
Phantivia merged commit e385804 into Pal-AI-Lab:main Nov 4, 2026
3 checks passed
@Phantivia

Copy link
Copy Markdown
Member

谢谢修复。我们把新加的用例并进了已有的草稿用例(只多一行断言:模型名为空也能列出模型),删掉了和已有用例重复的那条。已合并,随下个版本发布。

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.

2 participants