chore(models): sync opencode-go static fallback to core's curated list
The WebUI fallback list mirrors Hermes core's curated opencode-go list (hermes_cli/models.py, synced 2026-08-20/21 against the live /zen/go/v1/models endpoint and the public Go docs). Core owns the sync duty; WebUI only mirrors. Adds the nine ids core gained since the 2026-07-07 snapshot (kimi-k3, gpt-5.6-luna, glm-5.3, grok-4.5, qwen3.8-max, hy3, hy3-preview, muse-spark-1.2-contributor, ox-alpha-free) and reorders to core's order so future diffs are mechanical. Snapshot test updated accordingly.
This commit is contained in:
1 parent
4e27041770
commit
df345af9eb
2 files changed
+112
-21
No files matched your search
@@ -165,3 +165,80 @@ def test_opencode_go_config_allowlist_still_wins(monkeypatch, tmp_path):
|
||||
|
||||
assert calls == [] # probe never consulted
|
||||
assert _ids(group) == ["glm-5"]
|
||||
|
||||
|
||||
# ── Static fallback list contract ─────────────────────────────────────
|
||||
# The remaining tests pin the offline fallback list itself. It is an exact
|
||||
# mirror of Hermes core's curated ``opencode-go`` list
|
||||
# (hermes_cli/models.py) — core owns the sync duty against the live
|
||||
# https://opencode.ai/zen/go/v1/models endpoint and
|
||||
# https://opencode.ai/docs/go/, and WebUI only mirrors. This catches drift
|
||||
# in either direction: ids core added (kimi-k3, gpt-5.6-luna, glm-5.3,
|
||||
# grok-4.5, qwen3.8-max, hy3, hy3-preview, muse-spark-1.2-contributor,
|
||||
# ox-alpha-free) and ids core dropped.
|
||||
|
||||
import ast
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parent.parent
|
||||
CONFIG_PATH = ROOT / "api" / "config.py"
|
||||
CONFIG = CONFIG_PATH.read_text(encoding="utf-8")
|
||||
|
||||
EXPECTED_OPENCODE_GO_MODEL_IDS = [
|
||||
"kimi-k3",
|
||||
"kimi-k2.7-code",
|
||||
"kimi-k2.6",
|
||||
"kimi-k2.5",
|
||||
"gpt-5.6-luna",
|
||||
"grok-4.5",
|
||||
"glm-5.3",
|
||||
"glm-5.2",
|
||||
"glm-5.1",
|
||||
"glm-5",
|
||||
"mimo-v2.5-pro",
|
||||
"mimo-v2.5",
|
||||
"mimo-v2-pro",
|
||||
"mimo-v2-omni",
|
||||
"minimax-m3",
|
||||
"minimax-m2.7",
|
||||
"minimax-m2.5",
|
||||
"deepseek-v4-pro",
|
||||
"deepseek-v4-flash",
|
||||
"qwen3.8-max",
|
||||
"qwen3.7-max",
|
||||
"qwen3.7-plus",
|
||||
"qwen3.6-plus",
|
||||
"qwen3.5-plus",
|
||||
"hy3",
|
||||
"hy3-preview",
|
||||
"muse-spark-1.2-contributor",
|
||||
"ox-alpha-free",
|
||||
]
|
||||
|
||||
|
||||
def _opencode_go_static_models():
|
||||
tree = ast.parse(CONFIG, filename=str(CONFIG_PATH))
|
||||
for node in tree.body:
|
||||
if not isinstance(node, ast.Assign):
|
||||
continue
|
||||
if not any(isinstance(target, ast.Name) and target.id == "_PROVIDER_MODELS" for target in node.targets):
|
||||
continue
|
||||
provider_models = ast.literal_eval(node.value)
|
||||
return provider_models["opencode-go"]
|
||||
raise AssertionError("_PROVIDER_MODELS assignment not found")
|
||||
|
||||
|
||||
def test_opencode_go_static_models_match_core_curated_list():
|
||||
models = _opencode_go_static_models()
|
||||
assert [model["id"] for model in models] == EXPECTED_OPENCODE_GO_MODEL_IDS
|
||||
|
||||
|
||||
def test_opencode_go_recent_additions_have_human_labels():
|
||||
labels = {model["id"]: model["label"] for model in _opencode_go_static_models()}
|
||||
assert labels["gpt-5.6-luna"] == "GPT 5.6 Luna"
|
||||
assert labels["kimi-k3"] == "Kimi K3"
|
||||
assert labels["glm-5.3"] == "GLM-5.3"
|
||||
assert labels["grok-4.5"] == "Grok 4.5"
|
||||
assert labels["qwen3.8-max"] == "Qwen3.8 Max"
|
||||
assert labels["muse-spark-1.2-contributor"] == "Muse Spark 1.2 Contributor"
|
||||
assert labels["ox-alpha-free"] == "Ox Alpha (Go)"
|
||||
Reference in new issue
Block a user