mirror of
https://github.com/stablyai/orca.git
synced 2026-09-22 00:02:31 +00:00
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>