Skip to content

feat(providers): add first-class xAI (Grok) OAuth provider with Grok CLI auto-import#25968

Closed
am423 wants to merge 2 commits into
NousResearch:mainfrom
am423:feat/xai-oauth-first-class
Closed

feat(providers): add first-class xAI (Grok) OAuth provider with Grok CLI auto-import#25968
am423 wants to merge 2 commits into
NousResearch:mainfrom
am423:feat/xai-oauth-first-class

Conversation

@am423

@am423 am423 commented May 14, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds xai-oauth as a first-class model provider for xAI Grok in Hermes Agent.

Key Features

  • New plugins/model-providers/xai-oauth/ plugin (auth_type="oauth_external", api_mode="codex_responses")
  • Full OAuth support (PKCE browser login + token refresh)
  • Primary UX: Automatic import from the official Grok CLI (~/.grok/auth.json) — the recommended path
  • Proper wiring in hermes model, runtime resolution, and status checks
  • Updated documentation and basic tests

Why?

xAI was previously only available via raw XAI_API_KEY. This gives users who already use the official Grok CLI / Grok Build a seamless, first-class experience inside Hermes (matching the quality of qwen-oauth, google-gemini-cli, and minimax-oauth).

How to Test

Recommended path (Grok CLI import):

  1. grok login
  2. hermes model
  3. Select "xAI (OAuth login)"

Hermes should automatically detect and import your credentials, then let you pick a Grok model.

Browser login is still available as a fallback (with a note about possible redirect URI limitations on xAI’s public desktop client).

Checklist

  • Follows the Adding Providers guide
  • Added tests
  • Updated user-facing documentation
  • Consistent with other OAuth providers
  • Conventional Commits

Contributing.md Style Summary

This is a focused feature addition that follows the established patterns in the repository. It adds a new inference provider with proper plugin structure, core CLI/auth/runtime integration, documentation, and tests. The implementation prioritizes real-world usability by making the official Grok CLI login the primary authentication method, while still supporting direct browser OAuth as a fallback.

@am423 am423 requested a review from a team May 14, 2026 21:58
@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/plugins Plugin system and bundled plugins comp/acp Agent Communication Protocol adapter provider/xai xAI (Grok) area/auth Authentication, OAuth, credential pools labels May 14, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Related to #25941 — both add xAI OAuth provider support. This PR bundles ACP registry refactoring with the xAI OAuth feature; #25941 focuses on xAI Coding Plan OAuth via grok CLI delegation. Maintainers should decide which approach to merge or whether to consolidate.

@badpixel

Copy link
Copy Markdown

현재 체크가 없고 BLOCKED 상태입니다. CI/권한 상태를 확인한 뒤 다시 봐야 합니다.

@am423

am423 commented May 15, 2026 via email

Copy link
Copy Markdown
Contributor Author

@am423

am423 commented May 15, 2026 via email

Copy link
Copy Markdown
Contributor Author

@avirweb

avirweb commented May 16, 2026

Copy link
Copy Markdown

Superseded by PR #27144 (Mind-Dragon:feat/xai-oauth-pr) — rebased on latest main with additional credential-sourcing improvements.

@avirweb

avirweb commented May 16, 2026

Copy link
Copy Markdown

Superseded by #27144 — rebased on latest main with credential-sourcing improvements merged in.

@teknium1

Copy link
Copy Markdown
Contributor

Closing as redundant — xai-oauth is already a first-class provider on main: 70 references in hermes_cli/auth.py, registered in hermes_cli/models.py (curated models, ProviderEntry, aliases) and hermes_cli/runtime_provider.py (api_mode=codex_responses). The diff also sprawls into ACP adapter, registry manifests, and an npm package — clearly a stale fork. Thanks for the contribution; the feature you set out to add already shipped through other paths.

@teknium1 teknium1 closed this May 19, 2026
@am423

am423 commented May 19, 2026 via email

Copy link
Copy Markdown
Contributor Author

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

Labels

area/auth Authentication, OAuth, credential pools comp/acp Agent Communication Protocol adapter comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have provider/xai xAI (Grok) type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants