Repository navigation
Description
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
- Sign in to Grok CLI on the computer running Orca and confirm Grok usage is available.
- Leave Orca running without issuing further Grok commands.
- Keep another application in front until the saved access token expires.
- 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.
- Run
grok sessions listand 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
- Related to [Feature]: Refresh quota from the CLI, and keep polling while the window is in the background #25856, but narrower: this concerns keeping Grok credentials usable, not continuously polling every provider's quota in the background or adding a CLI quota-refresh command.
- This does not propose fixing remote/WSL credential selection ([Bug]: Grok usage tracking ignores configured WSL account runtime #13784). The existing Grok footer reads the local host's credentials.
- The existing workaround is to run Grok CLI manually; no chat message is needed.
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
Jinwoo-H commentedon Nov 7, 2026
thanks for reporting. looking into it
Pr1p commentedon Nov 28, 2026
Windows data point: this also happens on Windows.
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.