Merge pull request #1369 from NousResearch/hermes/hermes-aed06679
fix: exclude Coding Plan-only models from Moonshot model selection
This commit is contained in:
commit
f549981293
2 changed files with 35 additions and 2 deletions
|
|
@ -1373,6 +1373,12 @@ _PROVIDER_MODELS = {
|
||||||
"kimi-k2-turbo-preview",
|
"kimi-k2-turbo-preview",
|
||||||
"kimi-k2-0905-preview",
|
"kimi-k2-0905-preview",
|
||||||
],
|
],
|
||||||
|
"moonshot": [
|
||||||
|
"kimi-k2.5",
|
||||||
|
"kimi-k2-thinking",
|
||||||
|
"kimi-k2-turbo-preview",
|
||||||
|
"kimi-k2-0905-preview",
|
||||||
|
],
|
||||||
"minimax": [
|
"minimax": [
|
||||||
"MiniMax-M2.5",
|
"MiniMax-M2.5",
|
||||||
"MiniMax-M2.5-highspeed",
|
"MiniMax-M2.5-highspeed",
|
||||||
|
|
@ -1454,8 +1460,8 @@ def _model_flow_kimi(config, current_model=""):
|
||||||
"kimi-k2-thinking-turbo",
|
"kimi-k2-thinking-turbo",
|
||||||
]
|
]
|
||||||
else:
|
else:
|
||||||
# Legacy Moonshot models
|
# Legacy Moonshot models (excludes Coding Plan-only models)
|
||||||
model_list = _PROVIDER_MODELS.get(provider_id, [])
|
model_list = _PROVIDER_MODELS.get("moonshot", [])
|
||||||
|
|
||||||
if model_list:
|
if model_list:
|
||||||
selected = _prompt_model_selection(model_list, current_model=current_model)
|
selected = _prompt_model_selection(model_list, current_model=current_model)
|
||||||
|
|
|
||||||
|
|
@ -426,3 +426,30 @@ class TestKimiCodeCredentialAutoDetect:
|
||||||
monkeypatch.setenv("GLM_API_KEY", "sk-kimi-looks-like-kimi-but-isnt")
|
monkeypatch.setenv("GLM_API_KEY", "sk-kimi-looks-like-kimi-but-isnt")
|
||||||
creds = resolve_api_key_provider_credentials("zai")
|
creds = resolve_api_key_provider_credentials("zai")
|
||||||
assert creds["base_url"] == "https://api.z.ai/api/paas/v4"
|
assert creds["base_url"] == "https://api.z.ai/api/paas/v4"
|
||||||
|
|
||||||
|
|
||||||
|
# =============================================================================
|
||||||
|
# Kimi / Moonshot model list isolation tests
|
||||||
|
# =============================================================================
|
||||||
|
|
||||||
|
class TestKimiMoonshotModelListIsolation:
|
||||||
|
"""Moonshot (legacy) users must not see Coding Plan-only models."""
|
||||||
|
|
||||||
|
def test_moonshot_list_excludes_coding_plan_only_models(self):
|
||||||
|
from hermes_cli.main import _PROVIDER_MODELS
|
||||||
|
moonshot_models = _PROVIDER_MODELS["moonshot"]
|
||||||
|
coding_plan_only = {"kimi-for-coding", "kimi-k2-thinking-turbo"}
|
||||||
|
leaked = set(moonshot_models) & coding_plan_only
|
||||||
|
assert not leaked, f"Moonshot list contains Coding Plan-only models: {leaked}"
|
||||||
|
|
||||||
|
def test_moonshot_list_contains_shared_models(self):
|
||||||
|
from hermes_cli.main import _PROVIDER_MODELS
|
||||||
|
moonshot_models = _PROVIDER_MODELS["moonshot"]
|
||||||
|
assert "kimi-k2.5" in moonshot_models
|
||||||
|
assert "kimi-k2-thinking" in moonshot_models
|
||||||
|
|
||||||
|
def test_coding_plan_list_contains_plan_specific_models(self):
|
||||||
|
from hermes_cli.main import _PROVIDER_MODELS
|
||||||
|
coding_models = _PROVIDER_MODELS["kimi-coding"]
|
||||||
|
assert "kimi-for-coding" in coding_models
|
||||||
|
assert "kimi-k2-thinking-turbo" in coding_models
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue