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
- Set main provider to
minimax-cn with model minimax/minimax-m2.7 in config.yaml
- Set
auxiliary.compression.provider: auto (or leave as default)
- Start gateway via launchd service
- 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
Bug Description
Auxiliary compression (and other auxiliary tasks) fail when
provider: autois used withminimax-cnas the main provider, because the model name is not normalized before being sent to the API.Steps to Reproduce
minimax-cnwith modelminimax/minimax-m2.7inconfig.yamlauxiliary.compression.provider: auto(or leave as default)Expected Behavior
The model name should be normalized to
MiniMax-M2.7before being sent to the MiniMax API.Actual Behavior
The API receives
minimax/minimax-m2.7(with lowercase prefix and slash), resulting in:Root Cause Analysis
Two issues combine to cause this bug:
Issue 1:
_resolve_auto()does not normalize model namesIn
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 rawminimax/minimax-m2.7string is used instead of the correctly formattedMiniMax-M2.7.Relevant code path:
_resolve_auto()→resolve_provider_client(main_provider, main_model, ...)resolve_provider_client()usesresolve_api_key_provider_credentials()which does NOT apply_normalize_resolved_model()to the model nameexplicit_base_urlis 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. TheMINIMAX_CN_API_KEYis only available in the.envfile, not in the launchd environment. This causes named providers likeminimax-cnto 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 toresolve_provider_client().Fix 2: Load .env for launchd-managed gateway
Either:
MINIMAX_CN_API_KEYto the launchd plistEnvironmentVariablesmanually, OR.envbefore starting the serviceEnvironment
auxiliary.compression.provider: auto