Skip to content

[Bug]: Grok usage shows No limits reported when creditUsagePercent is omitted (0% used) #15878

Description

@claudiobdlv

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. Sign in to Grok CLI (OIDC / SuperGrok account, ~/.grok/auth.json).
  2. Be at 0% usage for the current weekly period (e.g. right after the weekly reset, no Grok usage yet).
  3. Open Usage > Limits.

Expected behavior

Grok shows a Weekly window at 0% used (100% left), resetting at currentPeriod.end. The Grok CLI's own /usage > "Usage limit" tab shows "Weekly limit (SuperGrok) 0%, Resets: October 11".

Actual behavior

Usage page shows the warning Grok: No limits reported.

Cause: grokUsageResponseToLimits (grokUsageLimits.ts) returns windows: [] when config.creditUsagePercent is undefined. The GET https://cli-chat-proxy.grok.com/v1/billing?format=credits response omits creditUsagePercent when it is 0 (proto3-style default omission), even though currentPeriod is present:

{"config":{"currentPeriod":{"type":"USAGE_PERIOD_TYPE_WEEKLY","start":"2026-10-04T03:32:07.369992+00:00","end":"2026-10-11T03:32:07.369992+00:00"},"onDemandCap":{"val":0},"onDemandUsed":{"val":0},"isUnifiedBillingUser":true,"prepaidBalance":{"val":0},"topUpMethod":"TOP_UP_METHOD_SAVED_PAYMENT_METHOD","billingPeriodStart":"2026-10-04T03:32:07.369992+00:00","billingPeriodEnd":"2026-10-11T03:32:07.369992+00:00"}}

Suggested fix: when creditUsagePercent is undefined but currentPeriod is present, treat it as 0 instead of returning an empty window list. For example, const usedPercent = response.config?.creditUsagePercent ?? (response.config?.currentPeriod ? 0 : undefined).

Impact

Cosmetic issue

Version or commit

0.0.46-nightly.20261004.2657

Environment

Ubuntu 26.04 (elitedesk) and a Windows laptop, T3 nightly, Grok CLI 1.0.46, SuperGrok (unified billing user).

Workaround

Use Grok until usage is non-zero (the field then appears), or check the Grok CLI /usage view. Not yet confirmed: a tiny test prompt did not make the field appear.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions