desktop: Go usage meter missing when the opencode group has only free models

Đang mở Phù hợp với người mới
#68,063 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
76/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
frontend

Hướng nghiên cứu

Bắt đầu với mã bộ chọn mô hình nhóm các nhà cung cấp workspace và hiển thị tiêu đề nhóm; issue chỉ ra phần kiểm tra tiền tố tên workspace và điều kiện tiêu đề workspace: "lead". Theo dõi cách opencode-go được phân loại khi opencode không có mô hình trả phí, sau đó kiểm tra các bài kiểm thử của bộ chọn hoặc bổ sung kiểm thử cho trường hợp đó. Hoàn tất khi tiêu đề tài khoản Go và đồng hồ đo mức sử dụng xuất hiện dù chỉ có các mô hình miễn phí opencode; hành vi thử lại được báo cáo là một follow-up riêng.

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

Mô tả

area/providers inference/free-tier inference/go platform/windows status/repro-plausible type/bug version/v2

Summary

On desktop 2.4.4, the OpenCode Go usage meter added to the model picker is not rendered for a Go-only workspace. The meter is attached to the opencode (Console) workspace group header, but that group is dropped when it contains only free models, which are moved to the separate Free section. The opencode-go group then appears as a plain OpenCode Go label with no account or usage meter.

Environment

  • opencode version: 2.4.4 (desktop; the npm CLI on PATH is 1.19.6)
  • Client: desktop app, Windows
  • Model and provider: opencode-go/deepseek-v4.1-flash
  • OS: Windows 11, 10.0.26300 x64
  • Terminal: Not applicable (desktop app)
  • Shell: cmd.exe
  • Install/channel: desktop stable, latest (v2.4.4, 2026-12-03)
  • Active plugins: none found; MCP servers browse and opencode_console

Reproduction

  1. Sign in to an OpenCode Console workspace with an active Go subscription.
  2. Use a workspace whose managed config disables the paid opencode models. In this case all 100 opencode models are disabled; only free models such as deepseek-v4.1-flash-free and hy4-flash-free remain.
  3. Open the desktop model picker (click the current model name in the composer).
  4. Observe the OpenCode section.

Expected Behavior

The picker shows the OpenCode account header with the Go badge and the 5-hour/weekly/monthly usage meter, as described in the 2.4.4 release notes ("a Go usage meter" in the model picker), even when the paid opencode group is empty.

Actual Behavior

No OpenCode account/usage header is rendered. The picker shows a plain OpenCode Go group label followed by the Go models. The free opencode models appear under Recent/Free. GET /api/experimental/usage/limits returns valid go data for the workspace (rolling/weekly/monthly), so the data is available; only the header is missing from the UI.

Adding this to the user config makes the meter appear (replace <workspace> with the workspace name):

"providers": {
  "opencode-go": {
    "name": "<workspace> / OpenCode Go"
  }
}

The cause is that the picker builds the workspace provider set from providers whose name starts with <workspace> / . Here opencode is named <workspace> / OpenCode, while opencode-go is named just OpenCode Go, so it is not included. The Go meter is only rendered in the header of the group with workspace: "lead"; with the opencode group empty and opencode-go not recognized, no header is rendered.

Additional Context

  • /api/config managed document: opencode has 100 disabled models; opencode-go has 0 disabled.
  • /api/provider: opencode name <workspace> / OpenCode; opencode-go name OpenCode Go.
  • The model picker groups workspace providers only when their name starts with the workspace prefix; opencode-go does not, so it gets a normal group header.
  • Secondary issue: after a transient GET /api/experimental/usage/limits 503 caused by DNS failure (getaddrinfo ENOTFOUND opencode.ai), the meter stayed hidden after the endpoint recovered; it only returned after an app restart. A retry on failure would help.
  • Related: #66849 (added the Go meter), #66829 (open draft for a dedicated Go settings page).
  • Frequent: reproducible consistently for this workspace; the name override is the current workaround.
Ngôn ngữ chính
TypeScript
Star
230k
Fork
31.3k
Merge trung bình
6 giờ
Pull request đã merge (30 ngày)
528

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.