Repository navigation
Commit 81e95dc
fix(server): Grok accounts with no usage yet no longer vanish from Limits
xAI omits `creditUsagePercent` from its billing response entirely until an
account has accrued metered usage, rather than sending 0. We treated that
absence as `unsupported`, which the contract reserves for accounts that can
never report quota, such as API keys and Bedrock. The Limits view drops those
accounts and deliberately mutes their notice, so a freshly signed-in Grok
account disappeared from Usage with no bar and no explanation until it
happened to be used. `applyUsageLimitsUpdate` also refuses mid-turn windows
for an `unsupported` snapshot, so nothing could recover it in the meantime.
Report no windows instead, leaving the `unavailable` marker off. The account
keeps its row and gets the existing "No limits reported." notice, and the bar
appears on its own once usage registers. The genuine can-never-report paths in
`readGrokUsageLimits` (API key, alternate auth deployments, custom config)
still return `unsupported` and are unaffected.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>1 parent 2d8f9a8 commit 81e95dc
2 files changed
Lines changed: 13 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
564 | 564 | | |
565 | 565 | | |
566 | 566 | | |
567 | | - | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
568 | 571 | | |
569 | 572 | | |
570 | 573 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
45 | 53 | | |
46 | 54 | | |
47 | 55 | | |
| |||
0 commit comments