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

オープン 初心者向け
#62,374 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
76/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
react, typescript

調査の方向性

gui-plugins/src/context/tab.tsx から始め、セッション統計のラベルがどのように表示されるかを追ってください。issue には値と推奨される置き換えが記されています。app/src/runtime/i18n/ru.ts のロシア語翻訳を確認し、不足している command.usage.view の項目を探してください。統計でコンテキストの使用状況とアカウントのクォータが区別され、使用量コマンドにロシア語のラベルが追加されたら完了です。

索引モデルが issue の本文から書いたものです。

説明

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)

主要言語
TypeScript
スター
224k
フォーク
30k
平均マージ
4時間 44分
マージ済み PR(30日)
513

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

anomalyco/opencode のほかの issue

anomalyco/opencode の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。