What
A corrupt or partially written stats cache no longer produces NaN in the usage display.
Details
- After structural validation, the cache passes through a normaliser.
- Every per-model counter is coerced to a number defaulting to 0: input and output tokens, cache reads, cache creation, web search requests, cost, context window and max output tokens.
- Unrecognised model keys are dropped, as are hour buckets whose value is not numeric.
- A cache that fails structural validation still returns empty.
Evidence
Stats cache has invalid structure, returning empty cache
Strings lifted out of the shipped bundle, so the claim above can be checked against them.