Show per-model cached tokens alongside cost in desktop and menubar - #1265
Open
ozymandiashh wants to merge 1 commit into
Open
Show per-model cached tokens alongside cost in desktop and menubar#1265ozymandiashh wants to merge 1 commit into
ozymandiashh wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Previously, the menubar payload discarded per-model token counts, Overview had no cache-read column, and the desktop Models table hid usage when a model had no attributed cost. A menubar row now includes a secondary line such as
12.3K in · 4.5K out · 67.8K cache read, with its cost on the primary line.Cache-read means reused input. Cache pricing was already included in attributed cost; this change exposes usage without changing pricing. Cache-write remains a separate payload field and is included in the macOS accessibility description. Reasoning is added to output only where the provider reports it separately.
The new fields are optional. Older payloads still decode, missing counts remain unknown, and known zero stays zero. Alias merges do not present partial counts when a contributor lacks data. Overview uses the period/provider-scoped model rows when available, with its previous daily-history source retained for older payloads. The existing 20-model cap remains. Daily/session cache formats and stored history are unchanged.
Testing
npm testpasses in the completed branch validation runnpm run buildsucceedsValidation against the unchanged
mainbase (4a9d8852):cli-status-menubar.test.ts: their fixture offsets placed calls in the future. The entire file passed 23/23 on rerun after that window; the other 3,725 tests passed in the full run.usePolledand sixoverviewSnapshotfailures occur under local Node 26 with unavailable jsdom localStorage; no new failures.git diff --checkis clean.The new CLI regression plants a render-v5 snapshot without token fields, verifies that the new binary recomputes the counts, then requires the next identical call to leave the snapshot byte-identical. Pipeline fixtures also cover fresh versus durable history, provider/range selection, alias merging, cache-only usage and unpriced models.
Real Hermes data returns
input=139, output=393, cacheRead=30,592, cacheWrite=0with the existing attributed cost unchanged. A 15-model real corpus also reconciled model counts with the period totals.Layout was checked using the actual branch components with fixture data: native SwiftUI views at the 360pt popover width, and desktop Overview/Models at 1200px and 900px. An additional 900px check reserved the 186px sidebar and applied the real content padding. Cache values, costs and zero-cost usage remain visible. These are isolated component/native-view renders, not validation of an installed release; no installed applications were replaced.