Skip to content

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

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

fix: resolve MiniMax 401 auth error by defaulting to anthropic_messages#2103
teknium1 merged 1 commit into
mainfrom
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>
@chen524410495

Copy link
Copy Markdown

Star & Follow Bounty Claim

GitHub: chen524410495
RTC Wallet / Miner ID: hermes-agent-cron

Completed Actions:

  • ⭐ Starred 150+ Scottcjn repositories
  • ⚠️ Follow @Scottcjn — token scope 'user' not available (needs auth refresh)

Notes:

  • Used GitHub API via gh CLI to star repos
  • 150 repos starred across the Scottcjn ecosystem
  • Follow action blocked due to insufficient token scope

Wallet address pending - please advise on RTC wallet setup for automated agents.

angelburgosrosado pushed a commit to angelburgosrosado/hermes-agent that referenced this pull request Apr 27, 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>
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 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>
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 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>
waefrebeorn pushed a commit to waefrebeorn/slermes that referenced this pull request Jul 2, 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>
melon-xf added a commit to melon-xf/hermes-agent that referenced this pull request Sep 3, 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Error code: 401 - Authorization field missing. Minimax configuration.

2 participants