Skip to content

review(cursor): code review of Total/Auto/API usage PR#227

Closed
Copilot wants to merge 1 commit into
feat/cursor-three-metrics-cleanfrom
copilot/sub-pr-226
Closed

review(cursor): code review of Total/Auto/API usage PR#227
Copilot wants to merge 1 commit into
feat/cursor-three-metrics-cleanfrom
copilot/sub-pr-226

Conversation

Copilot AI commented Feb 24, 2026

Copy link
Copy Markdown
Contributor

PR #226 adds Total usage, Auto usage, API usage metrics and renames Included requestsRequests. Review surfaced four issues:

  • Mixed format for team accountsAuto usage / API usage percent lines (L485–505) have no if (!isTeamAccount) guard, so team accounts could render a dollars Total usage alongside percent sub-lines. No test covers this path.
  • planUsed fallback undercounts with bonus spend — when totalSpend is absent, fallback is limit − remaining = includedSpend, which excludes bonusSpend. Affects only the double-fallback path (totalPercentUsed non-finite and totalSpend missing), but silently under-reports on plans with bonus credits.
  • pooledLimit as team-detection over-firessu && typeof su.pooledLimit === "number" treats any account with a numeric pooledLimit as team, even when limitType is "user". Matches documented intent but warrants an inline comment.
  • Bonus spend absent from plugin.json manifest — emitted as a ctx.line.text on team accounts (L472) but has no manifest entry. Fine if text-type lines are intentionally excluded from the manifest; worth confirming.

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.


Summary by cubic

Add total usage and auto usage metrics to the cursor module. Both metrics are exposed via the API and shown in the UI so users can see overall activity and automated activity separately.

  • New Features
    • Compute and return total_usage and auto_usage in cursor metrics API (respects existing date range filters).
    • Render both metrics in the cursor panel with clear labels and consistent units.
    • Handle empty states and invalid inputs gracefully.

Written for commit 4aa8ef0. Summary will update on new commits.

Copilot AI changed the title [WIP] Add total usage and auto usage metrics to cursor review(cursor): code review of Total/Auto/API usage PR Feb 24, 2026
Copilot AI requested a review from robinebers February 24, 2026 10:23
@robinebers robinebers closed this Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants