feat(ai): SuperGrok OAuth device login - #752
Open
valtterivalo wants to merge 1 commit into
Open
Conversation
zhengr
pushed a commit
to zhengr/prime-agent
that referenced
this pull request
Aug 8, 2026
zhengr
pushed a commit
to zhengr/prime-agent
that referenced
this pull request
Aug 8, 2026
zhengr
pushed a commit
to zhengr/prime-agent
that referenced
this pull request
Aug 8, 2026
- Add OpenAI Codex official support entry - Add pi-internal:// URL scheme - Add ctx.shutdown() fix (PrimeIntellect-ai#756) - Add OpenAI Codex retry logic (PrimeIntellect-ai#733) - Add third-party contributions: - PrimeIntellect-ai#702 by @aliou (custom tool HTML export) - PrimeIntellect-ai#728 by @richardgill (frontmatter parsing, SelectList fix) - PrimeIntellect-ai#747 by @kaofelix (tree filter shortcuts) - PrimeIntellect-ai#752 by @richardgill (keymap expansion)
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds SuperGrok / X Premium device OAuth on the existing
xaiprovider. Tokens refresh automatically. Default xAI model isgrok-4.5./login→ xAI SuperGrok, then use built-in xAI models againstapi.x.ai.Note
Medium Risk
Introduces OAuth token acquisition and refresh against xAI’s auth endpoints and changes the default xAI model, which affects auth handling and out-of-the-box model selection without touching core inference paths.
Overview
Adds SuperGrok / X Premium subscription auth for the existing
xaiprovider via OAuth device login (open verification URL, enter user code, poll until authorized).loginXai,refreshXaiToken, andxaiOAuthProviderare exported fromprime-agent-ai/oauthand registered alongside the other built-in OAuth providers so/loginandgetOAuthApiKeycan use the samexaiauth slot as API keys.The device flow polls
auth.x.aiwithauthorization_pending/slow_downhandling, rejects non-HTTPS verification URLs, and refreshes access tokens while preserving the refresh token when the issuer does not rotate it. Vitest coverage exercises polling, URL hardening, refresh, and registry wiring.Docs and changelogs in
packages/aiandpackages/coding-agentdocument the new login path. The coding-agent default xAI model changes fromgrok-4.20-0309-reasoningtogrok-4.5.Reviewed by Cursor Bugbot for commit c2c3b54. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add xAI SuperGrok OAuth device login flow to the xAI provider
packages/ai/src/utils/oauth/xai.ts, supporting polling withauthorization_pending,slow_downbackoff,access_denied, andexpired_tokenerror handling.loginXaiandrefreshXaiTokenfunctions and registersxaiOAuthProviderin the built-in OAuth provider registry sogetOAuthProvider('xai')resolves to it.packages/coding-agent/src/core/model-resolver.tsfromgrok-4.20-0309-reasoningtogrok-4.5.Macroscope summarized c2c3b54.