Fix zero-percent Grok usage visibility#8336
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughWeekly Grok credit mapping now treats an omitted 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Superseded by #9219Hi — after reconciling Grok usage mapping against current #9219 ( Monthly unified-billing fallback remains covered by #8769. Recommend closing this PR as superseded by #9219 to free review bandwidth. Happy to help if a remaining SuperGrok response shape still fails after #9219 — please reopen with a redacted billing JSON fixture if so. (Contributor note: no merge rights; leaving this for maintainers/authors.) |
|
Taking a look! |
Summary
creditUsagePercentas zero when the billing response declares a weekly credit periodCloses #8278
Testing
pnpm exec vitest run --config config/vitest.config.ts src/main/rate-limits/grok-fetcher.test.ts src/main/rate-limits/grok-auth.test.ts src/main/rate-limits/service.test.ts src/renderer/src/components/stats/GrokUsagePane.test.tsx src/renderer/src/components/status-bar/status-bar-provider-visibility.test.ts(86 tests passed)pnpm typecheckpnpm build(desktop, web, and native builds passed)oxfmt,oxlint, andgit diff --checkpnpm lint— existing missing localization keys inUsagePercentageDisplayChangeNotice.tsx, unrelated to this changepnpm test— 28,481 passed; 29 unrelated failures across five suites under unsupported Node 26, plus one asynchronous renderer-test cleanup errorAI Review Report
Notes
Grok's billing endpoint is proto3 JSON, which omits scalar fields at their default value. A declared weekly period with no
creditUsagePercenttherefore represents 0% usage, not a missing quota.The repository requests Node 24; the full local suite was run on Node 26.0.0. The focused regression tests, typecheck, and full build pass in that environment.