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

[FEATURE]: app: "Free" badge in model picker is limited to the opencode provider

Đang mở Phù hợp với người mới
#59,302 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
78/100
Loại issue
Tính năng
Độ 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
frontend

Hướng nghiên cứu

Đọc packages/app/src/providers/models/models.tsx và so sánh kiểm tra mô hình miễn phí trong đó với kiểm tra không phụ thuộc vào nhà cung cấp ở packages/tui/src/component/model-options.tsx. Cập nhật điều kiện của huy hiệu Desktop để khớp với hành vi đã nêu khi chi phí đầu vào bằng 0 ở mọi bậc chi phí. Hoàn tất khi các mô hình từ bất kỳ nhà cung cấp nào có chi phí đầu vào bằng 0 đều hiển thị huy hiệu Free, không thay đổi định tuyến hay tính phí.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Feature hasn't been suggested before.
  • I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request

What: In OpenCode Desktop, the "Free" badge next to a model name in the model picker is only shown for models served by the opencode provider, even when models on other providers have zero cost.

The check is hard-coded to the provider in packages/app/src/providers/models/models.tsx:

export const isFreeModel = (model: { provider: { id: string }; cost?: { input: number } }) =>
  model.provider.id === "opencode" && (!model.cost || model.cost.input === 0)

The TUI uses a provider-agnostic check in packages/tui/src/component/model-options.tsx (cost.length > 0 && cost.every((c) => c.input === 0)), so the same model shows a "Free" tag in the terminal but no badge in Desktop.

Request: Show the "Free" badge based on cost alone (zero input cost across all cost tiers), regardless of provider, matching the TUI behavior.

Why it's useful: Users with self-hosted or free endpoints (e.g. a LiteLLM proxy in front of free/university models) configure cost.input: 0 on those models, but Desktop gives them no visual marker in the picker. Currently the only workaround is putting "Free" in the model display name, which is inconsistent with how built-in providers are labeled.

Expected result: Any model whose input cost is zero shows the same "Free" badge as OpenCode's own free models. No routing or billing behavior changes.

Environment: OpenCode Desktop 2.1.4 (desktop-ssh), server on Linux x86_64 (Debian 13).

Ngôn ngữ chính
TypeScript
Star
221k
Fork
29.6k
Merge trung bình
4 giờ 55 phút
Pull request đã merge (30 ngày)
500

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.