Skip to content

auxiliary_client.py: unhandled auth_type 'oauth_minimax' breaks all auxiliary tasks for minimax-oauth users #45242

Closed as duplicate

Description

@Slaventuss

auxiliary_client.py: unhandled auth_type 'oauth_minimax' breaks all auxiliary tasks for minimax-oauth users

Symptom

When auxiliary.<task>.provider: minimax-oauth is set in config.yaml, every auxiliary task (compression, vision, title_generation, session_search, web_extract, approval, flush_memories, kanban_decomposer, mcp, profile_describer, skills_hub, triage_specifier, curator) returns (None, None) and the user sees:

⚠ No auxiliary LLM provider configured — context compression will drop middle turns without a summary. Run `hermes setup` or set OPENROUTER_API_KEY.

The main model.provider: minimax-oauth path keeps working — only auxiliary tasks are broken.

Root cause

agent/auxiliary_client.py::resolve_provider_client handles these auth_type values:

  • api_key (regular providers)
  • aws_sdk (Bedrock)
  • oauth_device_code (Nous, OpenAI Codex, xAI — hardcoded)
  • oauth_external (same as above)

minimax-oauth has auth_type == "oauth_minimax" (a separate value defined in hermes_cli/auth.py:301 as "MiniMax (OAuth · minimax.io)"). The function falls through to the final logger.warning("unhandled auth_type ...") and returns (None, None).

Verified in ~/.hermes/logs/agent.log:

WARNING agent.auxiliary_client: resolve_provider_client: unhandled auth_type oauth_minimax for minimax-oauth
WARNING agent.title_generator: Title generation failed: Provider 'minimax-oauth' is set in config.yaml but no API key was found. Set the MINIMAX-OAUTH_API_KEY environment variable, or switch to a different provider with `hermes model`.

Test gap

tests/plugins/model_providers/test_minimax_profile.py::test_consumer_api_returns_non_empty_for_each_provider checks that _get_aux_model_for_provider returns a non-empty model, but does NOT exercise resolve_provider_client end-to-end. A minimal E2E test that calls resolve_provider_client("minimax-oauth") and asserts the result is not (None, None) would have caught this.

Affected versions

Hermes 0.16.0 (verified 2026-06-13 on macOS). Earlier versions may also be affected.

Suggested fix

Add an elif pconfig.auth_type == "oauth_minimax": branch in resolve_provider_client, before the final unhandled auth_type warning. Use the same build_minimax_oauth_token_provider() callable + AnthropicAuxiliaryClient pattern that's already in agent_init.py:657-660 for the main client, with pconfig.inference_base_url as base_url.

Roughly:

elif pconfig.auth_type == "oauth_minimax":
    if provider != "minimax-oauth":
        logger.warning("auth_type oauth_minimax but provider=%r — refusing", provider)
        return None, None
    try:
        from hermes_cli.auth import build_minimax_oauth_token_provider
        from agent.anthropic_adapter import build_anthropic_client
    except ImportError as exc:
        logger.warning("minimax-oauth aux: deps missing: %s", exc)
        return None, None
    final_model = _normalize_resolved_model(
        model or _get_aux_model_for_provider("minimax-oauth"), provider,
    )
    base_url = (pconfig.inference_base_url or "").rstrip("/")
    if not base_url:
        return None, None
    try:
        token_provider = build_minimax_oauth_token_provider()
        real_client = build_anthropic_client(token_provider, base_url)
    except Exception as exc:
        logger.warning("cannot build MiniMax OAuth aux client: %s", exc)
        return None, None
    client = AnthropicAuxiliaryClient(
        real_client, final_model, api_key=token_provider,
        base_url=base_url, is_oauth=True,
    )
    return (_to_async_client(client, final_model, is_vision=is_vision)
            if async_mode else (client, final_model))

Workaround

Set auxiliary.<task>.provider: auto — falls back to OpenRouter (or another detected provider). Works, but burns credits instead of using the OAuth subscription. Not aligned with the "use OAuth subscription, not API key" preference.

Notes for the reviewer

  • The same OAuth + Anthropic-compat pattern is already used in three other places in the codebase: agent_init.py:657-660, agent_runtime_helpers.py:1474-1484, credential_pool.py:1835-1844. The auxiliary-client resolver is the only place that was missed.
  • _ANTHROPIC_COMPAT_PROVIDERS in auxiliary_client.py:4827 already lists "minimax-oauth", so Anthropic-formatted image blocks are emitted correctly. The client-builder is what's missing.
  • build_minimax_oauth_token_provider() returns a zero-arg callable that re-reads auth.json per request and refreshes the bearer when within MINIMAX_OAUTH_REFRESH_SKEW_SECONDS of expiry — required because MiniMax access tokens are short-lived (~15min).

Activity

  1. added
    type/bugSomething isn't working
    comp/agentCore agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint
    P3Low — cosmetic, nice to have
    duplicateThis issue or pull request already exists
    on Jun 12, 2026
  2. alt-glitch commented on Jun 12, 2026

    @alt-glitch

    Duplicate of #21521 (same root cause: auxiliary_client.py::resolve_provider_client has no oauth_minimax branch, so all auxiliary tasks return (None, None) for minimax-oauth users). Fix PRs: #42128, #40122. Note: #45241 is an identical twin of this report.

  3. Slaventuss commented on Jun 13, 2026

    @Slaventuss
    Author

    Closing as duplicate of #21521. Same fix is being worked on in #42128 and #40122 (both still open). Local 35-line patch verified working on 0.16.0 (2026-06-13) using build_minimax_oauth_token_provider() + AnthropicAuxiliaryClient. Backup at auxiliary_client.py.bak.pre-minimax-oauth-fix-20260613_010030.

  4. andrexibiza commented on Aug 3, 2026

    @andrexibiza

    Resolved by PR #77419 — ready to close.

    The oauth_minimax auth_type breaking all auxiliary tasks is fixed by PR #77419 (fix(auxiliary): route oauth_minimax through AnthropicAuxiliaryClient, #77419).

    • Root cause: resolve_provider_client only dispatched oauth_device_code/oauth_external; oauth_minimax fell through to (None, None), silently breaking every auxiliary task.
    • Fix: oauth_minimax added to the OAuth dispatch; minimax-oauth routes to the MiniMax Anthropic-compatible builder with a callable token provider.
    • Implementation cherry-picked from fix(auxiliary): route minimax-oauth through AnthropicAuxiliaryClient #47703 by @Dr-Basim (authorship preserved), with 3 regression tests + docs added.
    • Verified on current main: 170 passed (4 pre-existing failures stash-proven); git diff --check clean.

    Suggested action: close as resolved-by #77419.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havecomp/agentCore agent runtime: loop, agent_init, prompt builder, context-compression, responses endpointduplicateThis issue or pull request already existsprovider/minimaxMiniMax (Anthropic transport)type/bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions