fix(costs): align byAgent run filter to startedAt, tighten providerTabItems memo deps, stabilize byProject row keys

This commit is contained in:
Sai Shankar
2026-03-08 21:00:46 +05:30
committed by Dotta
parent 9d21380699
commit 7db3446a09
2 changed files with 11 additions and 8 deletions

View File

@@ -121,8 +121,8 @@ export function costService(db: Db) {
.orderBy(desc(sql`coalesce(sum(${costEvents.costCents}), 0)::int`));
const runConditions: ReturnType<typeof eq>[] = [eq(heartbeatRuns.companyId, companyId)];
if (range?.from) runConditions.push(gte(heartbeatRuns.finishedAt, range.from));
if (range?.to) runConditions.push(lte(heartbeatRuns.finishedAt, range.to));
if (range?.from) runConditions.push(gte(heartbeatRuns.startedAt, range.from));
if (range?.to) runConditions.push(lte(heartbeatRuns.startedAt, range.to));
const runRows = await db
.select({