polish(minimax): address Copilot review comments on M3 default-aux fix

Three Copilot inline review comments on #37664, two worth landing
in a polish pass before merge:

1. auxiliary_client.py:270 — Copilot suggested keeping the
   minimax-* entries in _API_KEY_PROVIDER_AUX_MODELS_FALLBACK as
   a safety net for environments where the profile-based
   resolution can't import or run plugin discovery. **Declined.**
   The deepseek precedent (commit 773a0faca) explicitly removed
   deepseek from the same dict for the same reason — the profile
   layer is the source of truth and the dict is a legacy
   pre-profiles-system fallback. We do not want to fragment the
   codebase by provider: either the profile layer is authoritative
   or the dict is. The minimax PR picks profile (matching deepseek)
   and the dict stays cleaned up. The risk Copilot raises is
   real but theoretical — plugin discovery runs at import time of
   the providers module, which is the first thing any modern
   Hermes entrypoint imports.

2. tests/agent/test_minimax_provider.py:162 — Copilot flagged
   that the test class relies on _get_aux_model_for_provider()
   resolving via provider profiles but doesn't explicitly trigger
   plugin discovery. **Fixed.** Added 'import model_tools  # noqa:
   F401' at the top of both test_minimax_aux_is_standard and
   test_minimax_aux_not_highspeed. The fixtures in the parallel
   test_minimax_profile.py already did this; the legacy test in
   test_minimax_provider.py was order-dependent and would silently
   break if anyone reorganised the test ordering. Pinned the
   dependency explicitly so the test is order-independent.

3. tests/plugins/model_providers/test_minimax_profile.py:46 —
   Copilot flagged that the docstring referenced a hard-coded
   line number 'hermes_cli/models.py:298' that would go stale.
   **Fixed.** Replaced with the symbol reference
   'hermes_cli.models._PROVIDER_MODELS[\'minimax\']' which is
   stable under file edits and grep-friendly. The new docstring
   also reads more naturally — readers don't have to look up
   'what's at line 298' to follow the reasoning.

All 221 minimax-related tests still pass.
This commit is contained in:
Fearvox
2026-06-02 15:38:49 -07:00
committed by Teknium
parent b531b5d12a
commit fa8e2f935b
2 changed files with 18 additions and 7 deletions

View File

@ -157,11 +157,21 @@ class TestMinimaxAuxModel:
"""
def test_minimax_aux_is_standard(self):
# Import model_tools to trigger plugin discovery so the
# ProviderProfile objects are registered in the providers
# registry before _get_aux_model_for_provider() is called.
# Without this, profile-based resolution can be order-dependent
# or fail outright in isolation (the minimax-* entries are
# no longer in _API_KEY_PROVIDER_AUX_MODELS_FALLBACK after the
# minimax-M3 default-aux-model cleanup, so the profile is
# the only path to a non-empty aux value).
import model_tools # noqa: F401
from agent.auxiliary_client import _get_aux_model_for_provider
assert _get_aux_model_for_provider("minimax") == "MiniMax-M3"
assert _get_aux_model_for_provider("minimax-cn") == "MiniMax-M3"
def test_minimax_aux_not_highspeed(self):
import model_tools # noqa: F401
from agent.auxiliary_client import _get_aux_model_for_provider
assert "highspeed" not in _get_aux_model_for_provider("minimax")
assert "highspeed" not in _get_aux_model_for_provider("minimax-cn")

View File

@ -42,13 +42,14 @@ def minimax_profile(request):
class TestMinimaxAuxModelM3:
"""MiniMax profile aux model is the new frontier M3, not the stale M2.7.
The catalog top entry is ``MiniMax-M3`` (hermes_cli/models.py:298) and
the user-facing ``model.default`` for a Token-Plan install is M3, so
pinning the aux default to the same model keeps the runtime consistent
(same auth, same billing pool, same rate limits, no surprise 2x-cost
highspeed variant). M3 was released 2026-06-01 — picking it as the
aux default matches the forward-looking catalog order rather than the
pre-M3 era.
The catalog top entry is ``MiniMax-M3`` in
``hermes_cli.models._PROVIDER_MODELS['minimax']`` and the
user-facing ``model.default`` for a Token-Plan install is M3,
so pinning the aux default to the same model keeps the runtime
consistent (same auth, same billing pool, same rate limits, no
surprise 2x-cost highspeed variant). M3 was released 2026-06-01
— picking it as the aux default matches the forward-looking
catalog order rather than the pre-M3 era.
"""
@pytest.mark.parametrize(