Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/commands/statusline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,13 +303,19 @@ export const statuslineCommand = define({
const today = new Date();
const todayStr = today.toISOString().split('T')[0]?.replace(/-/g, '') ?? ''; // Convert to YYYYMMDD format

// Only process files modified after midnight today for daily data
const midnightToday = new Date();
midnightToday.setHours(0, 0, 0, 0);

const todayCost = await Result.pipe(
Result.try({
try: async () => loadDailyUsageData({
since: todayStr,
until: todayStr,
mode: 'auto',
offline: mergedOptions.offline,
minUpdateTime: midnightToday,
includeContent: false,
}),
catch: error => error,
})(),
Expand All @@ -325,11 +331,16 @@ export const statuslineCommand = define({
);

// Load session block data to find active block
// Only process files modified in the last 24 hours for block data
// This ensures we capture the current blocks without processing all historical data
const lastBlocksTime = new Date(Date.now() - 24 * 60 * 60 * 1000);

const { blockInfo, burnRateInfo } = await Result.pipe(
Result.try({
try: async () => loadSessionBlockData({
mode: 'auto',
offline: mergedOptions.offline,
minUpdateTime: lastBlocksTime,
}),
catch: error => error,
})(),
Expand Down
Loading