Files
orca/src/shared
Brennan Benson a4cfc82d69 Surface Grok unified-billing monthly usage instead of a permanent warning (#8769)
* Surface Grok unified-billing monthly usage instead of a permanent warning

Unified-billing Grok accounts have no weekly credits: the
/billing?format=credits view returns a config without
creditUsagePercent, so the status bar was stuck on 'Grok billing
response did not include credit usage' even though the account has a
real quota. The default (format-less) /billing view reports it as an
included monthly budget (monthlyLimit/used with the billing period).

When the credits view has no weekly credit usage, read the default view
and surface monthly usage as the provider's 30-day window (already
supported by the tooltip and chip visibility for OpenCode Go). If the
fallback read fails, the previous 'unavailable' presentation stands
rather than escalating to an error chip.

* Review fixes: chip renders monthly-only usage; fallback failures keep stale data

- StatusBar ProviderSegment: monthly window is chip-visible when it is the
  sole window (Grok unified billing); fetching/error no-data guards and the
  icon-only dot now count monthly, matching tooltip.tsx. OpenCode Go chips
  are unchanged (monthly stays tooltip-only next to session/weekly).
- grok-fetcher: monthly-fallback request failures propagate as 'error' so
  applyStalePolicy keeps the last good monthly snapshot; 'unavailable' is
  reserved for a successful response without monthly fields.

* Settings: show Grok monthly usage row for unified-billing accounts

Why: the Grok accounts section only rendered the weekly-credits row, so
unified-billing accounts showed a signed-in state with no usage at all.

* Use generated localization keys for Grok monthly copy
2026-07-14 17:02:06 -07:00
..
2026-05-31 05:55:04 -07:00