Skip to content

[Bug] xAI Grok OAuth token expires within ~24h; auxiliary title generation fails with HTTP 403 #28250

@jfdnet

Description

@jfdnet

Bug Description

After authenticating with xAI Grok via hermes auth login xai, the OAuth access token becomes invalid within less than 24 hours. This causes auxiliary title generation (and potentially other xAI-dependent background tasks) to fail with:

HTTP 403: OAuth2 access token could not be validated

The user must manually re-authenticate (hermes auth login xai) to restore functionality.

Expected Behavior

The token should be automatically refreshed before expiry, as documented in the xAI Grok OAuth guide:

"After the first login, credentials are stored under ~/.hermes/auth.json and refreshed automatically before they expire."

Actual Behavior

  • Token expires in < 24 hours.
  • No automatic refresh occurs.
  • Background services (e.g., title generation) break silently until the user notices and manually re-logs in.

Environment

  • Hermes Agent: latest stable
  • OS: macOS
  • Auth provider: xAI Grok OAuth

Possible Cause

The automatic refresh logic may not be triggering for xAI tokens, or the refresh token itself has a very short validity window that Hermes does not account for.

Workaround

Manually run hermes auth login xai every day.

Suggested Fix

  1. Investigate why xAI token refresh is not happening automatically.
  2. If xAI's refresh window is unusually short, consider more aggressive pre-emptive refresh scheduling.
  3. Surface token expiry warnings to the user before background tasks start failing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havearea/authAuthentication, OAuth, credential poolscomp/agentCore agent loop, run_agent.py, prompt builderprovider/xaixAI (Grok)type/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions