NousResearch/hermes-agent

Empty message content blocks causing API 400 errors

Cluster 3143 · acp adapter. Data as of

3 open items. Fix merged in #3322. Check it covers your case.

The short answer

1open issue
2open PRs
11items grouped
Known?
Yes. 11 related items grouped here, 3 issues already closed.
Fix event
A fix was merged to main in PR #3322. Check it covers your case. No release data is tracked.
Tracker
The maintainers' tracker marks this partially resolved, deciding PR #3322. That is separate from the fix event.
Still open
1 issue and 2 PRs.

Multiple bug reports and fix attempts addressing empty or whitespace-only text content blocks being sent to Anthropic and compatible APIs, resulting in HTTP 400 validation errors. Fixes span message sanitization, filtering, and validation across chat, Bedrock, and custom provider code paths.

Open issues1

  • Issue#19309[Bug]: HTTP 400 on B.AI API

Open PRs2

  • PR#19496fix(chat): sanitize empty text content blocks
  • PR#24743fix(bedrock): sanitize empty text blocks for custom providers and dir…

Fixes on record

Merged to main. A stamp counts the issues a fix is linked to.

  • #3322 fix: validate empty user messages to prevent Anthropic API 400 errors

    merged to main

    files: agent/anthropic_adapter.py, gateway/platforms/discord.py, tests/test_anthropic_adapter.py

4 PRs closed without merging

From the close comments: done elsewhere 2 · merged via another change 1 · other 1

  • #3148 fix: prevent empty user messages from reaching Anthropic API · done elsewhere → 3f95e74, 1756dec, #3322, #3143, #1955
  • #3149 fix: validate empty user messages to prevent Anthropic API 400 errors · merged via another change → #3322
  • #9155 Fix custom provider API mode detection for OpenAI-compatible endpoints · done elsewhere → #9064
  • #9491 fix(anthropic): filter empty text blocks from assistant messages · other → #11929
Closed issues · 3
  • Closed#3143[Bug]: Discord gateway passes empty user messages to Anthropic API — "user messages must have non-empty content" (400)
  • Closed#9064[Bug]: 'GptVParam.Messages' Error:Field validation for 'Messages' failed on the 'required' tag
  • Closed#9486[Bug]: Bedrock API 400 Error: "text content blocks must be non-empty" when using custom provider
How this cluster was grouped
  • Link evidence (partly structural links): some members are connected by structural evidence (shared changed files, or a closing/superseded reference); the rest are joined by an automated relevance judgement over their text.
  • Members outside that structural core may belong to a different underlying problem.
  • Pairwise link density 0.15: the share of item pairs that carry a link, counting a structural link in full and a relevance-only link at 0.36. 1.00 means every pair is linked.

Pick up a Lab task

Check whether a fix covers the open issues here, with your own agent. Bring back evidence for maintainers.

Open the Lab

At a glance

Subsystem
acp adapter
Merged PRs
#3322
Closed issues
3
Attempts
4 PRs closed without merging
Fix link checked
27 Mar 2026. This confirmation is old and may be out of date (a revert or reopen would not have invalidated it here); re-verify.

For your agent

The same facts, typed.