fix: resolve #7520 — remap dead zai/glm-4.5-flash to z-ai/glm-4.5-air in OpenRouter wizard

This commit is contained in:
Muhammad Usama authored and nesquena-hermes committed 2026-09-22 23:55:21 +00:00
1 parent 65b6e4d390
commit d5349a169d
2 files changed
+37 -1

No files matched your search

+34
View File
@@ -249,3 +249,37 @@ def test_onboarding_setup_rejects_api_key_with_newline():
)
assert status == 400
assert "newline" in data["error"].lower()
# ── Regression: #7520 ────────────────────────────────────────────────────────
def test_openrouter_wizard_no_dead_zai_ids():
"""OpenRouter wizard must not offer zai/glm-4.5-flash — OpenRouter does not
serve it. The free-tier equivalent is z-ai/glm-4.5-air. (#7520)"""
from api.onboarding import _SUPPORTED_PROVIDER_SETUPS
or_setup = _SUPPORTED_PROVIDER_SETUPS["openrouter"]
or_ids = {m["id"] for m in or_setup["models"]}
# Dead id must not appear in the OpenRouter projection
assert "zai/glm-4.5-flash" not in or_ids, (
"OpenRouter wizard still offers dead id zai/glm-4.5-flash"
)
# The remapped replacement must be present
assert "z-ai/glm-4.5-air" in or_ids, (
"OpenRouter wizard missing remapped z-ai/glm-4.5-air"
)
def test_zai_native_still_has_glm_4_5_flash():
"""The native Z.AI onboarding setup must still offer glm-4.5-flash —
the remapping is OpenRouter-only."""
from api.onboarding import _SUPPORTED_PROVIDER_SETUPS
zai_setup = _SUPPORTED_PROVIDER_SETUPS["zai"]
zai_ids = {m["id"] for m in zai_setup["models"]}
assert "glm-4.5-flash" in zai_ids, (
"Native Z.AI setup lost glm-4.5-flash — the remapping must be "
"OpenRouter-only, not touching _FALLBACK_MODELS"
)