Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: keep the current usage month partial through month end

[._.]/ Adam Eivy2d0ec4287da2
diff --git a/server/services/usage.js b/server/services/usage.js
index 36edc4e2c6..3c55679022 100644
--- a/server/services/usage.js
+++ b/server/services/usage.js
@@ -1152,7 +1152,7 @@ function monthlyUsageHistory(providers) {
estimatedCost: totals.estimatedCost,
tokens: totals.tokensIn + totals.tokensOut + totals.cacheReadTokens + totals.cacheWriteTokens,
source: totals.source,
- partial: today < end || firstDay > `${month}-01`,
+ partial: month === today.slice(0, 7) || firstDay > `${month}-01`,
};
}).filter(Boolean);
}
diff --git a/server/services/usage.test.js b/server/services/usage.test.js
index 5bdbd32926..4099a846e9 100644
--- a/server/services/usage.test.js
+++ b/server/services/usage.test.js
@@ -76,6 +76,7 @@ describe('usage.js — summary', () => {
});
it('reports calendar months independently of the filter, preserving rollups and cache tokens', async () => {
+ vi.setSystemTime(new Date('2025-06-30T23:59:59Z'));
readJSONFile.mockResolvedValueOnce(makeUsage({
'2025-06-01': { byProvider: { example: { tokensIn: 10, tokensOut: 20, cacheReadTokens: 30, cacheWriteTokens: 40, source: 'measured' } } },
'2025-06-10': { tokens: 5 },