Skip to content

fix(aux): keep xai oauth auxiliary on chat completions - #34241

Draft
LeonSGP43 wants to merge 1 commit into
NousResearch:mainfrom
LeonSGP43:fix-34171-xai-oauth-aux-chat-completions
Draft

fix(aux): keep xai oauth auxiliary on chat completions#34241
LeonSGP43 wants to merge 1 commit into
NousResearch:mainfrom
LeonSGP43:fix-34171-xai-oauth-aux-chat-completions

Conversation

@LeonSGP43

Copy link
Copy Markdown
Contributor

Fixes #34171.

Summary

  • keep xAI OAuth auxiliary clients on native chat completions instead of wrapping them in the Responses adapter
  • preserve the existing explicit-model and unauthenticated fallthrough behavior
  • update the xAI OAuth routing regression test to pin the chat-completions contract

Testing

  • uv run --frozen pytest -q -o addopts='' tests/hermes_cli/test_auth_xai_oauth_provider.py -k "auxiliary_client_routes_xai_oauth_through_chat_completions_api or auxiliary_client_xai_oauth_returns_none_when_unauthenticated or auxiliary_client_xai_oauth_requires_explicit_model"
  • uv run --frozen ruff check agent/auxiliary_client.py tests/hermes_cli/test_auth_xai_oauth_provider.py
  • git diff --check

@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 provider/xai xAI (Grok) area/auth Authentication, OAuth, credential pools P3 Low — cosmetic, nice to have labels May 29, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the focused auxiliary-routing investigation. Current main now has an explicit, conflicting xAI OAuth transport contract.

Problems

  • agent/auxiliary_client.py:2429-2452 intentionally wraps xAI OAuth auxiliary clients in CodexAuxiliaryClient; tests/hermes_cli/test_auth_xai_oauth_provider.py:1840-1875 asserts that contract.
  • The main resolver independently selects api_mode="codex_responses" for xAI OAuth in hermes_cli/runtime_provider.py:421-423. Returning a plain client only for auxiliaries would diverge from the active provider route and bypass xAI Responses handling in agent/auxiliary_client.py:950-1008.

Suggested changes

  • Please reproduce the 403 using the current device-code OAuth flow before changing this contract.
  • If it persists, update the shared routing/adapter behavior coherently and retain equivalent schema-sanitization and cache behavior with an end-to-end regression.

Automated hermes-sweeper review.

@teknium1 teknium1 added sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-caching Sweeper risk: may break/degrade prompt caching or cache-key stability (invariant) sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users labels Jul 13, 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 P3 Low — cosmetic, nice to have provider/xai xAI (Grok) sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users sweeper:risk-caching Sweeper risk: may break/degrade prompt caching or cache-key stability (invariant) sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

xai-oauth auxiliary client incorrectly uses Responses API (CodexAuxiliaryClient), causing 403 on compression/vision/web_extract

3 participants