fix: show SuperGrok Heavy from billing subscription tier - #2991
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
OIDC login always mapped to SuperGrok. Read subscriptionTier from the CLI credits envelope and stop treating Heavy's omitted credit percent as 0% usage.
4d886ae to
57189d2
Compare
|
Codex review: needs maintainer review before merge. Reviewed August 16, 2026, 10:34 PM ET / August 17, 2026, 02:34 UTC. ClawSweeper reviewWhat this changesThe PR reads the authenticated Grok CLI settings tier and uses it to label usage snapshots as SuperGrok or SuperGrok Heavy across CLI, proxy, and team-identity paths. Merge readiness✅ Ready for maintainer review This focused Grok label fix is correct on review and has sufficient redacted live proof; it is ready for ordinary maintainer review after the current platform checks finish. Priority: P2 Review scores
Verification
How this fits togetherCodexBar’s Grok provider resolves credentials, obtains usage through CLI RPC or billing fallbacks, and emits a normalized usage snapshot to the menu bar and CLI. This change enriches that snapshot with the subscription label from the matching authenticated CLI settings endpoint. flowchart LR
A[Grok auth file] --> B[CLI RPC or proxy billing]
B --> C[Usage snapshot]
A --> D[CLI settings endpoint]
D --> E[Authenticated tier enrichment]
C --> E
E --> F[Normalized Grok identity]
F --> G[Menu bar and CLI output]
Before mergeNone. Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Merge the bounded authenticated settings enrichment once the pending platform matrix validates the final head, retaining the existing no-overlay fallback when settings are unavailable. Do we have a high-confidence way to reproduce the issue? Yes. Current main’s identity mapping unconditionally uses the OIDC credential label, while the supplied redacted after-fix CLI output demonstrates the SuperGrok Heavy result through the corrected route. Is this the best way to solve the issue? Yes. Reading the authenticated CLI settings tier is the narrow source-of-truth path, while the implementation preserves existing usage parsing and isolates browser-cookie sessions. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against dbd54a8bcc8e. 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 (10 earlier review cycles; latest 8 shown)
|
The credits endpoint does not include subscriptionTier. Use subscription_tier_display from /v1/settings, and drop inferred 0% usage on SuperGrok Heavy.
Plan name still comes from settings. Credits percent stays on the existing rule: a period without creditUsagePercent is 0%.
|
Addressing the ClawSweeper review on
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
Auto mode tries grok agent billing first. A successful RPC snapshot had no webBilling, so identity stayed SuperGrok. Load subscription_tier_display on that path too.
|
Addressing the latest ClawSweeper finding on The settings tier is now attached on the CLI RPC success path too (
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
SwiftFormat hoistTry/hoistAwait failed in CI. Load the settings tier into a local before constructing snapshots, apply it at the web strategy exit so cookie and team fallbacks get the same plan, and bound the enrichment request at two seconds.
|
Addressing the latest Codex review on
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
Cookie billing is a different browser session, so do not attach the auth.json settings plan. Cache keys now include principal type and team id so Personal and Team do not share a stale tier.
|
Addressing the latest account-isolation review:
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
A credits payload with only subscriptionTier is not usable usage. Throw parseFailed and let cookie/gRPC fallback continue; the plan name still comes from settings enrichment.
|
Addressing the latest P2 on Tier-only credits payloads now @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
Do not keep SuperGrok Heavy after a settings timeout or empty 200. A failed or missing subscription_tier_display now falls back to the OIDC SuperGrok label for this refresh.
|
Addressing the latest P2 on Removed the process-lifetime settings-tier cache. Timeouts, request failures, and 200s without @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
Record the user-visible plan-label fix under 0.51.1 Unreleased.
|
Added the missing 0.51.1 changelog bullet for the user-visible SuperGrok Heavy plan label. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
# Conflicts: # CHANGELOG.md
Summary
Grok OIDC login always labeled the account as SuperGrok. The credits API does not include the plan name; the live value is
subscription_tier_displayonGET /v1/settings.Usage percent is unchanged from the existing CodexBar credits rule: a parseable period without
creditUsagePercentis 0%.Changes
/v1/settingsafter a successful CLI-proxy credits call and mapsubscription_tier_displaytologinMethodTest plan
webBilling == nilswift build --product CodexBarCLIusage --provider grokon SuperGrok Heavy reportsloginMethod: SuperGrok Heavy--source clistill fails withMethod not foundon grok 1.0.4 (expected); the RPC success path is covered by unit testsLive proof (redacted)
{ "source": "grok-cli-proxy", "loginMethod": "SuperGrok Heavy", "primary": { "resetsAt": "2026-08-23T18:42:45Z", "usedPercent": 1 } }Not sent for review.