Skip to content

Cursor provider inflates "Today" usage when Cursor stays running (agentKv timestamp drift) #460

@TFOTG

Description

@TFOTG

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions