You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
add a Z.AI provider-profile message hook that rewrites the exact blocked system/developer prompt phrase Hermes Agent to Hermes framework only in outbound API copies
apply provider message preparation to the max-iterations summary path, which calls chat completions directly
cover main-request sanitization, non-Z.AI preservation, and summary cached-prompt preservation
/Users/tushaokun/.hermes/hermes-agent/venv/bin/python -m pytest tests/run_agent/test_run_agent.py -k "zai_sanitizes_hermes_agent or non_zai_preserves_hermes_agent or zai_summary_sanitizes_cached_system_prompt"
Note: full ./scripts/run_tests.sh tests/run_agent/test_run_agent.py timed out at the runner's per-file timeout without assertion failures; the targeted classes above pass.
Thanks for the careful work on this @tushaokun — the cache-safe outbound-copy design (untouched source messages + _cached_system_prompt, system/developer roles only, deterministic rewrite) was well done and the tests asserting the cache isn't mutated were exactly right.
We're declining the phrase-rewrite approach as a matter of policy, not code quality. If Z.AI's Coding Plan is in fact rejecting the literal string Hermes Agent, masking it in outbound requests would be working around a provider-side restriction we'd rather respect than circumvent. Our stance: treat the 429/1305 as transient capacity overload and back off; if it turns out we're genuinely not permitted to use the Coding Plan with Hermes, the right move is to stop offering it, not to disguise the prompt.
The overload side is being addressed in #52333 (salvaged from #47205, @benbenlijie) — narrow 1305 classifier + adaptive backoff (30→60→90→120s, capped), with long waits surfaced so the TUI doesn't look frozen, and no prompt rewriting.
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
comp/agentCore agent runtime: loop, agent_init, prompt builder, context-compression, responses endpointP2Medium — degraded but workaround existsprovider/zaiZAI providertype/bugSomething isn't working
3 participants
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.
Summary
Hermes AgenttoHermes frameworkonly in outbound API copiesCloses #47685
Tests
Note: full
./scripts/run_tests.sh tests/run_agent/test_run_agent.pytimed out at the runner's per-file timeout without assertion failures; the targeted classes above pass.