Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở Phù hợp với người mới
#51,159 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

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
Lĩnh vực
backend, cli

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

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)

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

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của anomalyco/opencode

Tất cả issue của anomalyco/opencode

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.