Skip to content

Grok build usage #1805

Closed
Closed

Description

@salavatkhafizov

Please check Grok build usage limits calculation - looks like they just shifted to weekly limits (used to be monthly limit)

Activity

  1. clawsweeper commented on Jul 1, 2026

    @clawsweeper

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed August 22, 2026, 12:45 AM ET / 04:45 UTC.

    Summary
    The weekly-limit problem is already implemented and shipped; this issue remains useful only for the later request to show extra-credit dollar usage, which needs product approval and a stable xAI billing contract.

    Reproducibility: not applicable. to the remaining request: the weekly behavior is covered by current source and release notes, while the requested dollar metric needs an authoritative provider payload rather than a failure reproduction.

    Ways to help us reproduce this

    • Add a screenshot or short recording showing the behavior.
    • Add expected vs actual behavior.
    • Include redacted logs or terminal output.

    Maintainer decision needed

    Question Recommendation
    Should CodexBar add a Grok-specific extra-credit dollar-spend metric when xAI supplies a stable authenticated billing field? Approve a contract-led metric: Add the metric only after a redacted live xAI payload establishes the authoritative amount and period semantics.

    Why: Current behavior deliberately keeps subscription credits as quotas rather than inventing dollar spend, so implementation needs a decision on whether this provider-specific metric belongs in the shared Usage & Spend surface.

    Next step
    A maintainer must decide whether a provider-specific dollar metric is in scope before a contract-dependent implementation can be bounded.

    Review details

    Best possible solution:

    Keep the shipped weekly-credit path and, if approved, add a separate authenticated extra-credit spend metric only after a redacted stable xAI response defines its currency, scope, reset behavior, and fallback semantics.

    Do we have a high-confidence way to reproduce the issue?

    Not applicable to the remaining request: the weekly behavior is covered by current source and release notes, while the requested dollar metric needs an authoritative provider payload rather than a failure reproduction.

    Is this the best way to solve the issue?

    Unclear: the weekly-limit repair is already the narrow supported solution; the extra-credit display should not be implemented until maintainers approve it and xAI’s field semantics are evidenced.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • xAI’s current billing data contract for a separate extra-credit dollar amount is not established in the issue; deriving dollars from subscription credits would misstate spend.

    Codex review notes: model internal, reasoning high; reviewed against 27c7f334e3c4.

    Label changes

    Label justifications:

    • P3: The original weekly quota handling is shipped; the remaining optional spend display is a low-urgency product decision.
    Evidence reviewed

    What I checked:

    Likely related people:

    • Peter Steinberger: Current Grok usage presentation and local spend conversion lines blame to a Peter Steinberger release commit; the v0.50.0 release tag is also authored by him. (role: recent Grok-area contributor; confidence: high; commits: 22a2168842a9, 0e453c4a5b2a; files: Sources/CodexBarCore/Providers/Grok/GrokProviderDescriptor.swift, Sources/CodexBarCore/Providers/Grok/GrokLocalSessionScanner.swift, CHANGELOG.md)
    How this review workflow works
    • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
    • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
    • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
    • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
    • Maintainers can also comment @clawsweeper review to request a fresh review only.
    • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
    • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
  2. added
    P2Normal priority bug or improvement with limited blast radius.
    impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.
    issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.
    clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.
    clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.
    clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.
    on Jul 1, 2026
  3. steipete commented on Jul 1, 2026

    @steipete
    Owner

    Maintainer reproduction audit (2026-07-01, CodexBar main 24490b6434d491a5478ea6636f014744ada3cbeb): I could not obtain the one missing artifact—a current authenticated Grok Build billing payload—so I am not changing the parser speculatively.

    Current evidence:

    • xAI's current Grok Build command documentation documents /usage as token and credit usage for the session. It does not publish the subscription limit/reset contract.
    • The installed official CLI is grok 0.1.211. Its current binary still contains the contract names monthlyLimit, billingPeriodStart, billingPeriodEnd, includedUsed, and totalUsed; there is no weeklyLimit contract name.
    • A redacted ACP probe successfully initialized the current CLI, then x.ai/billing returned -32601 Method not found. This matches CodexBar's documented limitation, now confirmed on 0.1.211 as well as 0.1.210.
    • No authorized Grok Build login/browser session was available in the permitted local sources. No unrelated API-platform credential was used as a substitute for the consumer subscription product.
    • Current CodexBar behavior is internally consistent for the known payload: percent is usage.totalUsed / monthlyLimit; reset comes from billingPeriodEnd; when start and end are available, their duration drives the visible Weekly/Monthly label. The web fallback supplies only upstream percent plus reset time, so it cannot prove the denominator or full cycle length.
    • Active-PR overlap audit found no open Grok/Grok Build PR or PR touching the Grok provider files.

    Minimal proof needed to repair this safely:

    1. grok --version.
    2. A redacted authenticated x.ai/billing result from a CLI/version where that method succeeds. Keep field names; remove tokens/account/team IDs. Timestamps may be shifted together while preserving the start→end duration. Monetary values may be normalized by one common factor while preserving totalUsed / limit.
    3. If the CLI method still fails, a sanitized Grok Build usage screenshot plus the successful billing response captured by Grok's own UI, with cookies/tokens/account identifiers removed. We need the limit field name, used field name, period start/end (or exact duration), and displayed percentage.

    The decisive question is whether xAI changed only the billing-cycle duration while retaining monthlyLimit, or introduced a new weekly denominator/field. Those require different fixes. Guessing either could silently display the wrong percentage.

    Recommendation: keep open with needs-live-repro; no code/PR until the minimal payload above is available.

    Redacted current CLI proof
    {"id":1,"result_keys":["_meta","agentCapabilities","authMethods","protocolVersion"],"auth_method_ids":["grok.com"]}
    {"id":2,"error_code":-32601,"error_message":"Method not found","result_keys":[]}
  4. salavatkhafizov commented on Jul 1, 2026

    @salavatkhafizov
    Author
    1. grok 0.2.73 (9ff14c43bbe5) [stable]
    2. pls see attachment
    3. can't help

    Looks like siginificant change - even web chats have weekly limits too.

    Image
  5. Karasowl commented on Jul 15, 2026

    @Karasowl

    Same here on Linux, grok CLI 0.2.101 (5bc4b5dfad) with SuperGrok, checked today. Two data points that might save you the repro:

    --source cli fails outright. The billing method seems to only exist inside the interactive TUI, so the headless call CodexBar makes gets rejected:

    $ codexbar usage --format json --json-only --provider grok --source cli
    [{"provider":"grok","error":{"message":"Grok request failed: Method not found","kind":"provider","code":1},"source":"cli"}]
    

    --source web works but only ever returns one window, the other slots come back null:

    "primary":{"resetsAt":"2026-07-15T15:26:13Z","usedPercent":6},"secondary":null,"tertiary":null
    

    Which matches what docs/grok.md says about Weekly/Monthly being a display label over a single window. So right now there is just no second window to show. Either xAI exposes the billing RPC outside the TUI or grok.com starts returning a second window, otherwise there is nothing to parse. Happy to test a branch if that helps.

  6. added
    issue-rating: 🦪 silver shellfishThin issue quality; more reproduction proof or environment detail is needed.
    and removed
    clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.
    clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.
    issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.
    clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.
    on Jul 30, 2026
  7. 8 remaining items

  8. added
    clawsweeper:not-repro-on-mainClawSweeper found high-confidence evidence that this issue no longer reproduces on main.
    issue-rating: 🦪 silver shellfishThin issue quality; more reproduction proof or environment detail is needed.
    and removed
    issue-rating: 🦪 silver shellfishThin issue quality; more reproduction proof or environment detail is needed.
    clawsweeper:not-repro-on-mainClawSweeper found high-confidence evidence that this issue no longer reproduces on main.
    impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.
    on Aug 8, 2026
  9. gianpaj commented on Sep 4, 2026

    @gianpaj

    I found this PR that's been worked on for a bit: #3236

    Hopefully it will be merged soon :)

  10. steipete commented on Sep 23, 2026

    @steipete
    Owner

    The original weekly-window behavior is implemented in the current Grok provider, including measured billing periods and Weekly/Monthly presentation (#3679). The later extra-credit dollar-spend request remains separate. Local Grok history currently reports tokens without inventing USD amounts. That extension needs a product decision and a redacted authoritative payload establishing amount, currency, account scope, and period semantics. No additional parser change was made in this review.

  11. steipete commented on Sep 24, 2026

    @steipete
    Owner

    Current main supports weekly Grok Build periods and preserves measured monthly windows near reset, including the period handling in #3679 (2c994ef1c3bb). The proxy and menu-model tests pass for weekly duration, near-reset Weekly labels, and measured Monthly labels. This can be closed as addressed; #3947 (landed on main) changes only RPC error classification.

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

    P3Low-risk cleanup, docs, polish, ergonomics, or speculative feature.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.issue-rating: 🌊 off-meta tidepoolIssue quality rating does not apply to this item.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions