diff options
| author | Adam Malczewski <[email protected]> | 2026-06-10 10:34:37 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-06-10 10:34:37 +0900 |
| commit | 078158e591c3c04f2d2b5718e4626a91ab493df5 (patch) | |
| tree | 6404b4b611578bb86601bd1681f026648cde1e85 /src/features/surface-host | |
| parent | e8d19f077d315f212c1bd6fb0d86738fad188b3c (diff) | |
| download | dispatch-web-078158e591c3c04f2d2b5718e4626a91ab493df5.tar.gz dispatch-web-078158e591c3c04f2d2b5718e4626a91ab493df5.zip | |
feat(metrics): inline cache hit-rate badges (last turn + chat total)
Derive cache hit rate (cacheReadTokens / inputTokens) from data already
folded in core/metrics — no backend/contract change.
- core/metrics: computeCachePct + viewCacheRate (pct + success/warning/error
level by 66/33 thresholds + isHit); thread a running cumulativeUsage onto
each finalized turn-metrics row for the conversation total.
- ChatView: render two labelled, colour-coded percentage badges in the
turn-total bubble — "Last turn:" (that turn) and "Chat Total:" (cumulative).
- Honour backend caveats: absent cache fields -> 0, divide-by-zero guarded,
a legitimate 0% renders plainly (not "no data").
Diffstat (limited to 'src/features/surface-host')
0 files changed, 0 insertions, 0 deletions
