Skip to content

[Bug]: Grok usage stops updating when its access token expires #36679

Open

Description

@hyein-cbio

Operating system

macOS. The affected code is shared by desktop hosts; Linux and Windows runtime reproduction has not been verified locally.

Orca version

Source baseline: b69a5c6c7ee751bc923cb93b158ca4d8e864fe9d (package.json: 1.4.214). Grok CLI used for the local authenticated refresh check: 1.0.70.

Details

The Grok usage footer reads the access token from the local auth.json and calls the billing API. Unlike the Codex CLI-backed usage path, that read does not give Grok CLI an opportunity to refresh its token. Once the saved token enters Orca's expiry-skew window, usage reports an expired sign-in even when Grok CLI can silently refresh the session.

The normal usage poll only runs while the window is active, so it cannot reliably perform preventive authentication maintenance while Orca is in the background.

Steps to reproduce

  1. Sign in to Grok CLI on the computer running Orca and confirm Grok usage is available.
  2. Leave Orca running without issuing further Grok commands.
  3. Keep another application in front until the saved access token expires.
  4. Return to Orca and refresh usage: the saved token is rejected as expired and the footer asks for Grok to be run on the host.
  5. Run grok sessions list and refresh usage again. The CLI can update its credentials without sending a chat message.

Expected behavior

While Orca is running, ask Grok CLI to refresh near expiry and re-read the same auth file before fetching billing usage. The maintenance timer should not depend on window focus. CLI absence/failure must not cause an unbounded retry loop or interactive login prompt.

Grok CLI's default early-invalidation window is five minutes. Running the command ten minutes before expiry is too early: it can exit successfully without replacing the token.

Scope and related work

The proposed fix is covered by deterministic timer/auth/CLI tests. An authenticated local CLI check also confirmed token replacement and a later expiry, without exposing credential values.

Activity

  1. Jinwoo-H commented on Nov 7, 2026

    @Jinwoo-H
    Contributor

    thanks for reporting. looking into it

  2. Pr1p commented on Nov 28, 2026

    @Pr1p
    Contributor

    Windows data point: this also happens on Windows.

    • OS: Windows 11 25H2 (OS Build 26200.9974)
    • Orca: 1.4.278, still happens after updating to 1.4.280

    Grok usage regularly stops showing correctly. Until now the only fix I'd found was signing out of Grok CLI in a terminal, signing back in, and then refreshing usage in Orca.

    So the same expiry path described here hits Windows hosts too, and #36680 would cover it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions