Show Grok usage-limit reset coupons - #3188
Conversation
|
You have reached your Codex usage limits for security reviews. Please try again later. |
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 11:25 AM ET / 15:25 UTC. ClawSweeper reviewWhat this changesThis PR fetches unused Grok reset coupons through a best-effort authenticated RPC and shows their count and expiry beside the existing weekly usage. Merge readinessKeep open for normal maintainer review. Current main does not contain this capability, and the current head resolves the prior refresh, CLI-completeness, expired-display, and fleet-persistence concerns without a new blocking defect found. Priority: P2 Review scores
Verification
How this fits togetherCodexBar obtains a primary Grok usage snapshot from CLI, OAuth, or browser-session routes, then renders it in menu and overview cards. The new supplemental lookup uses the winning account credential or cookie and adds only a live reset-credit inventory to that display. flowchart LR
A[Selected Grok account] --> B[Primary weekly usage fetch]
B --> C[Primary usage snapshot]
B --> D[Optional reset-coupon lookup]
D --> E[Live sanitized coupon inventory]
C --> F[Menu and overview cards]
E --> F
E --> G[Fleet-sync filtering]
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the winning-credential, live-only, fail-soft design and merge after accepting the bounded dependency on Grok’s undocumented reset endpoint. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR adds a provider-display capability; the supplied redacted packaged-app screenshot directly shows the resulting coupon row. Is this the best way to solve the issue? Yes. Reusing the primary snapshot’s credential or winning cookie, publishing weekly usage independently, and retaining only expiry data in live state is the narrowest maintainable approach found. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against cf79d1310493. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dd39a4ac1d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
dd39a4a to
4583904
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4583904361
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Addressed the review feedback in
Live proof from the packaged debug app against a real Grok account (account data and tokens redacted):
The weekly card remains available immediately; the reset-credit block then shows Validation: 47 affected tests across 7 suites pass, @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
Weekly CLI-proxy credits omit SuperGrok reset tokens, so CodexBar never rendered an unused coupon even when grok.com listed one. Fetch remaining resets as a best-effort overlay and keep weekly usage if that call fails.
4583904 to
2f4ddc4
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2f4ddc468a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c094bb7b93
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 93d631e64b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a3188cc675
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Summary
Limit Reset Creditsdetail row, and leave weekly usage intact if that extra call times out or returns nothingTests
CODEXBAR_SUPPRESS_TEST_KEYCHAIN_ACCESS=1 swift test --filter GrokRemainingResetsFetcherTestsCODEXBAR_SUPPRESS_TEST_KEYCHAIN_ACCESS=1 swift test --filter GrokMenuCardModelTestsCODEXBAR_SUPPRESS_TEST_KEYCHAIN_ACCESS=1 swift test --filter GrokCreditsProxyFetcherTestsswiftlint lint --stricton the Grok remaining-resets filesWhy this was missing
/v1/billing?format=creditsreports weekly SuperGrok usage only. grok.com's Использование panel reads unused reset coupons from a separate RPC:POST https://grok.com/prod_mc_billing.ConsumerUiSvc/GetRemainingResetsThat payload includes
token_idandvalidity_end. CodexBar never called it, so an unused coupon such as Доступен сброс / Истекает 12 сент. stayed invisible even when weekly usage was 29%.CodexBar does not redeem or modify reset tokens.