From ded7474b2baaad128beb18fc663a8688f5e0c74d Mon Sep 17 00:00:00 2001 From: iris Date: Fri, 5 Jun 2026 22:22:48 +0200 Subject: [PATCH] feat(stats): cache hit-rate, tokens/turn, and result trend over time MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit First slice of #1424 (per-agent /stats enrichments): - Backend: add per-bucket result_counts to the stats Snapshot (mirrors model_counts), so result outcomes can be charted over time, not just as a window total. - Frontend: two new summary chips — cache hit-rate % (cached input vs all input-side tokens) and avg tokens/turn — both derived from the existing per-bucket token sums. Plus a stacked result-trend chart so error / rate-limit / compaction spikes are visible across the window. Hive-wide aggregate, cost estimate, and container resource load land in follow-up PRs. --- frontend/packages/agent/src/stats.html | 1 + frontend/packages/agent/src/stats.js | 54 ++++++++++++++++++++++++++ hive-ag3nt/src/stats.rs | 8 ++++ 3 files changed, 63 insertions(+) diff --git a/frontend/packages/agent/src/stats.html b/frontend/packages/agent/src/stats.html index 1ce7c065..52076b78 100644 --- a/frontend/packages/agent/src/stats.html +++ b/frontend/packages/agent/src/stats.html @@ -35,6 +35,7 @@

top tools

wake source mix

result mix

+

result trend per bucket — errors / rate-limits / compactions over time