Skip to content

fix(elements): include reasoning and cache costs in context total - #462

Open
ephraimduncan wants to merge 1 commit into
vercel:mainfrom
ephraimduncan:fix/context-total-cost
Open

fix(elements): include reasoning and cache costs in context total#462
ephraimduncan wants to merge 1 commit into
vercel:mainfrom
ephraimduncan:fix/context-total-cost

Conversation

@ephraimduncan

Copy link
Copy Markdown

The Context popover could show non-zero Reasoning and Cache line items directly above a "Total cost" that excluded both, so the visible breakdown didn't add up and users could underestimate a response's cost. The footer now prices the same four usage categories the row components display — input, output, reasoning tokens, and cached input reads — keeping all model-specific pricing in tokenlens rather than summing rounded strings.

Added a footer test using vercel:xai/grok-3-mini-fast (a model that prices all four categories) with token counts sized so omitting any single category changes the cent-rounded rendered total; it fails against the previous footer, passes now, and also asserts the unrounded aggregate reconciles with the sum of the four per-row prices.

@vercel

vercel Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

@ephraimduncan is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

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