small_model is silently ignored once its model is marked deprecated in the catalog
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 82/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
Hướng nghiên cứu
Bắt đầu trong packages/opencode/src/provider/provider.ts, xung quanh phần loại bỏ deprecated-model ở dòng 1694 và catch của getSmallModel ở các dòng 1942-1946. Theo dõi cách getModel tạo các gợi ý “Did you mean”, sau đó kiểm tra fallback của title-agent trong packages/opencode/src/session/prompt.ts ở các dòng 218-221. Hoàn thành có nghĩa là một deprecated small_model vẫn fallback về session model nhưng phát ra một WARN xác định cấu hình bị bỏ qua và các chi tiết hữu ích để tra cứu.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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)
- Ngôn ngữ chính
- TypeScript
- Star
- 210k
- Fork
- 27.8k
- Merge trung bình
- 6 giờ 50 phút
- Pull request đã merge (30 ngày)
- 336
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của anomalyco/opencode
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của anomalyco/opencode
Issue tương tự
-
needs:triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
ai-discovered
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
jessepollak/home#1627 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
agent-canvas bug llm priority:low ready-for-dev
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
OpenHands/OpenHands#17806 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
radius-project/ai-extensions#923 ·
Maintainer thường phản hồi trong vòng 1 ngày