Skip to content

Cursor usage: pagination deadline exceeded (120s) on heavy accounts, no partial cache #475

Open

Description

@aparrap

Version: 2.5.7 (macOS)

What happens
Cursor auth now works (via CURSOR_SESSION_TOKEN), but the usage fetch never completes on a heavy account. It gets through about 98 pages (~9,800 events in the ~21-day scan window) and then hits the hardcoded 120s fetchDeadline. The collected pages are discarded, so every refresh restarts at page 1 and Cursor always shows nothing.

Log

[2026-11-06T13:42:31Z] cursor api: session token ready (585 chars)
[2026-11-06T13:44:31Z] cursor api: fetch failed — pagination deadline exceeded after page 98
[2026-11-06T13:44:31Z] cursor api: fetch failed and no cache
[2026-11-06T13:44:45Z] phase1 recv id=cursor today=nil err=none

Relevant code

  • CursorUsageAPI.swift L12: fetchDeadline = 120, with pageSize = 100 and maxPages = 200
  • The cache is only stored on .success (L88–92), so partial results are dropped

Suggestions

  • Make the deadline configurable (env var or defaults key), or raise it
  • Cache partial pages and resume / fetch incrementally from the last stored event
  • Or cache successful days and only fetch new events after the first full load

CURSOR_USAGE_API=0 isn't a workaround: the local state.vscdb has hardly any tokenCount data, and it also turns off Cursor limits.

Related: #465 (the 404 on /user_management/authorize when the token isn't a JWT)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions