hermes - 💡(How to fix) Fix [Bug]: minimax-oauth auxiliary client returns raw Anthropic SDK client instead of AnthropicAuxiliaryClient wrapper

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

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).

Fix Action

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

Code Example

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

---

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
RAW_BUFFERClick to expand / collapse

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

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING