Bug Description
When using an OpenAI-compatible proxy that forwards to Anthropic (e.g. claude-code-router, one-api), the agent intermittently fails with:
HTTP 400: "messages: text content blocks must be non-empty"
Steps to Reproduce
- Configure hermes-agent to use an OpenAI-compatible proxy that forwards to Anthropic (e.g.
base_url: http://localhost:3001/v1)
- Start a conversation that triggers tool calls
- After the model returns a tool-call-only response (content is None), the empty string gets stored in history
- On the next API round-trip, the proxy rejects the empty text block → HTTP 400
Expected Behavior
Empty assistant content should be normalized to None instead of "", preventing the proxy from generating empty text blocks.
Actual Behavior
assistant_message.content = None → normalized to "" → stored in history → proxy translates to {"type": "text", "text": ""} → Anthropic rejects with 400.
Affected Component
CLI (interactive chat)
Messaging Platform (if gateway-related)
No response
Debug Report
Operating System
macos
Python Version
3.12.11
Hermes Version
Hermes Agent v0.10.0 (2026.4.16)
Additional Logs / Traceback (optional)
Root Cause Analysis (optional)
No response
Proposed Fix (optional)
No response
Are you willing to submit a PR for this?
Bug Description
When using an OpenAI-compatible proxy that forwards to Anthropic (e.g. claude-code-router, one-api), the agent intermittently fails with:
Steps to Reproduce
base_url: http://localhost:3001/v1)Expected Behavior
Empty assistant content should be normalized to
Noneinstead of"", preventing the proxy from generating empty text blocks.Actual Behavior
assistant_message.content = None→ normalized to""→ stored in history → proxy translates to{"type": "text", "text": ""}→ Anthropic rejects with 400.Affected Component
CLI (interactive chat)
Messaging Platform (if gateway-related)
No response
Debug Report
*Operating System
macos
Python Version
3.12.11
Hermes Version
Hermes Agent v0.10.0 (2026.4.16)
Additional Logs / Traceback (optional)
Root Cause Analysis (optional)
No response
Proposed Fix (optional)
No response
Are you willing to submit a PR for this?