Skip to content

fix: resolve MiniMax 401 auth error by defaulting to anthropic_messages#2103

Merged
teknium1 merged 1 commit intomainfrom
hermes/hermes-3369cdb1
Mar 20, 2026
Merged

fix: resolve MiniMax 401 auth error by defaulting to anthropic_messages#2103
teknium1 merged 1 commit intomainfrom
hermes/hermes-3369cdb1

Conversation

@teknium1
Copy link
Copy Markdown
Contributor

Summary

Fixes #2094. Salvages PR #2100 by @devorun with additional root-cause fixes.

MiniMax's default inference_base_url in auth.py was /v1, which caused the runtime provider to default to chat_completions mode (OpenAI-style Authorization: Bearer header). MiniMax rejects this with a 401 because they require the Anthropic-style x-api-key header.

Root cause

The original MiniMax → Anthropic URL switch (commit 3ea53b8 from PR #1623) never landed on main. The runtime_provider infrastructure for Anthropic-compatible endpoints was added in PR #1997, but the actual MiniMax defaults remained on the broken /v1 path.

Changes

  • hermes_cli/auth.py — Change default inference_base_url for minimax and minimax-cn from /v1 to /anthropic (root cause fix for new users)
  • hermes_cli/runtime_provider.py — Auto-detect minimax/minimax-cn providers and default to anthropic_messages mode; auto-correct stale /v1 URLs from existing .env files to /anthropic (fixes existing users)
  • Tests — Updated 3 existing assertions, added 4 new tests: default URL detection, stale /v1 auto-correction (both minimax and minimax-cn), and explicit api_mode override respected

Test plan

5525 passed, 200 skipped, 23 deselected, 26 warnings in 174.98s
MiniMax's default base URL was /v1 which caused runtime_provider to
default to chat_completions mode (OpenAI-style Authorization: Bearer
header). MiniMax rejects this with a 401 because they require the
Anthropic-style x-api-key header.

Changes:
- auth.py: Change default inference_base_url for minimax and minimax-cn
  from /v1 to /anthropic
- runtime_provider.py: Auto-correct stale /v1 URLs from existing .env
  files to /anthropic, and always default minimax/minimax-cn providers
  to anthropic_messages mode
- Update tests to reflect new defaults, add tests for stale URL
  auto-correction and explicit api_mode override

Based on PR #2100 by @devorun. Fixes #2094.
@teknium1 teknium1 merged commit 6bcec1a into main Mar 20, 2026
1 check passed
outsourc-e pushed a commit to outsourc-e/hermes-agent that referenced this pull request Mar 26, 2026
…es (NousResearch#2103)

MiniMax's default base URL was /v1 which caused runtime_provider to
default to chat_completions mode (OpenAI-style Authorization: Bearer
header). MiniMax rejects this with a 401 because they require the
Anthropic-style x-api-key header.

Changes:
- auth.py: Change default inference_base_url for minimax and minimax-cn
  from /v1 to /anthropic
- runtime_provider.py: Auto-correct stale /v1 URLs from existing .env
  files to /anthropic, and always default minimax/minimax-cn providers
  to anthropic_messages mode
- Update tests to reflect new defaults, add tests for stale URL
  auto-correction and explicit api_mode override

Based on PR NousResearch#2100 by @devorun. Fixes NousResearch#2094.

Co-authored-by: Test <test@test.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant