Files
orca/src
TimothyVangandNeil 4934920f06 fix(rate-limits): stop reporting Grok usage as 0% when the API omits the percent (#17936)
mapWeeklyCredits treated an absent creditUsagePercent as a confirmed protobuf
zero whenever the weekly period matched billing bounds, so unified-billing
accounts whose credits view never reports the percent showed a confident 0%
and short-circuited the monthly fallback (#15740). Those payloads emit
onDemandUsed/prepaidBalance zeros, which disproves the "encoder drops zeros"
premise.

Resolution order is now: reported percent → monthly used/monthlyLimit pair as
a monthly window → synthetic 0 only when the payload emits no usage scalars at
all and the weekly period is confirmed → unavailable with an explicit reason
the Accounts pane surfaces.

Rebased onto current main from nwparker/grok-usage-percent-fallback (#15878).

Fixes #15740

Co-authored-by: Neil <4138956+nwparker@users.noreply.github.com>
2026-09-06 19:25:57 -07:00
..