fix(cursor): parse enterprise overall/pooled usage#813
Merged
ratulsarna merged 2 commits intosteipete:mainfrom Apr 30, 2026
Merged
fix(cursor): parse enterprise overall/pooled usage#813ratulsarna merged 2 commits intosteipete:mainfrom
ratulsarna merged 2 commits intosteipete:mainfrom
Conversation
Decoder ignored individualUsage.overall and teamUsage.pooled, so Enterprise/Team accounts fell through to planPercentUsed=0 and the menu showed "100% remaining". Personal cap (overall) now wins; shared pool (pooled) is the last-resort fallback. Existing plan, on-demand, and legacy /api/usage paths unchanged.
Collaborator
|
THanks @fcamus00 for the contribution! |
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
individualUsage.overallandteamUsage.pooledinstead of the legacyindividualUsage.planblock CodexBar's decoder knows about.CursorOverallUsageandCursorPooledUsagedecoders, extendedCursorIndividualUsageandCursorTeamUsage, and updatedparseUsageSummaryprecedence so the personal cap (overall) wins, with the shared pool (pooled) as a last-resort fallback.overall/pooledintoplanUsedUSD/planLimitUSDso the debug log surfaces the right dollars.Compatibility
planprecedence (Pro / Hobby / Team withtotalPercentUsed, lane percents, plan ratio) is unchanged — only adds new fallbacks below it./api/usagerequest-based plan logic untouched.Tests
3 new tests in
Tests/CodexBarTests/CursorStatusProbeTests.swift:overall+pooled).individualUsage.overall(73.84%) wins overteamUsage.pooled(45.25%) for the headline.pooled-only fallback when no individual data exists.planblock still wins when present.`swift test --filter CursorStatusProbeTests` → 32/32 green.
Verification
Reproducer (sanitized live response)
```json
{
"membershipType": "enterprise",
"limitType": "team",
"isUnlimited": false,
"individualUsage": {
"overall": { "enabled": true, "used": 7384, "limit": 10000, "remaining": 2616 }
},
"teamUsage": {
"onDemand": { "enabled": true, "used": 0, "limit": null, "remaining": null },
"pooled": { "enabled": true, "used": 12725135, "limit": 28122000, "remaining": 15396865 }
}
}
```
Before: menu shows
100% remaining. After: shows ~26% remaining(73.84% used).