Skip to content

fix(moa): resolve xAI OAuth references via direct credential path - #53602

Closed
Ne0teric wants to merge 1 commit into
NousResearch:mainfrom
Ne0teric:fix/moa-xai-oauth
Closed

fix(moa): resolve xAI OAuth references via direct credential path#53602
Ne0teric wants to merge 1 commit into
NousResearch:mainfrom
Ne0teric:fix/moa-xai-oauth

Conversation

@Ne0teric

Copy link
Copy Markdown
Contributor

Problem

The auxiliary_client.call_llm path used for MoA reference models does not support OAuth-backed providers. When xai-oauth is configured as a MOA reference provider, each call silently fails with an unknown-provider error, and the Grok reference responses are dropped. Users get a degraded MOA experience with no indication anything is wrong.

The aggregator still returns results (from the remaining models), so the failure is invisible unless you check agent.log for the "MoA reference model xai-oauth:... failed" warning.

Fix

Adds _call_reference_direct() — a new code path in moa_loop.py that resolves OAuth credentials through hermes_cli.runtime_provider.resolve_runtime_provider() and creates a direct OpenAI client, bypassing auxiliary_client entirely.

The _run_reference() function now checks the provider name: OAuth providers (currently xai-oauth) take the direct path; everything else continues through call_llm as before.

Also adds a success log line with timing and char count so MOA reference performance is observable at INFO level.

Testing

  • _call_reference_direct verified end-to-end: resolves xai-oauth JWT, calls grok-build-0.1 and grok-4.3, returns ChatCompletion
  • _extract_text parses the response correctly
  • All 5 existing MOA loop tests pass
  • Logging confirmed working — example output: INFO agent.moa_loop: MoA reference xai-oauth:grok-build-0.1 succeeded in 1.6s (7 chars)

Related

This is a companion to the resolve_runtime_provider infrastructure that already powers the main model path for xai-oauth — it was just never plumbed into the MOA reference codepath.

The auxiliary_client call_llm path does not support OAuth providers,
so xai-oauth reference models silently failed in every MOA turn.
This adds _call_reference_direct(), which resolves credentials
through hermes_cli.runtime_provider and makes the API call directly
with an OpenAI-compatible client.

Also adds a success log line with timing and char count so MOA
reference performance is observable.

Fixes: moa references with xai-oauth were silently dropped
@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) P3 Low — cosmetic, nice to have labels Jun 27, 2026
@Ne0teric

Copy link
Copy Markdown
Contributor Author

Superseded by new PR — codebase has diverged since this was opened

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P3 Low — cosmetic, nice to have 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