hermes - 💡(How to fix) Fix xai-oauth token exchange fails: code_challenge is required (PKCE code_verifier missing) [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

When running hermes auth add xai-oauth --no-browser, the OAuth authorization callback is received successfully (shows "xAI authorization received. You can close this tab.") but the token exchange with xAI fails with:

AuthError: xAI authorization failed: code_challenge is required

Error Message

AuthError: xAI authorization failed: code_challenge is required

Root Cause

The authorization code is received but the token exchange fails because the PKCE code_verifier is not being sent to xAI's token endpoint.

Fix Action

Fixed

Code Example

AuthError: xAI authorization failed: code_challenge is required
RAW_BUFFERClick to expand / collapse

Description

When running hermes auth add xai-oauth --no-browser, the OAuth authorization callback is received successfully (shows "xAI authorization received. You can close this tab.") but the token exchange with xAI fails with:

AuthError: xAI authorization failed: code_challenge is required

Steps to reproduce

  1. hermes auth add xai-oauth --no-browser
  2. Open the printed authorize URL in a browser
  3. Complete the OAuth flow (authorize the app)
  4. The callback is received (browser shows success page)
  5. Token exchange fails with code_challenge is required

Expected behavior

The authorization code should be successfully exchanged for tokens, and the xAI OAuth credential should be stored.

Actual behavior

The authorization code is received but the token exchange fails because the PKCE code_verifier is not being sent to xAI's token endpoint.

Environment

  • Hermes Agent v0.14.0 (2026.5.16)
  • Installed via pipx install git+https://github.com/NousResearch/hermes-agent.git
  • Running on Ubuntu 24.04

The OIDC discovery confirms xAI supports PKCE (code_challenge_methods_supported": ["S256"]), but Hermes doesn't include the code_verifier parameter in the token exchange POST request.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

The authorization code should be successfully exchanged for tokens, and the xAI OAuth credential should be stored.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix xai-oauth token exchange fails: code_challenge is required (PKCE code_verifier missing) [1 pull requests]