Skip to content

[Bug]: minimax-oauth auxiliary client returns raw Anthropic SDK client instead of AnthropicAuxiliaryClient wrapper #36091

@DavesAgenda

Description

@DavesAgenda

Bug Description

get_text_auxiliary_client('triage_specifier') (and other auxiliary tasks) returns (None, None) for minimax-oauth users because oauth_minimax auth type was missing from the OAuth routing branch in resolve_provider_client().

When minimax-oauth main provider is used, kanban specify fails with Specify failed: no auxiliary client configured because the auxiliary auto-detect chain skips minimax-oauth entirely.

Root Cause

In agent/auxiliary_client.py, resolve_provider_client() dispatches on pconfig.auth_type. The OAuth branch at line 3810 had:

elif pconfig.auth_type in {"oauth_device_code", "oauth_external", "oauth_minimax"}:

But there was no if provider == 'minimax-oauth': handler block, so minimax-oauth fell through to the warning and returned (None, None).

Previous Fix Attempt

PR #35539 (closed as abandoned) attempted to fix this but used OpenAI() client wrapped in AnthropicAuxiliaryClient. Since AnthropicAuxiliaryClient calls self._client.messages.create() (Anthropic SDK interface), an OpenAI client has no messages attribute and causes AttributeError at runtime.

Fix

The correct fix adds a minimax-oauth handler in the OAuth branch that:

  1. Uses anthropic.Anthropic SDK client directly (NOT OpenAI client) because MiniMax's /anthropic endpoint uses the Anthropic Messages API
  2. Wraps it in AnthropicAuxiliaryClient so callers get the chat.completions.create() interface they expect
if provider == "minimax-oauth":
    from hermes_cli.auth import resolve_minimax_oauth_runtime_credentials
    import anthropic
    creds = resolve_minimax_oauth_runtime_credentials(as_token_provider=False)
    real_client = anthropic.Anthropic(
        api_key=creds["api_key"],
        base_url=creds["base_url"].rstrip("/"),
    )
    resolved_model = model or "MiniMax-M2.7"
    sync_wrapper = AnthropicAuxiliaryClient(
        real_client, resolved_model, creds["api_key"], creds["base_url"], is_oauth=True,
    )
    if async_mode:
        return AsyncAnthropicAuxiliaryClient(sync_wrapper), resolved_model
    return sync_wrapper, resolved_model

Affected Surfaces

  • kanban specify (triage_specifier auxiliary task)
  • kanban decompose
  • profile describe
  • goals continue/rewrite
  • Any auxiliary task when minimax-oauth is the main provider

Labels

type/bug, comp/agent, provider/minimax

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havecomp/agentCore agent loop, run_agent.py, prompt builderprovider/minimaxMiniMax (Anthropic transport)type/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions