diff --git a/internal/usage/gateway_alias_test.go b/internal/usage/gateway_alias_test.go index b93d07ec8..9f373c269 100644 --- a/internal/usage/gateway_alias_test.go +++ b/internal/usage/gateway_alias_test.go @@ -14,7 +14,7 @@ import ( // alias, a row for a model that is none, its cost counted twice. A call under // a model of the agent's own stays (it never went through the gateway). func TestAliasCallsAreTheGatewaysNotDirect(t *testing.T) { - now := time.Now() + now := holdClock(t, time.Date(2026, 9, 30, 12, 0, 0, 0, time.Local)) // midnight never falls between a call and Today (#6486) tk := sessions.Tokens{Input: 120, Output: 40} logs := []sessions.Call{ {Time: now.Add(-1 * time.Minute), Agent: "claude-desktop", Session: "s1", Model: "magpie-7416897221.anthropic.claude-opus-5-5", Tokens: tk}, diff --git a/internal/usage/loop_count_test.go b/internal/usage/loop_count_test.go index 41d54cc90..5ef144768 100644 --- a/internal/usage/loop_count_test.go +++ b/internal/usage/loop_count_test.go @@ -19,7 +19,7 @@ func TestLoopsCountedPerModel(t *testing.T) { t.Setenv("USERPROFILE", home) t.Setenv("XDG_CONFIG_HOME", filepath.Join(home, ".config")) t.Setenv("XDG_CACHE_HOME", filepath.Join(home, ".cache")) - now := time.Now() + now := holdClock(t, time.Date(2026, 9, 30, 12, 0, 0, 0, time.Local)) // midnight never falls between a call and Today (#6486) at := func(m int) string { return now.Add(time.Duration(m-10) * time.Second).Format(time.RFC3339Nano) } lines := []string{ // two replies of kimi ended for looping, as the gateway logs them: diff --git a/internal/usage/retried_requests_test.go b/internal/usage/retried_requests_test.go index cf8d6bede..c9564f53c 100644 --- a/internal/usage/retried_requests_test.go +++ b/internal/usage/retried_requests_test.go @@ -21,7 +21,7 @@ func TestRequestsCountedOnceWithTheirRetries(t *testing.T) { t.Setenv("USERPROFILE", home) t.Setenv("XDG_CONFIG_HOME", filepath.Join(home, ".config")) t.Setenv("XDG_CACHE_HOME", filepath.Join(home, ".cache")) - now := time.Now() + now := holdClock(t, time.Date(2026, 9, 30, 12, 0, 0, 0, time.Local)) // midnight never falls between a call and Today (#6486) at := func(m int) string { return now.Add(time.Duration(m-10) * time.Second).Format(time.RFC3339Nano) } lines := []string{ // written before handed_on: a safety refusal that a group's next