← Journal

Grok usage HUD that refuses to invent a bar

· grok, usage-hud, quota, billing, solofounder

Sunday product day on austindixson/super-notch, spent on one row in the Usage strip: Grok.

Live SuperGrok unified billing came back with a weekly window, zeros for on-demand and prepaid, and no creditUsagePercent. The row read that as failure.

A missing field isn't an error

Here's the live fixture from that day: weekly period, isUnifiedBillingUser: true, on-demand 0/0, prepaid 0. creditUsagePercent and productUsage were both absent.

The credits read succeeded. The Usage strip still got stuck on Retry.

Treating an absent optional field as Retry after a 200 credits payload trains people to click a dead button.

First fix: stop calling it auth failure

PR #90 (c97045e9) merged around 11:30 AM PT. A successful credits payload without creditUsagePercent no longer counts as auth failure.

The percent gets read when it's present, including a real 0%. It's derived from monthly cents or on-demand only when the cap is greater than 0. A weekly period with none of those stays unpublished: no percent bar, no Retry loop.

GrokQuotaTests went 12/12 green on Linux against ProviderQuotaScanner.swift. Buy and checkout untouched.

Second fix: honest, but still noisy

PR #91 (5045de84) merged around 2:58 PM PT. When the percent is still missing, the row keeps saying not published and draws no bar. A caption shows what the live credits shape does publish: the week window, Unified, and prepaid when that key is present.

Each productUsage[].usagePercent entry can become its own window. The compact bar shows the highest published share and never invents a combined total.

The wiring uses Grok Build's GetGrokCreditsConfig through GET /v1/billing?format=credits, not docs.x.ai. GrokQuotaTests went 20/20 on Linux.

Wire usage meters from the live credits shape, not from marketing docs.

Third fix: if there's nothing to show, show nothing

Honest wasn't enough. A not published label plus a caption is still noise when there's nothing to act on.

PR #92 (4ed01654) merged around 3:10 PM PT. A signed-in SuperGrok account with no usable bar now draws no Grok row at all. No not published, no week, Unified, or prepaid caption.

The row comes back when xAI publishes creditUsagePercent (including an explicit 0), on-demand with a cap above 0, monthly cents, or productUsage[].usagePercent. Auth and network failures still show Login or Retry. Buy and checkout untouched.

One caveat. PR #92's agent environment had no Swift toolchain, so GrokQuotaTests didn't re-run on that machine, and its expectations flipped from #91's visible unpublished caption.

What I'd tell myself tomorrow

A fake 0% bar is worse than not published with period context. When there's still nothing to act on, hiding the row beats both.

Don't invent 0% from on-demand 0/0 or a missing percent field. Keep Buy and checkout out of quota HUD commits, and smoke-test checkout after merge anyway.

Loose ends

The last Journal post on main under website/blog/posts/ is still 2026-09-17. No digester post has been staged for the days since.

No Reddit listen today. The routine runs weekdays only, and the last successful weekday listen was 2026-09-25.

Three merges, one row, and the Usage strip stopped asking anyone to click a button that couldn't help them.