fix(auxiliary): support minimax-oauth in auxiliary client router (fixes #21521, #36091)#40122
Open
ubxty wants to merge 1 commit into
Open
fix(auxiliary): support minimax-oauth in auxiliary client router (fixes #21521, #36091)#40122ubxty wants to merge 1 commit into
ubxty wants to merge 1 commit into
Conversation
…uter
Auxiliary client dispatcher (title generation, compression, vision,
session_search, …) gated the OAuth provider branch on
{auth_type in {'oauth_device_code', 'oauth_external'}}, but
minimax-oauth is declared in hermes_cli/auth.py with
auth_type='oauth_minimax'. The call fell through to the generic
'unhandled auth_type' warning and returned (None, None), causing
title generation to fail with HTTP 401 at the end of every session
(NousResearch#21521) and breaking kanban specify and
other auxiliary tasks that pin a fallback provider (NousResearch#36091).
Add 'oauth_minimax' to the dispatch gate and a new
_build_minimax_oauth_aux_client() that mirrors _try_anthropic() —
MiniMax's inference endpoint is Anthropic-API compatible — but
installs build_minimax_oauth_token_provider() as a per-request
callable api_key, so MiniMax's 15-minute access-token TTL is
auto-refreshed (same pattern as the main runtime in
agent_runtime_helpers.py:1460). Adds four tests covering happy
path, main-model fallback, not-logged-in, and a regression guard
against the previous fix attempt (PR NousResearch#35539) that wrapped an
OpenAI client in AnthropicAuxiliaryClient.
Refs NousResearch#21521, NousResearch#36091
This was referenced Jun 8, 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.
Problem
Hermes users with
minimax-oauthas their main provider see this on every CLI session:⚠ Auxiliary title generation failed: HTTP 401: Invalid Authentication
The same root cause breaks
kanban specifyand any other auxiliary task that doesn't pin a fallback provider.Root cause
hermes_cli/auth.py:301declares MiniMax OAuth withauth_type="oauth_minimax".agent/auxiliary_client.pydispatches onpconfig.auth_type, but the OAuth provider branch was gated on{"oauth_device_code", "oauth_external"}—"oauth_minimax"was not in the set. The call therefore fell through to the generic warning at the bottom of the resolver and returned(None, None).Fix
"oauth_minimax"to the OAuth provider dispatch gate (1 line).minimax-oauthcase in the provider switch that delegates to a new builder,_build_minimax_oauth_aux_client()(12 lines)._try_anthropic()— MiniMax's inference endpoint is Anthropic-API compatible — but installsbuild_minimax_oauth_token_provider()as a per-request callableapi_key, so MiniMax's 15-minute access-token TTL is auto-refreshed on every outbound request. Same pattern the main runtime uses (agent/agent_runtime_helpers.py:1460).Tests
Four new tests in
TestMiniMaxOAuthAuxiliaryClient:test_resolve_minimax_oauth_dispatches_to_anthropic_compat— happy path, asserts the builder is called with the rightinference_base_url.test_resolve_minimax_oauth_uses_main_model_when_empty— universal fallback chain (Step 3 main-model) still works when no model is passed and there is no catalog default.test_resolve_minimax_oauth_returns_none_when_not_logged_in— swallowedAuthErrorreturns(None, None)so the chain falls through to its next provider.test_builder_uses_anthropic_sdk_not_openai— regression guard for the previous fix attempt (PR fix: resolve minimax-oauth auxiliary client routing #35539) that wrapped anOpenAIclient inAnthropicAuxiliaryClientand crashed at runtime.Verification
pytest tests/agent/test_auxiliary_client.py— 211 passed.pytest tests/agent/test_minimax_provider.py tests/agent/test_minimax_auxiliary_url.py tests/plugins/model_providers/test_minimax_profile.py— 276 passed total.call_llm(task='title_generation', ...)returns a real title (no HTTP 401, no 'unhandled auth_type' warning).Notes
minimax-oauthwork for ALL auxiliary tasks, not just title generation. The default model is the one registered on the provider profile (MiniMax-M2.7perplugins/model-providers/minimax/__init__.py).AnthropicAuxiliaryClientalready accepts a callableapi_key(the bearer-hook machinery inagent/anthropic_adapter.pycalls it per-request), so no upstream changes to the wrapper are needed.Fixes #21521, #36091