Cursor's dashboard usage accounting is kept per account, not per conversation.
claimed, owed and flights were keyed by conversation_id alone. When one
conversation's steps ran on two accounts (magpie moving a session between
Cursor accounts), account B's Run collected A's debt from B's own dashboard:
B's own event was counted as A's earlier Run's usage (magpie_deferred) and
B's turn-ending step polled for a debt its dashboard can't have. The keys
are now sha256(token) + conversation_id (usageKey), used by collect, owe,
ledger and the flights cleanup alike. A token change starts a new identity,
as misses/unreadable already were keyed.
Reviewed at 19bbdf8d7162735d7ddafd015d8dfadbb233c3bd, then merged main
(ca6415f, #130) into the branch at 74578e51e4214b75056746aa81ecc8fcba104ed2;
the only conflict was the _internal export line (both openH2 and usageKey
kept). Diff against main unchanged (168+/34-).
- full `bun test` (isolated HOME/TMPDIR): at 19bbdf8 1267 pass/0 fail; at
74578e5 (with #130) 1292 pass/0 fail; `bun scripts/check.mjs` ok; PR CI
green at 74578e5.
- own test: A owes one Run on conv, the next step runs on B whose dashboard
shows B's own event. On main B's owed(true) returns B's event as A's debt
and polls B's dashboard; here it returns null with no request, and A later
collects its own event.
- broke by hand: usageKey back to conversation alone fails the three new
stepusage tests.
Not tried: real Cursor accounts. A conversation moving accounts leaves the
first account's collected-but-unreported carry under that account (expires
after owedFor) instead of reporting it on the other account's row.