# NousResearch/hermes-agent · Empty message content blocks causing API 400 errors

## Open now

- 1 issue, 2 PRs open on GitHub.
- #19309: \[Bug\]: HTTP 400 on B.AI API
- PR #19496: fix(chat): sanitize empty text content blocks
- PR #24743: fix(bedrock): sanitize empty text blocks for custom providers and dir…

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.

## TL;DR

- 11 member(s): 1 open issue(s), 3 closed issue(s), 2 open PR(s), 1 merged PR(s), 4 PR(s) closed without merging.
- A fix was merged to main in PR #3322. Verify it addresses your case.
- **Recommended:** read PR #3322 (and any competing PRs below) before filing. Confirm the merged change covers your symptom.

## Maintainer resolution verdict

- Internal-tracker verdict over this cluster's issue members: `partially_resolved` · deciding PR(s): `pr-3322`. This is distinct from the fix status above. Weigh it yourself.

## How this cluster was grouped

- Link evidence (`STRUCTURAL_PARTIAL`): 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 member 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.

## Open related issues

- #19309: \[Bug\]: HTTP 400 on B.AI API

## Closed / duplicate issues

- #3143: \[Bug\]: Discord gateway passes empty user messages to Anthropic API — "user messages must have non-empty content" (400)
- #9064: \[Bug\]: 'GptVParam.Messages' Error:Field validation for 'Messages' failed on the 'required' tag
- #9486: \[Bug\]:  Bedrock API 400 Error: "text content blocks must be non-empty" when using custom provider

## Prior & competing PRs

- **#3322: fix: validate empty user messages to prevent Anthropic API 400 errors**. merged to main · fix tier `verified`
  - maintainer direction: category `merged`; implication `superseded`
  - files: `agent/anthropic_adapter.py`, `gateway/platforms/discord.py`, `tests/test_anthropic_adapter.py`
- **#3148: fix: prevent empty user messages from reaching Anthropic API**. closed without merge
  - maintainer direction: category `implemented_elsewhere`; implication `superseded`; refs `3f95e741a`, `3f95e741a77de69904ea4b600cac8c2acbc8ab8d`, `1756dec317aa`, `#3322`, `#3143`, `#1955`
- **#3149: fix: validate empty user messages to prevent Anthropic API 400 errors**. closed without merge
  - maintainer direction: category `merged_via`; implication `superseded`; refs `#3322`
- **#9155: Fix custom provider API mode detection for OpenAI-compatible endpoints**. closed without merge
  - maintainer direction: category `implemented_elsewhere`; implication `superseded`; refs `#9064`
- **#9491: fix(anthropic): filter empty text blocks from assistant messages**. closed without merge
  - maintainer direction: category `uncategorized`; implication `needs_llm`; refs `#11929`, `#11929`
- **#19496: fix(chat): sanitize empty text content blocks**. open
  - maintainer direction: category `uncategorized`; implication `needs_llm`; refs `724ab9098`
  - files: `agent/transports/chat_completions.py`, `tests/agent/transports/test_chat_completions.py`
- **#24743: fix(bedrock): sanitize empty text blocks for custom providers and dir…**. open
  - maintainer direction: category `uncategorized`; implication `needs_llm`
  - files: `agent/bedrock_adapter.py`, `agent/chat_completion_helpers.py`

## Fix status

- Merged to main in PR #3322 (cited above). No release data is tracked. Verify downstream.
- Fix last verified (merged) `2026-03-27`. This confirmation is old and may be out of date (a revert/reopen would not have invalidated it here); re-verify.
- Subsystem: `acp_adapter`
