Skip to content

chore: rebase #25968 (xai-oauth) on latest main + fix review issues - #27148

Closed
avirweb wants to merge 2 commits into
NousResearch:mainfrom
avirweb:feat/xai-oauth-pr
Closed

chore: rebase #25968 (xai-oauth) on latest main + fix review issues#27148
avirweb wants to merge 2 commits into
NousResearch:mainfrom
avirweb:feat/xai-oauth-pr

Conversation

@avirweb

@avirweb avirweb commented May 16, 2026

Copy link
Copy Markdown

Rebase of am423's PR #25968 onto latest upstream main, with audit fixes for the review issues surfaced on that PR.

What this is

This is not a new feature. It's a rebase + cleanup of the existing open PR #25968 (feat/xai-oauth-first-class), which was stale and had merge conflicts. While rebasing, the following issues were also fixed:

Fixes

  • Duplicate function definitions: 3 upstream xai-oauth functions (get_xai_oauth_auth_status, resolve_xai_oauth_runtime_credentials, _login_xai_oauth) were silently shadowed by the rebased versions — removed the old ones
  • Wrong credential pool seeding: OAuth bearer JWT was being written into the xai API-key credential pool — removed the call
  • env_vars on OAuth provider: XAI_API_KEY in env_vars could leak into the OAuth resolution path — cleared to empty
  • datetime.fromisoformat Z suffix: Python <3.11 can't parse timestamps with Z suffix — normalize to +00:00
  • expires_in TypeError: Unsafe int() on nullable OAuth response field — added null guard
  • Suppressed credential errors: debug-level logging swallowed the clear not-logged-in AuthError — changed to warn + re-raise
  • stdout pollution: print() in import helper was called from resolve_provider (non-interactive path) — replaced with logger.info

Supersedes #25968, #27144.

@cardtest15-coder

This comment was marked as spam.

@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/plugins Plugin system and bundled plugins provider/xai xAI (Grok) area/auth Authentication, OAuth, credential pools labels May 16, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Competing with #27144 (same rebase of #25968 by different author) and original #25968 (still open). Team should pick one to move forward with.

@avirweb avirweb changed the title feat(xai-oauth): Grok OAuth provider with Grok CLI auto-import + credential sourcing WIP: feat(xai-oauth): Grok OAuth provider with Grok CLI auto-import [waiting for approval] May 16, 2026
@avirweb avirweb changed the title WIP: feat(xai-oauth): Grok OAuth provider with Grok CLI auto-import [waiting for approval] chore: rebase #25968 (xai-oauth) on latest main + fix review issues May 16, 2026
@avirweb
avirweb force-pushed the feat/xai-oauth-pr branch 3 times, most recently from dcda76d to be59e1a Compare May 16, 2026 22:57
…s, runtime exceptions, fromisoformat Z, expires_in coercion
@avirweb
avirweb force-pushed the feat/xai-oauth-pr branch from be59e1a to 4b7d7eb Compare May 16, 2026 23:02
@teknium1

Copy link
Copy Markdown
Contributor

Closing this one.

The premise "the official is kinda broken, this fixes it" doesn't hold up against the current state of main. xAI Grok OAuth officially landed via #26534 on May 15 and has had five follow-up hardenings merged since:

hermes_cli/auth.py on current main has ~50+ lines of xai-oauth wiring (ProviderConfig, alias map, OAuth-capable provider set, token read/save, refresh, PKCE login flow). All of #25968's substantive content was salvaged into the official merge.

Re-rebasing #25968 wholesale on top of all that is not a useful diff shape. If something specific is still broken on current main, the right move is to file an issue with reproducible steps against the merged version (or open a narrow PR fixing the specific bug), not to re-land an old branch as a "rebase."

Thanks for tracking it — and credit to @ams432 for the original work, which is already in main.

@teknium1 teknium1 closed this May 17, 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/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