Replies: 2 comments
|
Confirmed against master ( Source trace confirms the failure is real and silent.
The model-validity gate is the interesting part. In const api = request.api ?? base?.api ?? routeApi
const baseUrl = request.baseURL ?? base?.baseUrl ?? providerBaseUrlwhere if (api === undefined) invalid(provider, `model "${entry.id}" needs an api; ...`)
if (baseUrl === undefined) invalid(provider, `model "${entry.id}" needs a baseURL; ...`)
The add-provider UI then no-ops for a mechanical reason: The real defect is the silent whole-namespace abort, two ways:
Your mitigation (remove the stale entry, or the whole section) is correct and matches exactly where the throw fires. Upstream-wise, I'd frame the fix as: catalog drift on a configured model list should not make the whole settings namespace unserviceable — resolve it per-model (warn + drop the unreachable entry, or surface it as "invalid model") instead of failing One thing to double-check before you file upstream: whether |
|
+1 — 在 回答 @argszero 留下的待核实问题:我在本地核实过, 同意修复方向应该是逐模型降级(警告 + 保留可用条目 / 标记失效条目),并在 settings 命名空间注册失败时打一条警告日志。另外补充一点:这个失败只显示在终端(stderr),UI 里完全没有提示——升级 CLI 的用户根本不知道自己的 provider 为什么消失了。希望上游尽快处理。 |
Uh oh!
There was an error while loading. Please reload this page.
上游缺陷报告:dsh 0.1.2-rc.1 Settings→Models "Add provider" 静默失效
1. 现象(Symptoms)
设置 → 模型(Settings → Models)页面:
disabled);127.0.0.1直连(原生 loopback、无任何中间层)与经 auth-proxy 访问时完全一致。2. 复现步骤(Repro)
在 旧版本(pi-ai catalog 尚含
grok-4.5的 era,实测 8 月版本)通过 UI 为opencode-go提供方保存过自定义模型列表,其中含grok-4.5(示例配置,实际为任意 catalog 已下线/不存在的 model id):升级到 dsh 0.1.2-rc.1(pi-ai 0.84.4)并重启
dsh web;打开 设置 → 模型:复现上述现象;
/api/settings/describe响应中namespaces列表缺少llm-pi-ai(实测 14 个,其余含llm-deepseek正常)。反向验证(确定根因的数据实验):
settings.yaml移除整个llm-pi-ai段 → 重启 → describe 中llm-pi-ai回归(15 个),Add provider 恢复正常(含 41 个提供方的添加卡片);models中的grok-4.5一条 → 同样恢复;pi-ai 0.84.4的opencode-go模型列表(25 个)中无grok-4.5。3. 根因(Root Cause)
链路(源码均为
dsh-v0.1.2-rc.1tag):packages/llm/llm-pi-ai/src/index.ts:ctx.inject(['settings'])→settings.installSection(ctx, 'llm-pi-ai', Config, config, { validate: assertServiceable, ... });packages/llm/llm-pi-ai/src/config.ts:assertServiceable(config) → resolveProfiles(config.providers)——models 覆盖中 catalog 不存在的 model id 会使 resolve 抛错(注释明确:拒绝 "a schema-valid profile the adapter cannot serve");packages/settings/settings/src/index.tsregister():resolved: deepFreeze(this.resolve(schema, base, section, validate))同步执行——存储段校验失败即抛错 →installSection失败 → namespace 从未进入 registrations 表;packages/client/ui-settings-models/src/client/ModelsSection.tsx:点击 Add provider →setAdding(true)/setEditing(addable[0]),但渲染条件addTarget !== undefined && addNamespace !== undefined(addNamespace = state.namespaces.get(addTarget.settingsNs))不满足 → 回落到按钮区 → UI 静默无响应;同页protocols = protocolChoices(state.namespaces.get('llm-pi-ai'), …)为空 → Add a custom provider 禁用。一句话:catalog 模型下线使旧配置校验失败 → llm-pi-ai settings namespace 注册整体失败且静默 → 依赖该 namespace 的整个 Models 添加流失效。
4. 影响(Impact)
opencode-go)也不在目录中呈现为可管理行;5. 期望行为(Expected)
resolveProfiles/schema 校验对"catalog 已不存在的自定义 model id"降级(warn + 保留可服务部分 / 提示失效条目),而非整体拒绝注册;warn日志并在配置 UI 呈现错误;describe 不应静默缺失;6. 上游 issue 草稿(可直接粘贴 GitHub)
7. 本仓库缓解措施(已在部署侧修复数据)
~/.dsh/settings.yaml:移除llm-pi-ai.providers.opencode-go.models中已下线的grok-4.5(其余 15 个自定义模型保留);All reactions