feat(usage): index Cursor sessions without inventing tokens - #579
Open
vc1492a wants to merge 4 commits into
Open
feat(usage): index Cursor sessions without inventing tokens#579vc1492a wants to merge 4 commits into
vc1492a wants to merge 4 commits into
Conversation
Widen UsageProvider with a closed USAGE_PROVIDERS set and decodeUsageProvider that drops unknown rows. Track unmeteredMessageCount and widen costIncomplete so missing Cursor metering cannot render as a complete $0.00. Co-authored-by: Cursor <cursoragent@cursor.com>
Parse assistant lines from ~/.cursor agent transcripts with tokens null, bind sessions via chat UUID and meta.json cwd, and keep Claude remappers from swallowing Cursor rows. Mixed panes keep metered dollars and mark costIncomplete when unmetered messages are present. Co-authored-by: Cursor <cursoragent@cursor.com>
Regenerate the runpane contract for cursor + unmeteredMessageCount, teach panes cost and the usage dashboard to show incomplete Cursor cost without fake dollars, and keep leaderboard rankings on metered spend only. Co-authored-by: Cursor <cursoragent@cursor.com>
Align parse/seed/manager docs with unmetered assistant events and empty Cursor seeds, drop the fake SAFETY on pane id lookup, and stop calling the provider chart Anthropic vs OpenAI. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Cursor panes currently show 0 tokens / 0 messages in the usage dashboard,
runpane panes cost, and leaderboard. Claude and Codex are indexed from durable JSONL; Cursor is not. Interactivecursor-agentcan compute tokens in memory for--printJSON, but Pane launches a TTY session and~/.cursortranscripts only persist{role, message}/turn_endedlines — there is no durable token meter to invent from.Scope
cursorto the closedUSAGE_PROVIDERSset withdecodeUsageProvider(unknown rows drop; never remap to Claude).~/.cursor/projects/**/agent-transcripts/**/*.jsonlas unmetered events (tokens: null) counting assistant lines.meta.jsoncwd (never invert project slug).unmeteredMessageCountand honestcostIncomplete(idle Cursor panes never fake$0.00; mixed panes keep Claude dollars + unmetered footnote).Tradeoffs
costIncompleterather than rendering a complete zero-dollar slice.Blast Radius
usage_events(meteredcolumn), aggregator, runpane contract,panes cost, usage UI, leaderboard types/service.Verification
pnpm --filter main exec vitest run src/services/usage— 132 tests, exit 0pnpm --filter main exec tsc --noEmit— exit 0pnpm --filter frontend exec tsc --noEmit— exit 0node scripts/generate-runpane-contract.js— exit 0runpane panes costagainst a real Cursor pane — not run (do not restart Pane.app in this session)Made with Cursor