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

Open Beginner friendly
#62,374 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
react, typescript

Research direction

Start with gui-plugins/src/context/tab.tsx and trace how the session stats labels are rendered; the issue identifies the values and suggested replacements. Check the Russian translations in app/src/runtime/i18n/ru.ts for the missing command.usage.view entries. Done when the stats distinguish context fill from account quota and the usage command has Russian labels.

Written by the indexing model from the issue text.

Description

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)

Dominant language
TypeScript
Stars
224k
Forks
30k
Avg merge
4h 44m
Merged PRs (30d)
513

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from anomalyco/opencode

All issues in anomalyco/opencode

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.