内置模型清单与网关实际可用模型不一致:Claude Fable 5 必报 400,voyage-4 索引持续失败,utility 通道 404
- Dominant language
- TypeScript
- Stars
- 2.7k
- Forks
- 395
- Avg merge
- 21h 48m
- Merged PRs (30d)
- 776
Description
**提交人**: 大佬
**客户端版本**: 0.1.37
---
三处独立故障,病根应为同一个:客户端展示/使用的模型 id 与上游网关(XD Gateway)实际接受的对不上。订阅本身正常:同一时刻 `claude-opus-5` 主对话完全可用。
## 现象
**1) 选中 Claude Fable 5 后任何消息必报 400**
```
API Error: 400 400: {'error': 'anthropic_messages: Invalid model name passed in model=claude-fable-5. Call `/v1/models` to view available models for your key.'}
```
本地缓存 `model-discovery/anthropic-models.json`(fetchedAt 2026-08-08T05:02:40Z)中该模型被标为可用:
```json
{ "id": "claude-fable-5", "name": "Claude Fable 5", "group": "anthropic",
"sortOrder": 2, "contextWindow": 1000000,
"contextWindowVerified": true, "status": "active" }
```
主进程日志中 `create-session invoked` 与 `send: lazy create-session` 多次携带 `model: 'claude-fable-5'`,说明它被当作新建会话的默认模型下发。
**2) embedding 模型 `voyage/voyage-4` 无效,聊天索引持续失败**
```
[ERROR] [embeddingHost] {"event":"embeddingWorker.batch.failed","source":"chat",
"modelId":"voyage/voyage-4","code":"INVALID_MODEL",
"error":"XD Gateway /v1/embeddings 400: /embeddings: Invalid model name passed in model=voyage/voyage-4."}
```
单日主进程日志中出现 **2945 次**,约每 5 秒重试一次,仍在持续。界面无任何提示,属静默失败。
**3) utility-model one-shot 通道 404(与所选模型无关)**
```
[WARN ] [utility-model:one-shot] explicit utility text provider failed {
providerId: 'anthropic',
model: 'claude-opus-5',
transport: 'litellm-chat-completions',
reason: 'http_error',
httpStatus: 404
}
```
关键点:换成主对话完全可用的 `claude-opus-5` 依然 404,说明不是模型 id 问题,而是 `litellm-chat-completions` 这条 transport 本身打不通。
## 复现步骤
1. 新建一个会话(实测默认就落在 `claude-fable-5`)
2. 发送任意一条消息 → 立即弹出上述 400,turn 以 `terminalReason: api_error` 结束
3. 正常使用客户端一段时间后查看主进程日志 → 可见 embeddingHost 与 utility-model 两类报错持续刷屏
## 期望行为
- 网关不支持的模型不出现在选择器中,更不作为新建会话默认值;若为清单同步延迟,至少在选中时给可读提示并回退到可用模型
- embedding 模型 id 修正;对确定性的 `INVALID_MODEL` 停止无限重试,并向用户暴露一次告警
- utility one-shot transport 恢复可用
## 实际行为
- 选中 Fable 5 的会话完全无法使用,错误文案指向 “your key”,容易让用户误判为自己订阅/密钥有问题
- 聊天记录语义索引建不起来,历史检索结果残缺,且用户无从得知
- 依赖 utility 模型的后台功能(如会话标题自动生成)失效
## 建议
在模型发现阶段就用网关 `/v1/models` 的实际返回做一次过滤,把不可用项从选择器剔除,并保证默认模型一定落在可用集合内。
---
**OS**: darwin arm64 (25.5.0)
**界面语言**: zh-CN
Contributor guide
Research direction
Start by inspecting model-discovery/anthropic-models.json and compare its entries with the gateway’s /v1/models response. Then trace the embeddingHost retry logs and the utility-model one-shot path using the reported litellm-chat-completions transport. Done means unsupported chat and embedding models are excluded or safely rejected, INVALID_MODEL retries stop with a user-visible warning, and the utility request no longer returns 404.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- ai, backend-api-design, search
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100