From 9959336060227c5221222e558221acc992817d0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastiano=20Mandal=C3=A0?= Date: Tue, 1 Sep 2026 12:27:47 +0100 Subject: [PATCH] fix: show session aggregates when history is unavailable --- src/use-cache-hit-metrics.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/use-cache-hit-metrics.ts b/src/use-cache-hit-metrics.ts index a5e2f16..2af13b7 100644 --- a/src/use-cache-hit-metrics.ts +++ b/src/use-cache-hit-metrics.ts @@ -155,7 +155,10 @@ export function useCacheHitMetrics(props: { }) const mainHasStats = createMemo(() => mainSessionHasStats(main())) - const hasData = createMemo(() => lineages().length > 0 || subs().length > 0) + // Session aggregates are authoritative and may be available before the separate + // history request completes or when that request fails. Do not hide valid cache + // metrics merely because per-turn history is unavailable. + const hasData = createMemo(() => mainSessionHasStats(main()) || lineages().length > 0 || subs().length > 0) // No interactive messages in the main session: show an empty Hit row, not "0.0% warming". const noMainData = createMemo(() => lineages().length === 0)