fix(agent): reword help guidance to avoid Z.AI WAF prompt-block false 429 - #59958
Draft
fadhlillah2 wants to merge 1 commit into
Draft
fix(agent): reword help guidance to avoid Z.AI WAF prompt-block false 429#59958fadhlillah2 wants to merge 1 commit into
fadhlillah2 wants to merge 1 commit into
Conversation
… 429 Z.AI's coding-plan endpoint (api.z.ai) deterministically rejects any request whose system prompt contains the exact literal "You run on Hermes Agent" with a misleading HTTP 429 / code 1305 "temporarily overloaded" body, making glm models unusable with the default prompt. Rewording to "You are running on Hermes Agent" passes the filter while keeping the identity statement intact. Complements the provider-gated sanitizer proposed in NousResearch#53006: this removes the currently-active blocked literal at the source for all providers, with no conditional logic. Related: NousResearch#47685 NousResearch#53002 NousResearch#56816
This was referenced Jul 8, 2026
Contributor
|
Thanks for isolating a narrow source-level trigger. Current main still contains the targeted literal at Problems
Suggested changes
Automated hermes-sweeper review. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Z.AI's coding-plan endpoint (
https://api.z.ai/api/coding/paas/v4, providerzai, modelglm-5.2) deterministically rejects any request whose system prompt contains the exact literalYou run on Hermes Agent, returning a misleadingHTTP 429 / code 1305 "The service may be temporarily overloaded". SinceHERMES_AGENT_HELP_GUIDANCEships that literal in every assembled system prompt, every Hermes turn against Z.AI fails 3/3 retries and surfaces to users as a bogus rate-limit.This PR rewords the guidance to
You are running on Hermes Agent (by Nous Research), which passes the filter while keeping the identity statement (and the rest of the constant) byte-identical.Controlled evidence (2026-07-07, same key / endpoint / model / payload shape, non-streaming
chat/completions; each probe run twice):You run on Hermes Agent (by Nous Research)You are running on Hermes Agent (by Nous Research)Two additional data points worth flagging for maintainers: in the same probe session, bare
Hermes Agentand the literalskill_view(name='hermes-agent')both passed — i.e. the blocked-literal set has drifted since #47685 and #56816 were bisected. The filter is opaque and changes over time, which is why this PR deliberately stays minimal (remove today's active trigger at the source, zero conditional logic, benefits every provider) and is complementary to the provider-gated chokepoint sanitizer proposed in #53006, which remains the right long-term defense.Related Issue
Related: #47685, #53002, #56816. Complements (does not replace) #53006.
Type of Change
Changes Made
agent/prompt_builder.py: rewordHERMES_AGENT_HELP_GUIDANCEopening fromYou run on Hermes Agent (by Nous Research).toYou are running on Hermes Agent (by Nous Research).— one line; the rest of the constant is unchanged.tests/agent/test_prompt_builder.py: addTestGuidanceConstants::test_help_guidance_avoids_zai_waf_blocked_literal— asserts the blocked literal is absent while the identity statement is preserved, so the trigger can't silently return in a future edit.How to Test
main, passes with this PR; needs a GLM Coding Plan key):zai/glm-5.2profile at the coding-plan endpoint and send any message; onmainevery turn fails after 3 retries with the misleading 429.Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests pass — ran the three prompt-related test files (178 passed); full suite not run locallyDocumentation & Housekeeping
docs/, docstrings) — N/A (no docs reference the literal; verified viagit grep)cli-config.yaml.exampleif I added/changed config keys — N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — N/AScreenshots / Logs
Production failure signature on
main(gateway log, before the reword):Same session, after the reword:
API call #1: model=glm-5.2 provider=zai in=107716 out=33 latency=11.6s→ 200.