Skip to content

Commit 1317af2

Browse files
committed
Bump to 0.9.10, fix per-provider chart history for today period
The fallback daily history path (used when rangeStartStr = todayStr) was missing cache-based historical data, showing only today's bar in the trend chart. Now includes allCacheDays filtered by provider.
1 parent 58ccf84 commit 1317af2

3 files changed

Lines changed: 18 additions & 4 deletions

File tree

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codeburn",
3-
"version": "0.9.9",
3+
"version": "0.9.10",
44
"description": "See where your AI coding tokens go - by task, tool, model, and project",
55
"type": "module",
66
"main": "./dist/cli.js",

src/main.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,8 +602,21 @@ program
602602
}
603603
dailyHistory = historyFromCache
604604
} else {
605+
const histFromCache = allCacheDays.map(d => {
606+
const prov = d.providers[pf] ?? { calls: 0, cost: 0 }
607+
return {
608+
date: d.date,
609+
cost: prov.cost,
610+
calls: prov.calls,
611+
inputTokens: 0,
612+
outputTokens: 0,
613+
cacheReadTokens: 0,
614+
cacheWriteTokens: 0,
615+
topModels: [] as { name: string; cost: number; calls: number; inputTokens: number; outputTokens: number }[],
616+
}
617+
})
605618
const fallbackDays = aggregateProjectsIntoDays(scanProjects)
606-
dailyHistory = fallbackDays.map(d => {
619+
const liveDays = fallbackDays.map(d => {
607620
const prov = d.providers[pf] ?? { calls: 0, cost: 0 }
608621
return {
609622
date: d.date,
@@ -616,6 +629,7 @@ program
616629
topModels: [] as { name: string; cost: number; calls: number; inputTokens: number; outputTokens: number }[],
617630
}
618631
})
632+
dailyHistory = [...histFromCache, ...liveDays]
619633
}
620634

621635
const optimize = opts.optimize === false ? null : await scanAndDetect(scanProjects, scanRange)

0 commit comments

Comments
 (0)