Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

small_model is silently ignored once its model is marked deprecated in the catalog

未关闭 适合新手
#51,159 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
82/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
typescript
领域
backend, cli

调研方向

从 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):

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
  1. In an empty project, add .opencode/opencode.json with DeepSeek credentials configured (opencode models deepseek no longer lists this id):
    { "small_model": "deepseek/deepseek-v4-flash" }
    
  2. Run opencode run --print-logs -m deepseek/deepseek-v4-pro "Reply with exactly: MODEL_OK".
  3. 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

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

anomalyco/opencode 的其他 Issue

查看 anomalyco/opencode 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。