Skip to content

fix: resolve minimax-oauth auxiliary client routing#35539

Closed
arcgameszz wants to merge 1 commit into
NousResearch:mainfrom
arcgameszz:fix-minimax-oauth-aux-client
Closed

fix: resolve minimax-oauth auxiliary client routing#35539
arcgameszz wants to merge 1 commit into
NousResearch:mainfrom
arcgameszz:fix-minimax-oauth-aux-client

Conversation

@arcgameszz

Copy link
Copy Markdown

Summary

The minimax-oauth provider was missing from the OAuth branch in resolve_provider_client(), causing get_text_auxiliary_client() to return (None, None) for minimax-oauth users.

Changes

_resolve_minimax_oauth_for_aux()

Resolves (api_key, base_url) from credential pool or auth store, ensuring /anthropic suffix for MiniMax's Anthropic-compatible endpoint.

_build_minimax_oauth_aux_client()

Builds an AnthropicAuxiliaryClient using build_anthropic_client() (the Anthropic SDK client, NOT the OpenAI client) — properly wrapping the Anthropic SDK client for the /anthropic endpoint.

Routing in resolve_provider_client()

Added provider == 'minimax-oauth' branch with default model MiniMax-M2.7-highspeed.

Root Cause

The original implementation passed an OpenAI SDK client (OpenAI(api_key=..., base_url=...)) to AnthropicAuxiliaryClient. Since AnthropicAuxiliaryClient internally calls self._client.messages.create() (the Anthropic SDK interface), and the OpenAI SDK has no messages attribute, this caused:

Fix

Use build_anthropic_client() from agent.anthropic_adapter to create the proper Anthropic SDK client before wrapping it in AnthropicAuxiliaryClient.

The minimax-oauth provider was missing from the OAuth branch in
resolve_provider_client(), causing get_text_auxiliary_client() to
return (None, None) for minimax-oauth users.

This commit adds:
- _resolve_minimax_oauth_for_aux(): resolves (api_key, base_url) from
  credential pool or auth store, ensuring /anthropic suffix for MiniMax's
  Anthropic-compatible endpoint.
- _build_minimax_oauth_aux_client(): builds an AnthropicAuxiliaryClient
  using build_anthropic_client() (NOT OpenAI client), properly wrapping
  the Anthropic SDK client for the /anthropic endpoint.
- Routing for provider == 'minimax-oauth' in the OAuth branch, with
  default model MiniMax-M2.7-highspeed.

Fixes: 'OpenAI' object has no attribute 'messages' when the
AnthropicAuxiliaryClient tried to call messages.create() on an
OpenAI SDK instance.
@arcgameszz arcgameszz closed this May 30, 2026
@arcgameszz arcgameszz deleted the fix-minimax-oauth-aux-client branch May 30, 2026 21:37
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/agent Core agent loop, run_agent.py, prompt builder provider/minimax MiniMax (Anthropic transport) labels May 30, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #22213 (fixes #21521). Multiple PRs have addressed this same minimax-oauth missing branch in resolve_provider_client() — see also #25287, #27640. Closing was correct.

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

Labels

comp/agent Core agent loop, run_agent.py, prompt builder P3 Low — cosmetic, nice to have provider/minimax MiniMax (Anthropic transport) type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants