Session stats panel: "Usage" shows context-window fill, not account usage — misleading when the free limit is reached

Đang mở Phù hợp với người mới
#62,374 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ệ
react, typescript

Hướng nghiên cứu

Bắt đầu với gui-plugins/src/context/tab.tsx và theo dõi cách các nhãn thống kê phiên được hiển thị; issue nêu các giá trị và nội dung thay thế được đề xuất. Kiểm tra các bản dịch tiếng Nga trong app/src/runtime/i18n/ru.ts để tìm các mục command.usage.view còn thiếu. Hoàn tất khi thống kê phân biệt mức sử dụng ngữ cảnh với hạn mức tài khoản và lệnh usage có nhãn tiếng Nga.

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

Mô tả

Description

The Context tab session stats panel uses labels that look like account limits, but they
measure the model's context window.

For opencode/deepseek-v4.1-flash-free it shows:

Лимит контекста (Context limit): 200 000
Всего токенов (Total tokens): 70 442
Использование (Usage): 35 %

while requests fail at the same time with "Free usage limit reached ... subscribe to
OpenCode Go", so it reads as if most of the allowance is still left.

Cause: gui-plugins/src/context/tab.tsx (SessionContextTab) computes
total = input + output + reasoning + cache.read + cache.write for the last assistant
message, then usage = round(total / model.limit.context * 100). The math is correct,
but "Total tokens" is the current context size, not the session total (97 messages,
70 442 tokens), and "Usage" is context-window fill, not quota.

Suggested renames: "Usage" -> "Context fill", "Total tokens" -> "Last turn tokens",
"Context limit" -> "Model context window".

Same area, minor: command.usage.view and command.usage.view.description are missing from
app/src/runtime/i18n/ru.ts, so the command stays English in the palette, while
dialog.usageExceeded.freeTier.* is translated ("Достигнут бесплатный лимит" — "Free limit
reached").

Note: the free allowance isn't available to the panel anyway — GET
/api/experimental/usage/limits returns only the Console workspace and budgets: [].

Plugins

[email protected]

OpenCode version

OpenCode version: 2.2.5 (Desktop)

Steps to reproduce
  1. OpenCode Desktop 2.2.5, UI language Russian
  2. Open a session using opencode/deepseek-v4.1-flash-free
  3. Open the Context tab -> session stats
  4. Exhaust the free allowance so requests fail with "Free usage limit reached"
  5. The stats panel still shows "Использование 35 %" ("Usage 35 %")
Screenshot
Image
Operating System

Windows 10

Terminal

OpenCode Desktop (GUI, not a terminal)

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

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.