fix(moa): resolve xAI OAuth references via direct credential path - #53602
Closed
Ne0teric wants to merge 1 commit into
Closed
fix(moa): resolve xAI OAuth references via direct credential path#53602Ne0teric wants to merge 1 commit into
Ne0teric wants to merge 1 commit into
Conversation
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
Contributor
Author
|
Superseded by new PR — codebase has diverged since this was opened |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
auxiliary_client.call_llmpath used for MoA reference models does not support OAuth-backed providers. Whenxai-oauthis 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 inmoa_loop.pythat resolves OAuth credentials throughhermes_cli.runtime_provider.resolve_runtime_provider()and creates a directOpenAIclient, bypassingauxiliary_cliententirely.The
_run_reference()function now checks the provider name: OAuth providers (currentlyxai-oauth) take the direct path; everything else continues throughcall_llmas before.Also adds a success log line with timing and char count so MOA reference performance is observable at
INFOlevel.Testing
_call_reference_directverified end-to-end: resolves xai-oauth JWT, callsgrok-build-0.1andgrok-4.3, returnsChatCompletion_extract_textparses the response correctlyINFO 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_providerinfrastructure that already powers the main model path for xai-oauth — it was just never plumbed into the MOA reference codepath.