Skip to content

The agent that grows with you

fix(cli): add step-3.7-flash to StepFun picker by merging live and static catalogs

liuhao102437bd0843c39b
diff --git a/hermes_cli/models.py b/hermes_cli/models.py
index 58c5599a460..2690b95ca3a 100644
--- a/hermes_cli/models.py
+++ b/hermes_cli/models.py
@@ -884,6 +884,14 @@ def curated_models_for_provider(
# Try live API first (Codex, Nous, etc. all support /models)
live = provider_model_ids(normalized)
if live:
+ # For StepFun, the Step Plan API may return a subset of models.
+ # Merge live results with the static catalog so models available
+ # via the Standard API (e.g. step-3.7-flash) still appear in the
+ # picker even when the configured base_url points to Step Plan.
+ if normalized == "stepfun":
+ static = _PROVIDER_MODELS.get(normalized, [])
+ merged = list(dict.fromkeys(live + static))
+ return [(m, "") for m in merged]
return [(m, "") for m in live]
# Fallback to static catalog
diff --git a/hermes_cli/models_catalog_static.py b/hermes_cli/models_catalog_static.py
index 36842d7358c..20eaba28062 100644
--- a/hermes_cli/models_catalog_static.py
+++ b/hermes_cli/models_catalog_static.py
@@ -208,7 +208,7 @@ _PROVIDER_MODELS: dict[str, list[str]] = {
"kimi-k3", "kimi-k2.7-code", "kimi-k2.7-code-highspeed", "kimi-k2.6", "kimi-k2.5",
"kimi-k2-thinking", "kimi-k2-turbo-preview", "kimi-k2-0905-preview",
],
- "stepfun": ["step-3.5-flash", "step-3.5-flash-2603"],
+ "stepfun": ["step-3.7-flash", "step-3.5-flash", "step-3.5-flash-2603"],
"moonshot": [
"kimi-k3", "kimi-k2.6", "kimi-k2.5", "kimi-k2-thinking", "kimi-k2-turbo-preview", "kimi-k2-0905-preview",
],
diff --git a/tests/hermes_cli/test_model_validation.py b/tests/hermes_cli/test_model_validation.py
index 1cb8120232b..53038c102ac 100644
--- a/tests/hermes_cli/test_model_validation.py
+++ b/tests/hermes_cli/test_model_validation.py
@@ -57,6 +57,23 @@ class TestCuratedModelsForProvider:
):
assert curated_models_for_provider("nous") == [("m-static", "")]
+ def test_stepfun_merges_live_and_static(self):
+ """StepFun Step Plan API returns a subset; curated list merges with static."""
+ with patch(
+ "hermes_cli.auth.resolve_api_key_provider_credentials",
+ return_value={"api_key": "***", "base_url": "https://api.stepfun.ai/step_plan/v1"},
+ ), patch(
+ "hermes_cli.models.fetch_api_models",
+ return_value=["step-3.5-flash", "step-3.5-flash-2603"],
+ ):
+ models = curated_models_for_provider("stepfun")
+ model_ids = [m[0] for m in models]
+ # Live models appear first, static-only models appended
+ assert model_ids[0] == "step-3.5-flash"
+ assert "step-3.7-flash" in model_ids
+ # No duplicates
+ assert len(model_ids) == len(set(model_ids))
+
# -- normalize_provider ------------------------------------------------------