Skip to content

fix: align MiniMax provider with official API docs#7126

Merged
teknium1 merged 1 commit into
mainfrom
hermes/hermes-6584b1e4
Apr 11, 2026
Merged

fix: align MiniMax provider with official API docs#7126
teknium1 merged 1 commit into
mainfrom
hermes/hermes-6584b1e4

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

Salvage of PR #7096 by @kshitijk4poor. Cherry-picked onto current main with contributor authorship preserved.

Aligns MiniMax provider with official API documentation (source). Fixes 6 bugs:

  1. Transport mismatchproviders.py had openai_chat for minimax, should be anthropic_messages
  2. Credential leak in switch_model() — fell back to resolve_anthropic_token() for all anthropic_messages providers, sending Anthropic creds to MiniMax
  3. Prompt caching sent to MiniMaxis_native_anthropic was set from api_mode alone, now requires provider == "anthropic"
  4. Dot-to-hyphen corruptionMiniMax-M2.7MiniMax-M2-7 (model-not-found). Added minimax to preserve-dots set
  5. Trajectory compressor 404 — raw /anthropic URL → OpenAI SDK appended /chat/completions (404). Now uses _to_openai_base_url()
  6. Doctor health check — MiniMax entries had None URL. Now uses /v1/models

Also corrects:

  • Context window: 204,800 (was 1M/1.048M)
  • Model catalog: M2.7/M2.5/M2.1/M2 only (M1 not on /anthropic endpoint)
  • Thinking: fully supported in manual mode (was blocked)
  • Max output: 131,072 tokens

Salvage notes

  • Dropped test_setup_model_selection.py change (file was deleted from main in dead code cleanup)
  • 39 tests added/updated across 9 test classes
  • 2562 passed, 6 pre-existing flaky failures (pass in isolation)

Closes #7096

Aligns MiniMax provider with official API documentation. Fixes 6 bugs:
transport mismatch (openai_chat -> anthropic_messages), credential leak
in switch_model(), prompt caching sent to non-Anthropic endpoints,
dot-to-hyphen model name corruption, trajectory compressor URL routing,
and stale doctor health check.

Also corrects context window (204,800), thinking support (manual mode),
max output (131,072), and model catalog (M2 family only on /anthropic).

Source: https://platform.minimax.io/docs/api-reference/text-anthropic-api

Co-authored-by: kshitijk4poor <kshitijk4poor@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Supply Chain Risk Detected

This PR contains patterns commonly associated with supply chain attacks. This does not mean the PR is malicious — but these patterns require careful human review before merging.

⚠️ WARNING: Install hook files modified

These files can execute code during package installation or interpreter startup.

Files:

hermes_cli/setup.py

Automated scan triggered by supply-chain-audit. If this is a false positive, a maintainer can approve after manual review.

@teknium1 teknium1 merged commit d442f25 into main Apr 11, 2026
5 of 6 checks passed
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.

2 participants