Skip to content

Auxiliary compression fails with minimax-cn: model name not normalized in auto-detect #12140

@WwNeXst

Description

@WwNeXst

Bug Description

Auxiliary compression (and other auxiliary tasks) fail when provider: auto is used with minimax-cn as the main provider, because the model name is not normalized before being sent to the API.

Steps to Reproduce

  1. Set main provider to minimax-cn with model minimax/minimax-m2.7 in config.yaml
  2. Set auxiliary.compression.provider: auto (or leave as default)
  3. Start gateway via launchd service
  4. Trigger context compression (when context reaches threshold)

Expected Behavior

The model name should be normalized to MiniMax-M2.7 before being sent to the MiniMax API.

Actual Behavior

The API receives minimax/minimax-m2.7 (with lowercase prefix and slash), resulting in:

unknown model 'minimax/minimax-m2.7' (2013)

Root Cause Analysis

Two issues combine to cause this bug:

Issue 1: _resolve_auto() does not normalize model names

In agent/auxiliary_client.py, _resolve_auto() at line 1164-1187 directly uses the main model's output from _read_main_model() without passing it through _normalize_resolved_model(). This means the raw minimax/minimax-m2.7 string is used instead of the correctly formatted MiniMax-M2.7.

Relevant code path:

  • _resolve_auto()resolve_provider_client(main_provider, main_model, ...)
  • But for named providers (not "custom"), resolve_provider_client() uses resolve_api_key_provider_credentials() which does NOT apply _normalize_resolved_model() to the model name
  • The normalization only happens when explicit_base_url is set (i.e., for "custom" provider)

Issue 2: launchd service doesn't load .env environment variables

When gateway runs via launchd, it does not load variables from ~/.hermes/.env. The MINIMAX_CN_API_KEY is only available in the .env file, not in the launchd environment. This causes named providers like minimax-cn to fail with empty API key even if the model name were correct.

Suggested Fixes

Fix 1: Normalize model name in _resolve_auto()

When using the main provider's model for auxiliary tasks, the model name should be normalized via _normalize_resolved_model() before being passed to resolve_provider_client().

Fix 2: Load .env for launchd-managed gateway

Either:

  • Document that users must add MINIMAX_CN_API_KEY to the launchd plist EnvironmentVariables manually, OR
  • Have the gateway/launchctl wrapper load .env before starting the service

Environment

  • hermes-agent (latest)
  • macOS (launchd-managed service)
  • Provider: minimax-cn
  • Model: minimax/minimax-m2.7
  • Config: auxiliary.compression.provider: auto

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existscomp/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