Skip to content

fix(auxiliary): support minimax-oauth provider for auxiliary tasks - #42128

Open
seansteynvida wants to merge 1 commit into
NousResearch:mainfrom
seansteynvida:fix/minimax-oauth-auxiliary-tasks
Open

fix(auxiliary): support minimax-oauth provider for auxiliary tasks#42128
seansteynvida wants to merge 1 commit into
NousResearch:mainfrom
seansteynvida:fix/minimax-oauth-auxiliary-tasks

Conversation

@seansteynvida

Copy link
Copy Markdown

Summary

  • Auxiliary tasks (title generation, compression, session search, web extract, etc.) configured as auto are supposed to fall back to the user's main provider/model, but resolve_provider_client() only special-cased nous, openai-codex, and xai-oauth for OAuth providers.
  • minimax-oauth (auth_type oauth_minimax) fell through to the generic "unhandled auth_type" branch and returned (None, None), so every auxiliary task on a MiniMax OAuth account logged No LLM provider configured for task=... even though the user was logged in and the main chat session worked fine.
  • Adds _build_minimax_oauth_aux_client(), mirroring the existing xai-oauth helper: it resolves credentials via resolve_minimax_oauth_runtime_credentials() (which already handles MiniMax's short-lived access-token refresh) and wraps the client in AnthropicAuxiliaryClient, since MiniMax OAuth's inference endpoint speaks the Anthropic Messages API (api.minimax.io/anthropic — already recognized in _ANTHROPIC_COMPAT_PROVIDERS).
  • Wires a new provider == "minimax-oauth" branch into resolve_provider_client() alongside the existing xai-oauth branch.

Test plan

  • python3 -m ast syntax check on the modified module
  • Manual repro: with model.provider: minimax-oauth and auxiliary.title_generation.provider: auto, confirm title generation no longer logs No LLM provider configured for task=title_generation and produces a session title via the MiniMax OAuth session

Auxiliary tasks (title generation, compression, session search, web
extract, etc.) configured as "auto" fall back to the user's main
provider/model. resolve_provider_client() special-cased nous,
openai-codex, and xai-oauth for this, but minimax-oauth (auth_type
"oauth_minimax") fell through to the generic "unhandled auth_type"
branch and returned (None, None) — so every auxiliary task on a
MiniMax OAuth account logged "No LLM provider configured" even though
the user was logged in.

Add _build_minimax_oauth_aux_client(), mirroring the xai-oauth helper:
it resolves credentials via the existing
resolve_minimax_oauth_runtime_credentials() (which handles MiniMax's
short-lived access-token refresh) and wraps the client in
AnthropicAuxiliaryClient, since MiniMax OAuth's inference endpoint
speaks the Anthropic Messages API (api.minimax.io/anthropic — already
recognized in _ANTHROPIC_COMPAT_PROVIDERS).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint provider/minimax MiniMax (Anthropic transport) area/auth Authentication, OAuth, credential pools labels Jun 8, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Same fix as the open #36779 and #40122 — adds the minimax-oauth branch + _build_minimax_oauth_aux_client() to resolve_provider_client() in auxiliary_client.py so auxiliary tasks fall back correctly (fixes #21521 / #36091). These three should be consolidated onto one.

@tonydwb tonydwb left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review Summary

Verdict: Approved

Looks Good

  • Fixes minimax-oauth provider support for auxiliary tasks: properly builds the auxiliary client with OAuth-enabled credentials when is_oauth=True.
  • No security concerns, no debug artifacts.

Reviewed by Hermes Agent

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for isolating the missing MiniMax OAuth auxiliary route. The premise remains valid on current main: hermes_cli/auth.py:301-306 declares oauth_minimax, while agent/auxiliary_client.py:5106-5129 does not handle that auth type.

Problems

  • agent/auxiliary_client.py:1951 calls resolve_minimax_oauth_runtime_credentials() without as_token_provider=True, and :1955 coerces the result to str. Current hermes_cli/auth.py:7779-7800 documents that a static MiniMax token expires after about 15 minutes; the callable provider is required to refresh per request.
  • The PR adds no regression tests. The adjacent OAuth fallback patterns are tested in tests/agent/test_auxiliary_client.py:734-880.

Suggested changes

  • Port the branch onto the current router and preserve resolve_minimax_oauth_runtime_credentials(as_token_provider=True)'s callable through build_anthropic_client; callable credentials are supported at agent/anthropic_adapter.py:713-751.
  • Add mocked resolver tests for MiniMax OAuth, including empty-model fallback and the refreshable token-provider path.

This is an automated hermes-sweeper review.

Comment thread agent/auxiliary_client.py
from hermes_cli.auth import resolve_minimax_oauth_runtime_credentials
from agent.anthropic_adapter import build_anthropic_client

creds = resolve_minimax_oauth_runtime_credentials()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use as_token_provider=True here and preserve the returned callable rather than coercing it to str below. Current hermes_cli/auth.py:7779-7800 documents that MiniMax access tokens expire after about 15 minutes; build_anthropic_client accepts a callable and refreshes authorization per request.

@teknium1 teknium1 added sweeper:risk-security-boundary Sweeper risk: may affect sandboxing, auth, credentials, or sensitive data sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/auth Authentication, OAuth, credential pools comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P3 Low — cosmetic, nice to have provider/minimax MiniMax (Anthropic transport) sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-security-boundary Sweeper risk: may affect sandboxing, auth, credentials, or sensitive data type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants