Repository navigation
fix: bill a Cursor IDE conversation once, on its IDE row - #25
Merged
Merged
Conversation
A Cursor IDE agent writes its transcript into ~/.cursor/projects under the composer's id, the same place the Cursor CLI writes its own. The CLI scan picks it up, so each IDE conversation was listed in both cursor and cursor-ide, and the billed usage, joined on the conversation id, was added to both rows. On the author's machine all 74 conversations found in both accounts were of this kind (none has a CLI chat store), and the 30-day Cursor total read $2,197 where the usage page billed about $1,530. A cursor session whose id is a session or subagent id in a cursor-ide account is now the IDE's copy: it takes no billed usage in the session list, account totals, stats or show, and copied_from names the IDE account, so the list shows "cursor ← cursor-ide" and show says where the bill is. Rejected: dropping the copies from the CLI scan. The index would mark them missing and keep them as deleted sessions, and the transcript is still a readable record of the conversation. Tested: go test ./...; on the live index cursor went from $1,581 to $913 over 30 days, cursor plus cursor-ide is $1,529.
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.
Summary
A Cursor IDE agent writes its transcript into
~/.cursor/projectsunder the composer's id, so every IDE conversation was also listed in thecursor(CLI) account, and the billed usage joined on that id was counted on both rows. On the author's machine this inflated the 30-day Cursor total by $616 (shown $2,197, billed about $1,530).A
cursorsession whose id is a session or subagent id in acursor-ideaccount is now treated as the IDE's copy:sessions,accounts,statsandshow;copied_fromnames the IDE account, so the list showscursor ← cursor-ide;showsays the bill is incursor-ide.Both rows stay listed; dropping the copy from the scan would have left it in the index as a deleted session.
Test plan
TestCursorIDECopyBilledOnce: one conversation in both accounts plus a CLI-only one; list, account totals, dashboard and detail each bill the shared one once. Fails without the fix.go test ./...cursor30-day cost $1,581 → $913,cursor+cursor-ide= $1,529, matching the usage page window.