Python
Add GLM 5.3 via OpenRouter to the model matrix, sized for the Z.AI host (OPE-215)
Devika Verma8f5d4045824f
diff --git a/coworker/providers/matrix.py b/coworker/providers/matrix.pyindex de2e1086..ec2917ea 100644--- a/coworker/providers/matrix.py+++ b/coworker/providers/matrix.py@@ -278,6 +278,14 @@ MATRIX: dict[str, ModelEntry] = {"openrouter:nvidia/nemotron-3.5-lightning": ModelEntry("Nemotron 3.5 Lightning · via OpenRouter", _AGENTIC, 262_144),+ # GLM 5.3 via OpenRouter (openrouter.ai/api/v1/models/z-ai/glm-5.3/endpoints, read+ # 2026-10-01: 39 endpoints, all tool-capable). Sized for Z.AI, the host a pinned run+ # uses (1,048,576 ctx, fp8, 131,072 max output). Without this row the model would fall+ # back to DEFAULT_CONTEXT_WINDOW (128,000) and compact at 102,400, far inside what the+ # endpoint actually serves (OPE-215).+ "openrouter:z-ai/glm-5.3": ModelEntry(+ "GLM 5.3 · via OpenRouter", _AGENTIC, 1_048_576+ ),# Stealth/cloaked alpha (catalog-checked 2026-08-24: 1,048,576 ctx, tool calling).# These are temporary lab previews — expect the slug to vanish when the lab ships# the real model; keep it until OpenRouter retires it.diff --git a/tests/test_matrix_current_models.py b/tests/test_matrix_current_models.pyindex 30f7c375..ea2516da 100644--- a/tests/test_matrix_current_models.py+++ b/tests/test_matrix_current_models.py@@ -54,6 +54,8 @@ REPO = Path(__file__).resolve().parents[1]# context_length (202,800), not the model-level 262,144 the catalog shows.("openrouter:nvidia/nemotron-3-ultra-550b-a55b", 202_800),("openrouter:nvidia/nemotron-3.5-lightning", 262_144),+ # openrouter.ai endpoints API, read 2026-10-01 (OPE-215): the Z.AI host's window.+ ("openrouter:z-ai/glm-5.3", 1_048_576),],)def test_current_models_have_verified_windows(model, window):diff --git a/tests/test_providers.py b/tests/test_providers.pyindex 604a49a4..cd0daad7 100644--- a/tests/test_providers.py+++ b/tests/test_providers.py@@ -517,7 +517,10 @@ def test_matrix_labels_and_custom_model_fallback():# pruning owed above is NOT done here — deciding which entries are retired is an owner# call, and dropping a row silently downgrades that model to the conservative fallback# capabilities. Prune before raising this a third time.- assert len(MATRIX) < 70+ # 70→75 (2026-10-01, OPE-215): three OpenRouter rows (Nemotron 3 Ultra, Nemotron 3.5+ # Lightning, GLM 5.3). The pruning owed above is still not done; it remains the owner's+ # call and should come before this is raised again.+ assert len(MATRIX) < 75assert all(e.caps.tools for e in MATRIX.values())# A custom (unlisted) reseller model falls back to the conservative default — usable,# but at the user's own risk (no parallel tool calls assumed).