Skip to content

fix(auth): share xAI OAuth state across profiles - #47290

Closed
thunderfight127-svg wants to merge 1 commit into
NousResearch:mainfrom
thunderfight127-svg:rick/xai-oauth-shared-store-upstream
Closed

fix(auth): share xAI OAuth state across profiles#47290
thunderfight127-svg wants to merge 1 commit into
NousResearch:mainfrom
thunderfight127-svg:rick/xai-oauth-shared-store-upstream

Conversation

@thunderfight127-svg

Copy link
Copy Markdown

Summary

  • add a shared xAI OAuth auth store for named profiles so rotated refresh tokens are written to a single cross-profile source
  • keep profile auth.json files from storing their own long-lived xAI token copies when shared store mode is enabled
  • preserve existing profile/root fallback and write-through behavior for non-shared-store flows
  • document the shared-store behavior for SuperGrok/Premium+ OAuth setups

Why

xAI can rotate refresh_token during OAuth refresh. When multiple Hermes profiles read different copies of the same grant, one profile can refresh and revoke the token another profile still holds. A shared store makes the OAuth grant effectively singleton across named profiles.

Tests

  • /home/thunderfight127/.hermes/hermes-agent/venv/bin/python -m py_compile hermes_cli/auth.py agent/credential_pool.py
  • /home/thunderfight127/.hermes/hermes-agent/venv/bin/python -m pytest tests/hermes_cli/test_auth_xai_oauth_provider.py tests/tools/test_web_providers_xai.py -o 'addopts=' -q

Result: 124 passed.

@alt-glitch alt-glitch added type/bug Something isn't working comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint area/auth Authentication, OAuth, credential pools provider/xai xAI (Grok) P2 Medium — degraded but workaround exists labels Jun 16, 2026
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/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P2 Medium — degraded but workaround exists provider/xai xAI (Grok) type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants