diff --git a/internal/usage/cleared_test.go b/internal/usage/cleared_test.go index b779f6cd2..d35df08cb 100644 --- a/internal/usage/cleared_test.go +++ b/internal/usage/cleared_test.go @@ -17,6 +17,9 @@ import ( // Visit (key spending limits, window holds) still counts them all. func TestClearedUsageLeavesThePages(t *testing.T) { resetUsageTest(t) + // the clears read last stay read for a test that builds a page without + // reading them again (readCleared) + t.Cleanup(func() { clearedAs.Store(nil) }) now := Clock() at := now.Add(-2 * time.Hour) Append(Record{Time: at, Agent: "codex", Provider: "ollama", Model: "qwen3:32b", Input: 100, Output: 10, Status: 200})