Hermes Atlas
Models, providers & proxies

Hermes ZCode GLM Patch

moreoronce/hermes-zcode-glm-patch

Compatibility patch that fixes misleading 429 code 1305 errors when Hermes Agent uses GLM-5.2 on Z.AI

In short

Hermes ZCode GLM Patch is a source patch for Hermes Agent that fixes the misleading 429 / code 1305 overloaded error seen with zai/glm-5.2 on the Z.AI Coding Plan. It handles both the prompt filter and the client fingerprint check behind that error.

What Hermes ZCode GLM Patch does

Hermes ZCode GLM Patch fixes a misleading 429 / code 1305 overloaded error seen when Hermes Agent calls zai/glm-5.2 through the Z.AI Coding Plan. The README explains that this is not ordinary rate limiting. Two independent gates are involved: a system-prompt filter that triggers when the phrase Hermes Agent appears in the outgoing prompt, and a client fingerprint check that rejects requests that do not resemble ZCode Desktop. Changing API keys or shrinking the request fixes neither.

The patch rewrites Hermes Agent to ZCode in memory, only when the provider is zai and the model contains glm-5.2, across the stable, context and volatile prompt cache tiers, so stored skills, memories and docs are untouched. A build_zcode_headers() function emits a ZCode Desktop 3.1.8 identity, injected only for the exact hosts api.z.ai and open.bigmodel.cn on the main and auxiliary clients. The patch also adds agent/transform_output.py, so transform_llm_output hooks can return structured results with text, provider, model and usage that are persisted once.

Key features

  • Provider-gated prompt rewrite for provider zai and model glm-5.2, applied to all three cache tiers
  • ZCode Desktop 3.1.8 header set for api.z.ai and open.bigmodel.cn, with a ZCODE_APP_VERSION override
  • Coverage of the main client, credential rotation and auxiliary clients
  • Strict hostname matching so lookalike domains do not receive the headers
  • Structured transform_llm_output results that are persisted exactly once
  • Token, cost and API-call accounting folded into the session and SQLite

When to use it

  • Running GLM-5.2 through the Z.AI Coding Plan without false overload errors
  • Building a refusal-recovery plugin that replaces the final answer and accounts for its extra LLM call
  • Diagnosing why changing the API key does not clear a 429 code 1305 response

Who it is for: Hermes Agent users who run GLM-5.2 through the Z.AI Coding Plan and hit 429 code 1305 errors.

How it fits with Hermes Agent

A patch to Hermes Agent's own agent/ source files, built specifically for Hermes with the zai provider.

Note: It is a source patch that changes Hermes files and makes requests to api.z.ai and open.bigmodel.cn present a ZCode Desktop identity.

FAQ

What is Hermes ZCode GLM Patch?

It is a compatibility patch for Hermes Agent that makes zai/glm-5.2 work through the Z.AI Coding Plan. It removes the 429 / code 1305 overloaded failures caused by a prompt filter and a client fingerprint check.

Why does Hermes Agent get a 429 code 1305 error with GLM-5.2?

According to the README, Z.AI returns it when the outgoing prompt contains the phrase Hermes Agent, or when the request does not look like ZCode Desktop. Changing API keys or shrinking the request does not help.

Is Hermes ZCode GLM Patch free and open source?

Yes, the repository is released under the MIT license.

Similar models for Hermes Agent

All models

Related guides: How to install Hermes Agent