fix: resolve minimax-oauth auxiliary client routing#35539
Closed
arcgameszz wants to merge 1 commit into
Closed
Conversation
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.
Collaborator
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.
Summary
The
minimax-oauthprovider was missing from the OAuth branch inresolve_provider_client(), causingget_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/anthropicsuffix for MiniMax's Anthropic-compatible endpoint._build_minimax_oauth_aux_client()Builds an
AnthropicAuxiliaryClientusingbuild_anthropic_client()(the Anthropic SDK client, NOT the OpenAI client) — properly wrapping the Anthropic SDK client for the/anthropicendpoint.Routing in
resolve_provider_client()Added
provider == 'minimax-oauth'branch with default modelMiniMax-M2.7-highspeed.Root Cause
The original implementation passed an OpenAI SDK client (
OpenAI(api_key=..., base_url=...)) toAnthropicAuxiliaryClient. SinceAnthropicAuxiliaryClientinternally callsself._client.messages.create()(the Anthropic SDK interface), and the OpenAI SDK has nomessagesattribute, this caused:Fix
Use
build_anthropic_client()fromagent.anthropic_adapterto create the proper Anthropic SDK client before wrapping it inAnthropicAuxiliaryClient.