hermes - ✅(Solved) Fix MiniMax (China) model validation fails: API returns 404 for /models endpoint [2 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#12611Fetched 2026-04-20 12:17:57
View on GitHub
Comments
0
Participants
1
Timeline
7
Reactions
0
Author
Participants
Timeline (top)
referenced ×4cross-referenced ×2closed ×1

Error Message

When attempting to switch to a MiniMax (China) model using the /model command, the validation fails with the error: 3. Observe the validation error

Root Cause

MiniMax (China) uses an Anthropic-compatible API endpoint (), but the Anthropic API does not have a endpoint.

The function in attempts to probe the endpoint to verify the model exists:

https://github.com/NousResearch/hermes-agent/blob/main/hermes_cli/models.py#L2110-L2111

This results in a 404 Not Found response, causing the validation to fail even though the model is valid and listed in .

Fix Action

Fixed

PR fix notes

PR #12829: fix(models): validate MiniMax models against static catalog

Description (problem / solution / changelog)

What changed

Added a catalog-based validation path for MiniMax models in _resolve_model_selection(), mirroring the existing openai-codex pattern. MiniMax does not expose a /models API endpoint, so the previous code would fall through to a generic "Could not reach API" rejection even for valid model names.

Before: Any MiniMax model would be rejected with "Could not reach API" because the API probe to /v1/models always fails for MiniMax.

After: MiniMax models are validated against a static catalog (case-insensitive matching), with:

  • Exact match detection for known models
  • Auto-correct for close matches (edit distance via difflib.get_close_matches)
  • Suggestion display for near-matches
  • Graceful acceptance with warning for unrecognized models (since the catalog may be incomplete)

Note: Unlike openai-codex which rejects unknown models (accepted: False), MiniMax accepts unknown models with a warning (accepted: True) because the catalog may not cover all available models and the user's model may still work server-side.

How to test

  1. Configure MiniMax as a provider with a valid API key
  2. Set model to MiniMax-M2.7 — should be accepted without warning
  3. Set model to minimax-m2.7 — should be accepted (case-insensitive)
  4. Set model to MiniMax-Text-01 — should auto-correct with suggestion
  5. Set model to MiniMax-Unknown — should be accepted with warning
  6. Run the test suite:
    pytest tests/test_minimax_model_validation.py -v

Platforms tested

  • Linux (Docker container, Python 3.11)

Closes #12611 Closes #12460 Closes #12399 Closes #12547

Changed files

  • hermes_cli/models.py (modified, +45/-0)
  • tests/test_minimax_model_validation.py (added, +130/-0)

PR #12842: fix(models): validate MiniMax models against static catalog

Description (problem / solution / changelog)

Salvage of #12829 by @Tranquil-Flow onto current main.

Summary

hermes model MiniMax-M2.7 now succeeds. Previously, validation hard-rejected every MiniMax model because MiniMax's /v1/models endpoint returns 404 and commit aeb53131f flipped probe failure from warn-and-accept to hard-reject.

Changes

  • hermes_cli/models.py: new minimax / minimax-cn branch in validate_requested_model(), placed before the live probe — mirrors the existing openai-codex pattern. Case-insensitive exact match, case-insensitive auto-correct at 0.9 cutoff, similar-model suggestions at 0.5, unknown names accepted with a warning (catalog may be incomplete).
  • tests/test_minimax_model_validation.py: 7 tests covering exact match, case-insensitivity, near-match suggestion, unknown-model acceptance with warning, and catalog-path-is-taken guard.

Validation

  • Targeted pytest: 70/70 passed across tests/test_minimax_model_validation.py + tests/hermes_cli/test_model_validation.py.
  • E2E with fetch_api_models stubbed to return None: exact/lowercase/uppercase all accepted+recognized, MinMax-M2.7 auto-corrects to MiniMax-M2.7, unknown models accepted with the "MiniMax does not expose a /models endpoint" warning, minimax-cn behaves the same.

Closes #12611 Closes #12460 Closes #12399 Closes #12547

Supersedes #12564 (duplicate, same root cause, less coverage).

Changed files

  • hermes_cli/models.py (modified, +45/-0)
  • tests/test_minimax_model_validation.py (added, +130/-0)
RAW_BUFFERClick to expand / collapse

Bug Description

When attempting to switch to a MiniMax (China) model using the /model command, the validation fails with the error:

Root Cause

MiniMax (China) uses an Anthropic-compatible API endpoint (), but the Anthropic API does not have a endpoint.

The function in attempts to probe the endpoint to verify the model exists:

https://github.com/NousResearch/hermes-agent/blob/main/hermes_cli/models.py#L2110-L2111

This results in a 404 Not Found response, causing the validation to fail even though the model is valid and listed in .

Expected Behavior

MiniMax (China) models should be validated using the static model catalog () instead of attempting to probe a non-existent endpoint, similar to how OpenAI Codex is handled:

https://github.com/NousResearch/hermes-agent/blob/main/hermes_cli/models.py#L2072-L2108

Steps to Reproduce

  1. Configure MiniMax (China) API key:
  2. Try to switch model:
  3. Observe the validation error

Environment

  • Hermes Agent version: latest main
  • Provider: minimax-cn
  • Model: MiniMax-M2.7-highspeed (also affects MiniMax-M2.7, MiniMax-M2.5, etc.)

Suggested Fix

Add special handling for and providers in to skip the live API probe and use the static catalog instead, similar to the OpenAI Codex handling.

Related Code

extent analysis

TL;DR

Modify the validation logic in hermes_cli/models.py to add special handling for MiniMax (China) models, skipping the live API probe and using the static model catalog instead.

Guidance

  • Identify the validate_model function in hermes_cli/models.py and add a condition to check if the provider is minimax-cn before attempting to probe the API endpoint.
  • Use the static model catalog to verify the existence of MiniMax (China) models, similar to the OpenAI Codex handling.
  • Review the OpenAI Codex special handling implementation in hermes_cli/models.py as a reference for the necessary changes.
  • Test the updated validation logic with the MiniMax (China) model to ensure it passes validation without attempting to probe the non-existent API endpoint.

Example

# Example of special handling for MiniMax (China) models
if provider == 'minimax-cn':
    # Use static model catalog to verify model existence
    # ...
else:
    # Default validation logic
    # ...

Notes

The suggested fix requires modifying the hermes_cli/models.py file, which may have implications for future updates or compatibility with other models. It is essential to thoroughly test the changes to ensure they do not introduce new issues.

Recommendation

Apply the workaround by modifying the hermes_cli/models.py file to add special handling for MiniMax (China) models, as it is a targeted solution to the specific issue described.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - ✅(Solved) Fix MiniMax (China) model validation fails: API returns 404 for /models endpoint [2 pull requests, 1 participants]