[Bug] 内置目录对 DeepSeek 系模型的默认「最大输出 Token」为 384000,与上游服务方声明(128K)不一致
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 22
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
提交前确认 · Pre-submission checklist
- 我已搜索过现有 issue,确认这不是重复 / I searched existing issues and confirmed this isn't a duplicate.
- 我已阅读 CONTRIBUTING.md / I've read CONTRIBUTING.md.
问题类别 · Category
模型设置 / 切换 · Model config
涉及的 Agent 框架 · Agent framework
ZCode Agent(自研)
严重程度 · Severity
轻微 · Minor (小问题不影响主流程 / minor, no impact on main flow)
复现频率 · Reproducibility
必现 · Always
问题描述 · Description
ZCode 内置模型目录(zcode-builtin.json)对 DeepSeek 系全部模型给出默认「最大输出 Token」= 384000:
{"modelMatch": ".*deepseek-v4[.-]1-flash(?:[.\\-:/\\[].*)?",
"config": {"optionSpecs": {"maxOutputTokens": {"max": 384000}, ...}}}
modelRules[61..64]:deepseek-v4-flash/deepseek-v4-pro/deepseek-flash/deepseek-v4.1-flash均为 384000;providerSiteRules[7..10](baseUrlMatch=https://opencode.ai/zen/go/v1/)同样为 384000(本机 3.12.1 / 3.12.2 / 3.12.3 三个版本的目录均含 384000:3.12.1 为 4 处、3.12.2/3.12.3 各 8 处);
而同一批模型 ID 在实际服务方(如 WorkBuddy / CodeBuddy)的官方目录里声明的上限不同(实测其官方 CLI 所用 /v3/config):
| 服务方 | 模型 | maxOutputTokens |
|---|---|---|
| workbuddy.ai(国际) | deepseek-v4.1-flash | 128000 |
| workbuddy.cn(国内) | deepseek-v4.1-flash | 128000 |
| workbuddy.cn(国内) | deepseek-v4-pro | 128000 |
| workbuddy.cn(国内) | deepseek-v4-flash | 50000 |
384000 与 DeepSeek 官方 API 的 max_tokens 上限(1–393216,≈384K)同量级——推测内置目录是按 DeepSeek 官方规格预置的;但该规格不适用于以这些模型 ID 提供服务的第三方网关(如 WorkBuddy 声明 128K)。
影响:在自定义供应商下使用这些模型 ID 时,界面中「最大输出 Token」的默认值/可选上限显示为 384000,高于服务方实际能力。我们未直接复现由此引发的故障,但该默认值会误导用户(以为可输出 384K),且与其他网关配合时存在超出实际能力被上游报错/截断的风险。我们已手动把两个供应商的该值改为 128000 与上游对齐。
复现步骤 · Steps to reproduce
- 添加一个 OpenAI 兼容自定义供应商,模型 ID 填
deepseek-v4.1-flash(例如经本地网关接入 WorkBuddy); - 打开该模型设置,观察「最大输出 Token」默认值/可选上限 = 384000;
- 对比该服务方官方目录(官方 CLI 使用的
/v3/config):同模型maxOutputTokens = 128000。
期望表现 · Expected behavior
默认值/上限应与实际服务方声明的能力一致,或从上游目录 / /v1/models 的 max_output_tokens 字段获取(这些模型经标准 OpenAI 兼容 /v1/models 暴露时已带该字段,实测 128000)。
实际表现 · Actual behavior
按模型名一族统一预置 384000,未区分服务方。
ZCode 版本 · ZCode version
3.12.3 (Windows)
设备 / 系统 / 浏览器 · Device / OS / Browser
Windows 11 x64
截图 / 录屏 / 日志 · Screenshots / Recordings / Logs
(无截图;以上均可在本机文件与上游接口复现)
补充
- 若实现 #226(自动获取模型列表),建议把能力值(max_output_tokens)一并获取,即可同时解决本问题。
- 相关但不同:#96(context window 被误用为 max_tokens)。
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with zcode-builtin.json and inspect modelRules[61..64] plus providerSiteRules[7..10], where the DeepSeek limits are defined. Compare the affected entries with the service limits and the OpenAI-compatible model metadata described in the issue. Done means the displayed defaults and upper bounds no longer claim a capability beyond the relevant service, with the affected rules verified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- json
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100