Hermes plugin that strips empty text blocks from outgoing LLM requests.
Anthropic rejects empty text blocks with 400: messages: text content blocks must be non-empty, and strict OpenAI-compatible shims reject empty assistant
content on tool-call turns
(hermes-agent#31583).
Hermes emits both when it replays a reasoning-only or tool-call-only
assistant turn. OpenAI's own endpoints tolerate the payload, so the bug only
surfaces on strict upstreams like Anthropic-backed gateways.
The plugin registers an llm_request middleware that rewrites the provider
request just before the HTTP call:
- Responses API (
inputarray): drops empty text blocks and message items left with no content. - Chat completions (
messagesarray): coerces empty assistant content toNoneon tool-call turns, the #31583 fix, for Hermes builds that predate725c7ba534.
Persisted history is never touched; only the wire payload changes. Middleware is fail-open: if the plugin raises, Hermes logs it and sends the original request.
hermes plugins install guygrigsby/hermes-empty-text-guard
hermes plugins enable empty-text-guardUpdate with hermes plugins update empty-text-guard.
hermes plugins disable empty-text-guard
hermes plugins remove empty-text-guardpython3 -m pytest tests/Upgrade Hermes past 725c7ba534; the fix there covers the chat-completions
transport. If the Responses API gap gets patched upstream too, this plugin
has nothing left to do.