Problem
Today usage for Cursor can become abnormally high (cost/calls), especially when Cursor keeps running for a long time.
Observed pattern:
- Today shows inflated values.
- Next day, previous day looks normal again.
- But the new Today becomes inflated again.
This looks like historical records being repeatedly bucketed into the current date.
Likely cause
In src/providers/cursor.ts, bubbleId:% rows are mostly guarded by createdAt, but agentKv:blob:% rows do not have reliable per-row timestamps.
The agentKv path uses a shared runtime-derived timestamp (DB mtime / now fallback behavior), so older usage can drift into whatever day the command runs.
Suggested fix
- Do not assign
new Date() (or runtime-derived day) to rows without reliable timestamps.
- Safest approach: skip
agentKv rows for day-based stats until per-row timestamps are available.
- If Cursor later provides a stable timestamp field in
agentKv, only include rows with valid parsed timestamps.
Note
I used AI-assisted code tracing to locate and verify the affected parse paths quickly, sharing this as a reference for maintainers.
Problem
Todayusage for Cursor can become abnormally high (cost/calls), especially when Cursor keeps running for a long time.Observed pattern:
This looks like historical records being repeatedly bucketed into the current date.
Likely cause
In
src/providers/cursor.ts,bubbleId:%rows are mostly guarded bycreatedAt, butagentKv:blob:%rows do not have reliable per-row timestamps.The
agentKvpath uses a shared runtime-derived timestamp (DB mtime / now fallback behavior), so older usage can drift into whatever day the command runs.Suggested fix
new Date()(or runtime-derived day) to rows without reliable timestamps.agentKvrows for day-based stats until per-row timestamps are available.agentKv, only include rows with valid parsed timestamps.Note
I used AI-assisted code tracing to locate and verify the affected parse paths quickly, sharing this as a reference for maintainers.