From 26f82f35dbe5410cd173bfcd96f694af40c76509 Mon Sep 17 00:00:00 2001 From: joshua Date: Mon, 26 Oct 2026 02:37:31 +0000 Subject: [PATCH] fix(ui): cap sub-day rollup routing at 24 hours Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- .../src/components/shared/date_range_presets.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/litellm-dashboard/src/components/shared/date_range_presets.ts b/ui/litellm-dashboard/src/components/shared/date_range_presets.ts index 115d03af547..1da3185bef4 100644 --- a/ui/litellm-dashboard/src/components/shared/date_range_presets.ts +++ b/ui/litellm-dashboard/src/components/shared/date_range_presets.ts @@ -8,11 +8,11 @@ export interface RelativeTimeOption { } /** Widest window the sub-day (ClickHouse rollup) usage path serves; longer ranges use the daily tables. */ -export const SUB_DAY_MAX_RANGE_MS = 7 * 24 * 60 * 60 * 1000; +export const SUB_DAY_MAX_RANGE_MS = 24 * 60 * 60 * 1000; /** - * A range that does not start at a local midnight is a sub-day investigation window - * (Last 1h, 14:05 to 14:35): it is served from spend-log rollups and never snapped to day edges. + * A window of at most 24 hours that does not start at a local midnight is a sub-day investigation + * window (Last 1h, 14:05 to 14:35): it is served from spend-log rollups and never snapped to day edges. */ export const isSubDayRange = (from: Date, to: Date): boolean => !moment(from).isSame(moment(from).startOf("day")) && to.getTime() - from.getTime() <= SUB_DAY_MAX_RANGE_MS;