diff --git a/tests/agent/test_minimax_provider.py b/tests/agent/test_minimax_provider.py index f9444c471..73e8034dd 100644 --- a/tests/agent/test_minimax_provider.py +++ b/tests/agent/test_minimax_provider.py @@ -46,7 +46,7 @@ class TestMinimaxM3StaleCacheGuard: assert not _model_name_suggests_minimax_m3("MiniMax-M2.7") assert not _model_name_suggests_minimax_m3("MiniMax-M2.5") - def test_stale_m3_cache_dropped_and_reresolves_to_1m(self, tmp_path, monkeypatch): + def test_stale_m3_cache_dropped_and_reresolves(self, tmp_path, monkeypatch): monkeypatch.setenv("HERMES_HOME", str(tmp_path)) import importlib import agent.model_metadata as mm @@ -56,7 +56,13 @@ class TestMinimaxM3StaleCacheGuard: ctx = mm.get_model_context_length( "MiniMax-M3", base_url=base, api_key="", provider="minimax-cn" ) - assert ctx == 1_000_000 + # Invariant: the stale 204,800 catch-all value must be DROPPED and + # re-resolved to M3's real, larger context. The exact value depends on + # the resolution source (hardcoded catalog = 1,000,000; the models.dev + # registry currently reports 512,000) — both are large-context values + # well above the generic "minimax" catch-all. Assert the contract + # ("> 204,800, stale value gone"), not a brittle literal. + assert ctx > 204_800, f"stale M3 cache not dropped/re-resolved, got {ctx}" def test_correct_m3_cache_preserved(self, tmp_path, monkeypatch): monkeypatch.setenv("HERMES_HOME", str(tmp_path))