From e3c21a386c96551534f782abbdfd60bc82d9d206 Mon Sep 17 00:00:00 2001 From: nesquena-hermes Date: Tue, 22 Sep 2026 23:56:38 +0000 Subject: [PATCH] fix(#7520): drop the '(free)' label from z-ai/glm-4.5-air and make the regression test non-vacuous OpenRouter bills z-ai/glm-4.5-air as a paid model (0.13/0.85 per 1M), so the wizard must not label it free. Since #7514 the projection offers the dead id as z-ai/glm-4.5-flash, not zai/glm-4.5-flash, so the original assertion passed on master; assert the z-ai spelling (fails pre-fix, passes post-fix). --- api/onboarding.py | 2 +- tests/test_onboarding_mvp.py | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/api/onboarding.py b/api/onboarding.py index d2be6d50..44ecabfe 100644 --- a/api/onboarding.py +++ b/api/onboarding.py @@ -71,7 +71,7 @@ _SUPPORTED_PROVIDER_SETUPS = { "default_model": "anthropic/claude-sonnet-4.6", "requires_base_url": False, "models": [ - {"id": "z-ai/glm-4.5-air", "label": "GLM-4.5 Air (free)"} + {"id": "z-ai/glm-4.5-air", "label": "GLM-4.5 Air"} if model["id"] == "zai/glm-4.5-flash" else {"id": _to_openrouter_namespace(model["id"]), "label": model["label"]} for model in _FALLBACK_MODELS diff --git a/tests/test_onboarding_mvp.py b/tests/test_onboarding_mvp.py index f15a9663..983e8f22 100644 --- a/tests/test_onboarding_mvp.py +++ b/tests/test_onboarding_mvp.py @@ -261,14 +261,19 @@ def test_openrouter_wizard_no_dead_zai_ids(): 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" + # Dead id must not appear in the OpenRouter projection. Since #7514 the + # projection maps zai/ -> z-ai/, so the id actually offered (and dead on + # OpenRouter) is z-ai/glm-4.5-flash; check both spellings so this test + # fails on the pre-fix code rather than passing vacuously. + assert "z-ai/glm-4.5-flash" not in or_ids, ( + "OpenRouter wizard still offers dead id z-ai/glm-4.5-flash" ) + assert "zai/glm-4.5-flash" not in or_ids + # The remapped replacement must be present, and must not be labelled + # "free": OpenRouter bills z-ai/glm-4.5-air as a paid model. + air = [m for m in or_setup["models"] if m["id"] == "z-ai/glm-4.5-air"] + assert air, "OpenRouter wizard missing remapped z-ai/glm-4.5-air" + assert "free" not in air[0]["label"].lower() def test_zai_native_still_has_glm_4_5_flash():