fix(minimax): correct context lengths, model catalog, thinking guard, aux model, and config base_url#6046
Closed
kshitijk4poor wants to merge 1 commit into
Closed
Conversation
9f9a197 to
b2dcf8e
Compare
… aux model, and config base_url Context lengths were 204K — actual MiniMax API docs show 1M (M1) and 1,048,576 (M2.5/M2.7). Premature context compression was wasting tokens. Model catalog listed deprecated M2.1 and undocumented highspeed variants. Updated to match official MiniMax API: M1 family (M1, M1-40k, M1-80k, M1-128k, M1-256k), M2.5, M2.7. build_anthropic_kwargs() was sending the 'thinking' parameter to MiniMax's Anthropic-compatible endpoint — MiniMax doesn't support it, causing TypeError crashes (Messages.create() got an unexpected keyword argument). Default auxiliary model was M2.7-highspeed (2x price, same quality). Changed to standard M2.7. API-key providers (MiniMax, ZAI, Kimi, etc.) ignored model.base_url from config.yaml, always using the hardcoded inference_base_url. China MiniMax users setting model.base_url to api.minimaxi.com/anthropic still got routed to api.minimax.io, causing 401. Now honours config.yaml base_url when the configured provider matches, with env var taking priority. Added get_minimax_max_output() for per-model output token limits and comprehensive test coverage (24 new tests). Fixes NousResearch#5777, fixes NousResearch#4082, fixes NousResearch#6039. Closes NousResearch#3895.
b2dcf8e to
87dfaff
Compare
teknium1
pushed a commit
that referenced
this pull request
Apr 8, 2026
… aux model, and config base_url Cherry-picked from PR #6046 by kshitijk4poor with dead code stripped. - Context lengths: 204800 → 1M (M1) / 1048576 (M2.5/M2.7) per official docs - Model catalog: add M1 family, remove deprecated M2.1 and highspeed variants - Thinking guard: skip extended thinking for MiniMax (Anthropic-compat endpoint) - Aux model: MiniMax-M2.7-highspeed → MiniMax-M2.7 (same model, half price) - Config base_url: honour model.base_url for API-key providers (fixes China users) - Stripped unused get_minimax_max_output() / _MINIMAX_MAX_OUTPUT (no consumer) Fixes #5777, #4082, #6039. Closes #3895.
teknium1
pushed a commit
that referenced
this pull request
Apr 8, 2026
… aux model, and config base_url Cherry-picked from PR #6046 by kshitijk4poor with dead code stripped. - Context lengths: 204800 → 1M (M1) / 1048576 (M2.5/M2.7) per official docs - Model catalog: add M1 family, remove deprecated M2.1 and highspeed variants - Thinking guard: skip extended thinking for MiniMax (Anthropic-compat endpoint) - Aux model: MiniMax-M2.7-highspeed → MiniMax-M2.7 (same model, half price) - Config base_url: honour model.base_url for API-key providers (fixes China users) - Stripped unused get_minimax_max_output() / _MINIMAX_MAX_OUTPUT (no consumer) Fixes #5777, #4082, #6039. Closes #3895.
Contributor
|
Merged via PR #6082. Your commit was cherry-picked onto current main with authorship preserved in git log. Stripped the unused |
Tommyeds
pushed a commit
to Tommyeds/hermes-agent
that referenced
this pull request
Apr 12, 2026
… aux model, and config base_url Cherry-picked from PR NousResearch#6046 by kshitijk4poor with dead code stripped. - Context lengths: 204800 → 1M (M1) / 1048576 (M2.5/M2.7) per official docs - Model catalog: add M1 family, remove deprecated M2.1 and highspeed variants - Thinking guard: skip extended thinking for MiniMax (Anthropic-compat endpoint) - Aux model: MiniMax-M2.7-highspeed → MiniMax-M2.7 (same model, half price) - Config base_url: honour model.base_url for API-key providers (fixes China users) - Stripped unused get_minimax_max_output() / _MINIMAX_MAX_OUTPUT (no consumer) Fixes NousResearch#5777, NousResearch#4082, NousResearch#6039. Closes NousResearch#3895.
angelburgosrosado
pushed a commit
to angelburgosrosado/hermes-agent
that referenced
this pull request
Apr 27, 2026
… aux model, and config base_url Cherry-picked from PR NousResearch#6046 by kshitijk4poor with dead code stripped. - Context lengths: 204800 → 1M (M1) / 1048576 (M2.5/M2.7) per official docs - Model catalog: add M1 family, remove deprecated M2.1 and highspeed variants - Thinking guard: skip extended thinking for MiniMax (Anthropic-compat endpoint) - Aux model: MiniMax-M2.7-highspeed → MiniMax-M2.7 (same model, half price) - Config base_url: honour model.base_url for API-key providers (fixes China users) - Stripped unused get_minimax_max_output() / _MINIMAX_MAX_OUTPUT (no consumer) Fixes NousResearch#5777, NousResearch#4082, NousResearch#6039. Closes NousResearch#3895.
angelburgosrosado
pushed a commit
to angelburgosrosado/hermes-agent
that referenced
this pull request
Apr 28, 2026
… aux model, and config base_url Cherry-picked from PR NousResearch#6046 by kshitijk4poor with dead code stripped. - Context lengths: 204800 → 1M (M1) / 1048576 (M2.5/M2.7) per official docs - Model catalog: add M1 family, remove deprecated M2.1 and highspeed variants - Thinking guard: skip extended thinking for MiniMax (Anthropic-compat endpoint) - Aux model: MiniMax-M2.7-highspeed → MiniMax-M2.7 (same model, half price) - Config base_url: honour model.base_url for API-key providers (fixes China users) - Stripped unused get_minimax_max_output() / _MINIMAX_MAX_OUTPUT (no consumer) Fixes NousResearch#5777, NousResearch#4082, NousResearch#6039. Closes NousResearch#3895.
Closed
1 task
02356abc
pushed a commit
to 02356abc/hermes-agent
that referenced
this pull request
May 14, 2026
… aux model, and config base_url Cherry-picked from PR NousResearch#6046 by kshitijk4poor with dead code stripped. - Context lengths: 204800 → 1M (M1) / 1048576 (M2.5/M2.7) per official docs - Model catalog: add M1 family, remove deprecated M2.1 and highspeed variants - Thinking guard: skip extended thinking for MiniMax (Anthropic-compat endpoint) - Aux model: MiniMax-M2.7-highspeed → MiniMax-M2.7 (same model, half price) - Config base_url: honour model.base_url for API-key providers (fixes China users) - Stripped unused get_minimax_max_output() / _MINIMAX_MAX_OUTPUT (no consumer) Fixes NousResearch#5777, NousResearch#4082, NousResearch#6039. Closes NousResearch#3895.
olympus-terminal
pushed a commit
to olympus-terminal/hermes-agent
that referenced
this pull request
May 16, 2026
… aux model, and config base_url Cherry-picked from PR NousResearch#6046 by kshitijk4poor with dead code stripped. - Context lengths: 204800 → 1M (M1) / 1048576 (M2.5/M2.7) per official docs - Model catalog: add M1 family, remove deprecated M2.1 and highspeed variants - Thinking guard: skip extended thinking for MiniMax (Anthropic-compat endpoint) - Aux model: MiniMax-M2.7-highspeed → MiniMax-M2.7 (same model, half price) - Config base_url: honour model.base_url for API-key providers (fixes China users) - Stripped unused get_minimax_max_output() / _MINIMAX_MAX_OUTPUT (no consumer) Fixes NousResearch#5777, NousResearch#4082, NousResearch#6039. Closes NousResearch#3895.
gweeteve
pushed a commit
to gweeteve/hermes-agent
that referenced
this pull request
Jun 2, 2026
… aux model, and config base_url Cherry-picked from PR NousResearch#6046 by kshitijk4poor with dead code stripped. - Context lengths: 204800 → 1M (M1) / 1048576 (M2.5/M2.7) per official docs - Model catalog: add M1 family, remove deprecated M2.1 and highspeed variants - Thinking guard: skip extended thinking for MiniMax (Anthropic-compat endpoint) - Aux model: MiniMax-M2.7-highspeed → MiniMax-M2.7 (same model, half price) - Config base_url: honour model.base_url for API-key providers (fixes China users) - Stripped unused get_minimax_max_output() / _MINIMAX_MAX_OUTPUT (no consumer) Fixes NousResearch#5777, NousResearch#4082, NousResearch#6039. Closes NousResearch#3895.
Egavasyug
pushed a commit
to Egavasyug/hermes-agent
that referenced
this pull request
Jun 10, 2026
… aux model, and config base_url Cherry-picked from PR NousResearch#6046 by kshitijk4poor with dead code stripped. - Context lengths: 204800 → 1M (M1) / 1048576 (M2.5/M2.7) per official docs - Model catalog: add M1 family, remove deprecated M2.1 and highspeed variants - Thinking guard: skip extended thinking for MiniMax (Anthropic-compat endpoint) - Aux model: MiniMax-M2.7-highspeed → MiniMax-M2.7 (same model, half price) - Config base_url: honour model.base_url for API-key providers (fixes China users) - Stripped unused get_minimax_max_output() / _MINIMAX_MAX_OUTPUT (no consumer) Fixes NousResearch#5777, NousResearch#4082, NousResearch#6039. Closes NousResearch#3895.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Hardens the MiniMax provider implementation by fixing 5 bugs identified through comparison with OpenCode's provider patterns and MiniMax's official API documentation.
Changes
1. Context lengths corrected (critical)
MiniMax models were mapped to 204,800 tokens. Official API docs:
This caused premature context compression, wasting user tokens. Added per-model context entries and a
get_minimax_max_output()helper for per-model output token limits.2. Model catalog updated
_PROVIDER_MODELS,_DEFAULT_PROVIDER_MODELS, and test fixtures3. Thinking parameter guard (fixes crash)
build_anthropic_kwargs()was sendingthinkingto MiniMax's Anthropic-compatible endpoint. MiniMax doesn't support it, causingTypeError: Messages.create() got an unexpected keyword argument 'thinking'. Added'minimax' not in model.lower()guard alongside the existing Haiku guard.4. Auxiliary model pricing
Default aux model was
MiniMax-M2.7-highspeed(2x price, same quality). Changed to standardMiniMax-M2.7.5. Config base_url ignored for API-key providers
model.base_urlfrom config.yaml was ignored for API-key providers (MiniMax, ZAI, Kimi, etc.). The code always used the hardcodedinference_base_urlfrom the provider registry. China MiniMax users settingmodel.base_url: https://api.minimaxi.com/anthropicstill got routed toapi.minimax.io, causing 401 errors.Fixed by checking
model.base_urlfrom config when the configured provider matches, in both the credential pool path and the direct resolution path. Env varMINIMAX_BASE_URLtakes priority over config.Research methodology
Compared against OpenCode's provider system (per-model context windows, per-model max output tokens, per-provider error handling) and verified all model specs against MiniMax's official documentation at minimaxi.com (extracted from JS bundles since it's a SPA).
Related Issues
Fixes #5777 (thinking parameter crash)
Fixes #4082 (highspeed aux model pricing)
Fixes #6039 (config base_url ignored)
Closes #3895 (model catalog update — superset of that PR)
Related: #5781 (aux URL routing — fixed in #5983)
Type of Change
How to Test
24 new test assertions covering context lengths, max output lookup, thinking guard, aux model, catalog correctness, and config base_url override.
Checklist
pytest tests/hermes_cli/ tests/agent/ tests/run_agent/— 414 targeted tests passtests/agent/test_minimax_provider.py, runtime resolution tests