Repository navigation
fix(usage): Cursor account history loads about 4x faster - #17140
Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a narrowly scoped performance improvement to Cursor history retrieval, with bounded concurrency, ordered consumption, cancellation, and tests covering the key runtime cases. Existing usage output and caller behavior remain unchanged. No code changes detected at You can add or adjust custom eligibility rules. Learn more. |
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review. 📝 WalkthroughWalkthrough
ChangesCursor usage pagination
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Refactor Sequence Diagram(s)sequenceDiagram
participant Reader as readCursorAccountUsage
participant Requests as Cursor page requests
participant Controller as AbortController
Reader->>Requests: Start up to six page reads
Requests-->>Reader: Return page results
Reader->>Reader: Consume results in page order
Reader->>Controller: Abort shared signal on exit
Controller-->>Requests: Cancel outstanding requests
Suggested reviewers: Merge Risk: ⚪ Minimal · up to The concurrent history reader preserves page order and the existing end-of-history behavior. No merge-blocking issue was established. 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
The reader requested one page of account events at a time. Cursor caps a page at 1,000 events and takes about a second to answer one, so a busy account spent most of a minute here before Usage could show anything. Keep up to six pages requested ahead of the one being consumed. Pages are still consumed in page order, so the read ends as it did before, and any request still in flight is cancelled when it does. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ddf404e to
23d29e2
Compare
- Cursor paging goes back to main's ordered reader. The parallel `mapBounded` pager kept assigning pages after a failure; #17140 owns that speedup with a smaller reader change. The `CursorAccountReader` service stays. - Hidden providers no longer add a refreshing row or mute the totals. - The period label names the period on screen while the previous one is kept. - The kept-window test now switches windows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
## What's Changed * feat(providers): run Muse Code as a native provider by @t3dotgg in pingdotgg/t3code#17082 * feat(web): compact-before-send is a chip that shows the token count by @t3dotgg in pingdotgg/t3code#17127 * fix(clients): copy button is back in its old spot, before fork by @t3dotgg in pingdotgg/t3code#17137 * fix(usage): repeat usage scans no longer decode unchanged Antigravity databases by @t3dotgg in pingdotgg/t3code#17139 * fix(server): shell snapshots no longer block other database reads while decoding by @t3dotgg in pingdotgg/t3code#17141 * perf(server): ACP tool updates no longer persist a snapshot per streamed chunk by @darjss in pingdotgg/t3code#16682 * feat(web): filter the Usage page to just the providers you want by @t3dotgg in pingdotgg/t3code#16970 * fix(usage): Cursor account history loads about 4x faster by @t3dotgg in pingdotgg/t3code#17140 * fix(server): threads settle as soon as branch status sees their PR merge by @t3dotgg in pingdotgg/t3code#17148 * perf(usage): the Usage page shows numbers in under a second and dims only what is still loading by @t3dotgg in pingdotgg/t3code#17147 * fix(server): an agent can settle its own thread when its turn ends by @t3dotgg in pingdotgg/t3code#17145 * feat(web): Add provider button sits with the provider list by @t3dotgg in pingdotgg/t3code#17152 ## New Contributors * @darjss made their first contribution in pingdotgg/t3code#16682 **Full Changelog**: pingdotgg/t3code@v0.0.46-nightly.20261008.2813...v0.0.46-nightly.20261008.2819 Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.46-nightly.20261008.2819
## What's Changed * feat(providers): run Muse Code as a native provider by @t3dotgg in pingdotgg/t3code#17082 * feat(web): compact-before-send is a chip that shows the token count by @t3dotgg in pingdotgg/t3code#17127 * fix(clients): copy button is back in its old spot, before fork by @t3dotgg in pingdotgg/t3code#17137 * fix(usage): repeat usage scans no longer decode unchanged Antigravity databases by @t3dotgg in pingdotgg/t3code#17139 * fix(server): shell snapshots no longer block other database reads while decoding by @t3dotgg in pingdotgg/t3code#17141 * perf(server): ACP tool updates no longer persist a snapshot per streamed chunk by @darjss in pingdotgg/t3code#16682 * feat(web): filter the Usage page to just the providers you want by @t3dotgg in pingdotgg/t3code#16970 * fix(usage): Cursor account history loads about 4x faster by @t3dotgg in pingdotgg/t3code#17140 * fix(server): threads settle as soon as branch status sees their PR merge by @t3dotgg in pingdotgg/t3code#17148 * perf(usage): the Usage page shows numbers in under a second and dims only what is still loading by @t3dotgg in pingdotgg/t3code#17147 * fix(server): an agent can settle its own thread when its turn ends by @t3dotgg in pingdotgg/t3code#17145 * feat(web): Add provider button sits with the provider list by @t3dotgg in pingdotgg/t3code#17152 ## New Contributors * @darjss made their first contribution in pingdotgg/t3code#16682 **Full Changelog**: pingdotgg/t3code@v0.0.46-nightly.20261008.2813...v0.0.46-nightly.20261008.2819 Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.46-nightly.20261008.2819
Brings in Theo's Usage work: progressive loading with a Cursor cache and the awaitRefresh follow-up (pingdotgg#17147), the provider filter (pingdotgg#16970), faster Cursor paging (pingdotgg#17140) and the Antigravity scan cache (pingdotgg#17139). Resolution: - Contract keeps both groupByThread and awaitRefresh. - Server: upstream's parallel source scans; transcript scans still carry the account, each session's folder and sub-agent labels; attribution runs alongside the scans. - Web: statuses carry upstream's isConnected next to the offline fields; the provider filter applies before saved usage is trimmed; the page keeps the previous period on screen while a new one loads, and the explorer mutes its totals, chart, by-type section and list while figures are still coming in, and each provider row while that provider refreshes. Also fixes a Macroscope finding: a resumed Claude scan no longer replaces a session's original folder with one from later records, which could move it to another project.
Usage waits for every source before it shows anything. On a busy Cursor account, the Cursor history reader was nearly all of that wait: it asked for one 1,000-event page at a time, and each page takes about a second. A 30-day window with 36k events took about 46 s, close to the reader's 60 s deadline.
The reader now keeps up to six pages requested ahead of the one it reads. It still reads pages in order, so the count check, overlap reconciliation, end-of-history rule and "Sign in to Cursor again" result do not change. When the read ends, it cancels the requests still in flight. Krishna measured 45.9 s → 9.6 s on a real account with identical records.
This continues #14384 by @im-kvijay, whose commit is imported unchanged with its authorship. I could not update that PR's branch from here, so this PR carries it onto current
main.Proof: the new ordering test fails against
main's reader and passes with this change. Lint, server typecheck and the 144 usage tests pass on currentmain.Takeover and verification by Claude Opus 5.5 in Claude Code. Original change by @im-kvijay with Claude Opus 5.5 in Claude Code.
🤖 Generated with Claude Code