You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cursor bubbles with no createdAt are timestamped as "now", inflating today's usage #326
Cursor sessions show up as "today's usage" even when Cursor hasn't been launched in weeks. On my machine, CodeBurn 0.9.8 reported 317 Cursor calls / $7.57 for 2026-05-13, while every file under ~/Library/Application Support/Cursor/ had an mtime of 2026-04-23 or earlier and Cursor.app was not running.
Repro
Have a long-lived Cursor globalStorage/state.vscdb (mine is ~1 GB).
Don't open Cursor for several weeks.
Run codeburn today --provider cursor.
Expected: empty / no data for today.
Actual: hundreds of "today" calls, costed at Sonnet rates.
Root cause
In src/providers/cursor.ts (verified against dist/cli.js in the published 0.9.8 build):
BUBBLE_QUERY_SINCE_HEAD deliberately keeps rows with a missing createdAt:
AND (json_extract(value, '$.createdAt') > ? OR json_extract(value, '$.createdAt') IS NULL)
In parseBubbles, when created_at is null, the JS falls back to Date.now():
So every undated historical bubble is stamped with the current wall-clock time and bucketed into today.
Suggested fix
Drop rows with no usable timestamp instead of dating them to now — either:
Remove the IS NULL branch from the SQL filter, or
In parseBubbles, continue when createdAt is missing/invalid.
If older bubbles legitimately have an alternative timestamp field (e.g. on the parent composer), use that as a fallback before falling through to Date.now().
Environment
macOS 24.6.0 (Darwin)
Node 22.19.0 (also reproduced on the bottled node 26.0.0 via Homebrew install)
Likely related to #325 — same user-visible symptom (historical Cursor usage attributed to today). That issue proposes file mtime as the fallback source; this one traces the fallback to new Date().toISOString() in parseBubbles (via the SQL createdAt IS NULL branch). May be the same bug with a misidentified cause, or two parallel mtime-/now-fallback paths worth fixing together.
Confirmed and fixed. Your diagnosis was exactly right: the code at the time had
consttimestamp=createdAt||newDate().toISOString()
with the bubble query including createdAt IS NULL rows, so timestampless bubbles landed on "today". The agentKv path had the sibling bug (#325): every stream call was stamped new Date() unconditionally.
Both were fixed in #254: the bubble scan now requires createdAt IS NOT NULL and the parser skips rows without it entirely (no fallback), and agentKv calls use the database file's mtime as a bounded last-write time instead of "now". First shipped in v0.9.7, which explains the timing: the fix merged two days before this issue was filed, so the release you were running predated it.
Since then the Cursor parser was rebuilt again (#575, in 0.9.15): conversation-level usage is now anchored to the conversation's own creation time, so day attribution no longer depends on parse timing at all. The only remaining new Date() is a last-resort fallback when the database file cannot even be stat'ed.
Closing as fixed in v0.9.7 and hardened further in 0.9.15. If you still see historical Cursor usage attributed to today on a current version, please reopen with the version number.
Reopening per the request above — same symptom, reproduced on a current version well past both the v0.9.7 and v0.9.15 (#575) fixes.
Version: codeburn 0.9.19 (also present on 0.9.15 before upgrading)
Repro: Two codeburn export --format json --from <today> --to <today> runs taken ~10 minutes apart on the same day. In both, the overwhelming majority of cursor-labeled session entries (1032 of 1034) shared one identical Started At timestamp — and that timestamp shifted between runs to match each run's execution time almost exactly:
Run 1 (11:42 UTC): 1032 entries stamped 2026-08-10T11:42:01.123Z
Run 2 (11:52 UTC, after the 0.9.15→0.9.19 upgrade): 1032 entries stamped 2026-08-10T11:52:05.851Z
Only 2 of the ~1034 cursor entries had distinct, plausible per-turn timestamps. Net effect: the "Today" total (codeburn status, menu bar) is dominated by this undated backlog, re-attributed to whichever day the report happens to be run on.
Why this is probably a different code path than the earlier fixes:#325/#326/#460 all trace to the legacy extension storage (store.db SQLite bubbles / agentKv blobs). Given #55 added support for the newer ~/.cursor/projects/*/agent-transcripts/*.jsonl format (used by current Cursor/cursor-agent CLI installs), it looks like that parser may have reintroduced the same "no usable timestamp → stamp with Date.now()" pattern in a spot the 0.9.7/0.9.15 hardening never touched, since the earlier fixes predate #55.
Full write-up with environment details and the expected/suggested fix is in #953 (closing that one in favor of this thread to keep history together). Happy to share the raw redacted export JSON if it helps narrow down the source.
Activity
amosweckstrom commentedon May 13, 2026
Likely related to #325 — same user-visible symptom (historical Cursor usage attributed to today). That issue proposes file
mtimeas the fallback source; this one traces the fallback tonew Date().toISOString()inparseBubbles(via the SQLcreatedAt IS NULLbranch). May be the same bug with a misidentified cause, or two parallel mtime-/now-fallback paths worth fixing together.iamtoruk commentedon Jul 2, 2026
Confirmed and fixed. Your diagnosis was exactly right: the code at the time had
with the bubble query including
createdAt IS NULLrows, so timestampless bubbles landed on "today". The agentKv path had the sibling bug (#325): every stream call was stampednew Date()unconditionally.Both were fixed in #254: the bubble scan now requires
createdAt IS NOT NULLand the parser skips rows without it entirely (no fallback), and agentKv calls use the database file's mtime as a bounded last-write time instead of "now". First shipped in v0.9.7, which explains the timing: the fix merged two days before this issue was filed, so the release you were running predated it.Since then the Cursor parser was rebuilt again (#575, in 0.9.15): conversation-level usage is now anchored to the conversation's own creation time, so day attribution no longer depends on parse timing at all. The only remaining
new Date()is a last-resort fallback when the database file cannot even be stat'ed.Closing as fixed in v0.9.7 and hardened further in 0.9.15. If you still see historical Cursor usage attributed to today on a current version, please reopen with the version number.
dhinic-swap-tmp commentedon Aug 10, 2026
Reopening per the request above — same symptom, reproduced on a current version well past both the v0.9.7 and v0.9.15 (#575) fixes.
Version: codeburn 0.9.19 (also present on 0.9.15 before upgrading)
Repro: Two
codeburn export --format json --from <today> --to <today>runs taken ~10 minutes apart on the same day. In both, the overwhelming majority ofcursor-labeled session entries (1032 of 1034) shared one identicalStarted Attimestamp — and that timestamp shifted between runs to match each run's execution time almost exactly:2026-08-10T11:42:01.123Z2026-08-10T11:52:05.851ZOnly 2 of the ~1034
cursorentries had distinct, plausible per-turn timestamps. Net effect: the "Today" total (codeburn status, menu bar) is dominated by this undated backlog, re-attributed to whichever day the report happens to be run on.Why this is probably a different code path than the earlier fixes: #325/#326/#460 all trace to the legacy extension storage (
store.dbSQLite bubbles /agentKvblobs). Given #55 added support for the newer~/.cursor/projects/*/agent-transcripts/*.jsonlformat (used by current Cursor/cursor-agent CLI installs), it looks like that parser may have reintroduced the same "no usable timestamp → stamp withDate.now()" pattern in a spot the 0.9.7/0.9.15 hardening never touched, since the earlier fixes predate #55.Full write-up with environment details and the expected/suggested fix is in #953 (closing that one in favor of this thread to keep history together). Happy to share the raw redacted export JSON if it helps narrow down the source.