small_model is silently ignored once its model is marked deprecated in the catalog
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 82/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
调研方向
从 packages/opencode/src/provider/provider.ts 中第 1694 行附近的 deprecated-model 移除逻辑,以及第 1942-1946 行的 getSmallModel catch 开始。跟踪 getModel 如何生成“Did you mean”建议,然后检查 packages/opencode/src/session/prompt.ts 第 218-221 行中的 title-agent 回退逻辑。完成的标准是:deprecated small_model 仍然回退到 session model,但会发出 WARN,标识被忽略的配置以及有助于查找的详细信息。
由索引模型根据 Issue 内容生成。
描述
Description
If the model set as small_model is later marked deprecated in the catalog, OpenCode drops it from the provider and Provider.getSmallModel turns the lookup error into undefined without logging anything. The title agent then quietly falls back to the session's main model.
The config never changes, so from the user's side this is a silent behavior change on the day the catalog updates. For me it was deepseek/deepseek-v4-flash, marked deprecated in anomalyco/models.dev#7727. The DeepSeek API still accepts that alias (it is served by V4.1 Flash), so the configured model itself kept working; only OpenCode stopped using it. From then on every session title ran on my main model, Claude Opus 5.5 through a subscription proxy, instead of DeepSeek. That spent subscription quota and triggered a title/first-turn race in the proxy (rynfar/meridian#1024), which took a while to trace back to this one config line.
The same id used as the main model fails loudly, with a useful hint (from the log):
ProviderModelNotFoundError: Model not found: deepseek/deepseek-v4-flash. Did you mean: deepseek-flash, deepseek-v4-pro?
As small_model it produces nothing, not even with --log-level DEBUG.
Relevant code on dev (0f54984):
- deprecated models are deleted from the provider: provider.ts#L1694
getSmallModelcatchesProviderModelNotFoundErrorand returnsundefined: provider.ts#L1942-L1946- the title agent then uses the session model: prompt.ts#L218-L221
I understand the fallback itself is intentional, so I'm not asking to remove it, only to make it visible: a WARN in that catchTag, ideally reusing the "Did you mean" suggestions that getModel already computes. #31092 proposed the warning part for #31042, but both were closed automatically by the cleanup bots before anyone reviewed them.
Plugins
[email protected], context-mode (loaded globally; the repro below does not go through them)
OpenCode version
1.18.32
Steps to reproduce
- In an empty project, add
.opencode/opencode.jsonwith DeepSeek credentials configured (opencode models deepseekno longer lists this id):{ "small_model": "deepseek/deepseek-v4-flash" } - Run
opencode run --print-logs -m deepseek/deepseek-v4-pro "Reply with exactly: MODEL_OK". - The title request streams with the main model, and no log line mentions
small_model:level=INFO message=stream providerID=deepseek modelID=deepseek-v4-pro small=true agent=title mode=primary level=INFO message=stream providerID=deepseek modelID=deepseek-v4-pro small=false agent=build mode=primary
Operating System
Windows 11 Pro (10.0.26200)
Terminal
WezTerm with Git Bash (not terminal-specific)
- 主要语言
- TypeScript
- 星标
- 210k
- 派生
- 27.8k
- 平均合并
- 8 小时 1 分钟
- 30 天内合并 PR
- 357
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
anomalyco/opencode 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
查看 anomalyco/opencode 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
rohitg00/agentmemory#1428 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 86/100
boxlite-ai/boxlite#1729 ·
维护者通常 1 天内回复
-
detectors enhancement good first issue
难度 2/5 1-3 小时 新手友好度 86/100
SM260845/readme-gen#1 ·
-
难度 2/5 1-3 小时 新手友好度 88/100
angular/angularfire#3774 ·
维护者通常 2 天内回复