Skip to content

fix(web): clarify token usage labels in message details#1062

Open
techotaku39 wants to merge 1 commit into
tiann:mainfrom
techotaku39:fix/web-message-token-metadata
Open

fix(web): clarify token usage labels in message details#1062
techotaku39 wants to merge 1 commit into
tiann:mainfrom
techotaku39:fix/web-message-token-metadata

Conversation

@techotaku39

Copy link
Copy Markdown
Contributor

Problem

The message-details popover labels input_tokens + output_tokens as "billable tokens":

Usage: 125 billable tokens (100 in / 25 out)

That wording makes a billing claim the UI cannot reliably support across providers. The available message metadata only describes token counts; provider-specific pricing can treat cache I/O and other token categories differently. The existing Usage / Total label also changes between single-turn and aggregated response groups even though both rows present the same token metric.

Solution

Use one neutral, explicit token label for both single-turn and aggregated message details:

Tokens: 125 total (100 in / 25 out)

The total remains exactly input_tokens + output_tokens; only the presentation changes. The existing input/output breakdown, number formatting, model/tier metadata, and multi-turn count remain unchanged.

Touch-device access needs no additional change here: current main already keeps the message info action reachable on touch devices via #1046.

Testing

  • bun typecheck
  • bun run test:cli
  • bun run test:hub
  • bun run test:web — 155 files, 1,259 tests passed
  • bun run test:shared
  • Focused message metadata/action tests — 19 tests passed
  • git diff --check

Manual verification

Built the production web bundle and embedded hub assets, then served the result on a local HAPI hub. Verified that the emitted bundle contains the new Tokens: … total (… in / … out) format and no longer contains billable tokens.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Findings
No findings.

Summary
Review mode: initial
No issues found in the changed lines. Residual risk: this was a static review only; I did not execute the PR tests in this automation pass.

Testing
Not run (automation)

HAPI Bot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant