What changed
Complete null-guard pass over every API route. No data pointer can throw an unhandled exception anymore.
api/costs
d.tokensByModel ?? {}—tokensByDateentries may lack this field on older cache files?? 0on allusage.inputTokens,outputTokens,cacheCreationInputTokens,cacheReadInputTokens,savedUSD,hitRate
api/activity
- Skip sessions where
start_timeis missing or produces an invalid date — previously wroteNaNinto the day-of-week counts array
api/export
- Replaced
stats!non-null assertion with an explicit404return — exporting with no stats cache no longer crashes
Previous releases
v0.2.3— guard missingmodelUsage/dailyActivity/hourCountsin stats/activity routes + client-side!data.computedguardv0.2.2— all 22 ESLint errors fixed, 12 fetchers hardened, SortHeader moved out of render