[Bug]: Grok usage limits never show pace or the even-spend line#21896

opened22d agobyWwookiist

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 the Grok CLI with a grok.com account whose billing reports a weekly credit period, and add the Grok provider.
  2. Open Usage → Limits.
  3. Compare the Grok "Weekly" row with the Claude or Codex rows.

Expected behavior

The Grok row shows a pace icon next to "left", draws the even-spend marker on the bar, and its tooltip includes "% of the window left", like the Claude, Codex, and OpenCode Go windows.

after-grok.png below shows the row with the fix from the linked PR applied.

Actual behavior

The Grok row shows only the percentage and the reset time. There is no pace icon and no even-spend marker (before-grok.png below).

grokUsageResponseToLimits in packages/provider-grok/src/server/usageLimits.ts decodes only currentPeriod.type and currentPeriod.end, so the Grok window never gets windowDurationMins. The Usage page needs that value to work out how much of the window has elapsed, so it skips pace for Grok.

The billing response (GET https://cli-chat-proxy.grok.com/v1/billing?format=credits) already reports the start of the period:

json
1"currentPeriod": {
2 "type": "USAGE_PERIOD_TYPE_WEEKLY",
3 "start": "2026-10-14T20:51:37.352+00:00",
4 "end": "2026-10-21T20:51:37.352+00:00"
5}

Deriving windowDurationMins from end - start fixes it and also covers monthly periods of different lengths.

Cursor rows show the same symptom, but the Cursor usage response as read today only carries billingCycleEnd, so this report is limited to Grok. #17061 adds start to the same Grok schema for a different purpose (zero-usage periods).

Impact

Minor bug or occasional failure

Version or commit

main @ 65ba252b7 (also T3 Code Nightly 0.1.1-nightly.20261019.3373)

Environment

macOS (Darwin 27.0), T3 Code Nightly desktop and a local dev server, Grok CLI signed in with a grok.com account

Logs or stack traces

shell
1

Screenshots, recordings, or supporting files

before-grok.png after-grok.png

Workaround

None.

Verification blocked on Linux at main 70e5e384da. Step 1 could not be completed: command -v grok returned no executable, and this environment has no Grok home or configured account. The weekly billing row therefore could not be exercised in the real app. Verification requires an environment with a Grok CLI signed in to a grok.com account reporting a weekly credit period. No reproduction result or fix is claimed.

Synced from GitHub

For reference, this is the Grok row on the Usage page with a signed-in grok.com account on a weekly credit period. Codex and Claude rows on the same page show the pace badge and the even-spend marker; the Grok row shows neither, because the window has no windowDurationMins.

The fix in #21897 is covered by unit tests in apps/server/src/provider/GrokProvider.test.ts, so it can be checked without a Grok account.

Environment: T3 Code (Nightly) 0.1.2-nightly.20261022.3541, Grok CLI 1.0.67 (2fe064390d07) [stable], macOS 27.0.1.

Synced from GitHub

@juliusmarminge Following up on the verification note above: my previous comment includes a screenshot of the bug from a signed-in grok.com account on a weekly credit period. The fix in #21897 is also covered by unit tests in apps/server/src/provider/GrokProvider.test.ts, so it can be checked without a Grok account. Happy to adjust anything if needed.

Synced from GitHub

Still seeing this on the current nightly with Cursor signed in via CURSOR_API_KEY: the Cursor/Grok usage bars show, but there's no even-pace percentage or even-spend line like Claude Code gets. Would love to see pace for Cursor limits too.

Synced from GitHub

Scope update: Cursor has the same gap, as @pietervw noted above.

packages/provider-cursor/src/server/usageLimits.ts reads only billingCycleEnd, so its monthly windows also carry no windowDurationMins. The Cursor rows get no pace badge and no even-spend marker, for the same reason as Grok.

The Cursor usage response also returns billingCycleStart, so the cycle length is end - start, the same approach #21897 uses for Grok. I extended #21897 with this rather than opening a separate PR, since it is the same one-line gap in a sibling adapter. Happy to split it out if you'd prefer.

Synced from GitHub

On my free grok subscription I don't even see the usage change. It always shows 100% left. Then all of a sudden I hit the grok usage limit but T3 still shows 100% available