feat(zai): add GLM-5.2 with verified 1M context window

GLM-5.2 ships with a 1M (1,048,576) token context window. Without this
entry, Hermes falls through to the generic 'glm' key (202,752 tokens),
under-reporting the context bar and prematurely compressing conversations.

The 1M limit was verified empirically via needle-in-a-haystack retrieval
at 789,240 prompt tokens on api.z.ai/api/coding/paas/v4 — zero errors,
zero truncation, correct retrieval at every tested size (25K through 789K).

Changes:
- agent/model_metadata.py: add 'glm-5.2': 1_048_576 before 'glm' fallback
- hermes_cli/models.py: add glm-5.2 to zai curated models
- hermes_cli/setup.py: add glm-5.2 to setup wizard zai list
- hermes_cli/auth.py: add glm-5.2 to coding plan endpoint probes
- plugins/model-providers/zai/__init__.py: add glm-5.2 to fallback_models
- tests/agent/test_model_metadata.py: context resolution + vendor-prefix tests
This commit is contained in:
mr-r0b0t
2026-06-14 13:50:36 -07:00
committed by Teknium
parent 4e6d05c6a5
commit bff78a34dc
6 changed files with 37 additions and 4 deletions
+1
View File
@@ -257,6 +257,7 @@ _PROVIDER_MODELS: dict[str, list[str]] = {
"gemini-3.5-flash",
],
"zai": [
"glm-5.2",
"glm-5.1",
"glm-5",
"glm-5v-turbo",