makecindy / makecindy/cindy

[Bug] 自定义模型:测试通过且模型列表可见,选中后报 'may not exist or may not have access',错误信息无法定位原因

Open
#2,586 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
2.7k
Forks
401
Avg merge
21h 48m
Merged PRs (30d)
776

Description

**提交人**: CC
**客户端版本**: 0.1.45

---

### 现象
在"设置 → 模型供应商"接入自定义模型(OpenAI 兼容网关)后,模型能通过测试、也能在模型列表里看到,但在会话中选中它时调用失败,报:

> There's an issue with the selected model (claude-fable-5-dd-5.4-korg). It may not exist or you may not have access to it.

### 复现步骤
1. 添加一个自定义 OpenAI 兼容网关,注册一个模型(如 `<内网网关>/DeepSeek-V4-Flash-0731`)。
2. 设置页点"测试"——通过;模型列表能拉到该模型。
3. 会话中 `/model <内网网关>/DeepSeek-V4-Flash-0731[1m]` 选中它,然后发送消息。
4. 调用失败,报"模型不存在或无权访问"。

### 期望行为
- 测试通过、列表可见的模型应能直接使用;确实不可用时,错误应指明真正原因(如"该模型不支持 1M 上下文"或透传 API 的拒绝信息)。
- 模型设置的"测试"应校验完整调用路径(包括发给 API 的 `model` 字段),而不是只测连通性。

### 实际行为
1. 带 `[1m]` 后缀时在解析层就被拒绝,错误信息完全没有提示是 `[1m]` 上下文选择符导致。
2. 去掉 `[1m]` 后请求到达 API,才暴露真实原因——注册的模型名被原样作为 `model` 字段发给 API,网关拒绝:
> 400 {"error":{"message":"The supported API model names are deepseek-v4-pro or deepseek-v4-flash, but you passed <内网网关>/DeepSeek-V4-Flash-0731.", ...}}
3. "测试"始终通过,无法提前发现模型名不匹配。

### 复现频率
100%,每次必现。

### 已尝试的解决办法
- 去掉 `[1m]` 后再调用 → 拿到 API 真实的 400 错误(比默认错误有用),据此把模型名改成 API 认的 `deepseek-v4-flash` 后即可正常使用。
- 由此看出两个可改进点:① 自定义模型加 `[1m]` 时解析失败但无"上下文选择符不受支持"的提示;② 模型测试只验连通、不验 model 字段,导致"测试通过却不可用",且默认错误掩盖了真实原因。
---
**版本区域**: CN
**OS**: win32 x64 (10.0.19044)
**界面语言**: zh-CN

Contributor guide

Open the contributing guide

Research direction

No files or tests are named. Start by tracing custom-provider model selection, the `[1m]` suffix parser, and the model-settings test request; compare their model fields and error handling. Done means unsupported context suffixes are explained, the test validates the actual model field, and API rejection details remain visible.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
ai, api, backend-api-design
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.