fix: handle minimax oauth fallback routing#27640
Closed
shivros wants to merge 1 commit into
Closed
Conversation
Collaborator
Extract MiniMax OAuth resolution into dedicated helpers matching the established xai-oauth pattern (_resolve_*_for_aux + _build_*_aux_client). The generic oauth_device_code / oauth_external arm does not cover oauth_minimax, so resolve_provider_client() silently skipped the MiniMax backup and fell through to the next provider. The new dedicated branch resolves credentials (pool-aware), builds an Anthropic-wire client, and wraps it in AnthropicAuxiliaryClient.
b5005b6 to
7bef395
Compare
Author
|
Closing in favor of #22213 and #25287 — this is a duplicate per @alt-glitch's note. Happy to contribute the pool-aware credential resolution pattern from this PR to whichever one lands. Thanks for the review. |
This was referenced May 21, 2026
This was referenced May 30, 2026
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
Add dedicated MiniMax OAuth handling in the auxiliary client resolver, matching the established xai-oauth pattern.
New helpers (in
agent/auxiliary_client.py):_resolve_minimax_oauth_for_aux()— pool-aware credential resolution, falling back to the auth-store singleton_build_minimax_oauth_aux_client(model)— builds anAnthropicAuxiliaryClientviabuild_anthropic_client_build_anthropic_real_client(api_key, base_url)— thin wrapper around the Anthropic adapter importThe inline branch in
resolve_provider_client()shrinks to the standard ~8-line pattern used by xai-oauth and other OAuth providers.Problem
minimax-oauthusesauth_type: oauth_minimax, which is not covered by the genericoauth_device_code/oauth_externalarm. Without a dedicated branch, the resolver loggedunhandled auth_type oauth_minimaxand skipped MiniMax entirely, falling through to the next backup provider.Test Plan
python -m pytest -q tests/agent/test_auxiliary_client.py -k minimax_oauth— 2 passed