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

Offen Anfängerfreundlich
#62,374 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
76/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
react, typescript

Rechercherichtung

Beginne mit gui-plugins/src/context/tab.tsx und verfolge, wie die Beschriftungen der Sitzungsstatistiken dargestellt werden; im Issue sind die Werte und vorgeschlagenen Ersatztexte angegeben. Prüfe die russischen Übersetzungen in app/src/runtime/i18n/ru.ts auf die fehlenden Einträge für command.usage.view. Fertig ist die Arbeit, wenn die Statistiken die Kontextauslastung von der Kontonutzung unterscheiden und der Nutzungsbefehl russische Beschriftungen hat.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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)

Vorherrschende Sprache
TypeScript
Sterne
225k
Forks
30.4k
Ø Merge
4 Std. 8 Min.
Gemergte PRs (30 T.)
518

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus anomalyco/opencode

Alle Issues in anomalyco/opencode

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.