# NousResearch/hermes-agent · Empty tool_calls array causes HTTP 400 errors

## Open now

- Nothing open on GitHub.

These items address a bug where sanitization or deduplication logic leaves behind an empty tool_calls array, triggering HTTP 400 errors from the API. Fixes target multiple points in the message sanitization pipeline where the empty key can be reintroduced.

## TL;DR

- 3 member(s): 0 open issue(s), 1 closed issue(s), 0 open PR(s), 1 merged PR(s), 1 PR(s) closed without merging.
- A fix was merged to main in PR #86654. Verify it addresses your case.
- **Recommended:** read PR #86654 (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: `unresolved`. This is distinct from the fix status above. Weigh it yourself.

## How this cluster was grouped

- Link evidence (`STRUCTURAL_SPANNING`): every member is connected by structural evidence: shared changed files, or a closing/superseded reference.
- Pairwise link density `0.67`: 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.

## Closed / duplicate issues

- #74101: sanitize_api_messages dedup re-introduces tool_calls: \[\] after empty-array sanitizer (DeepSeek HTTP 400)

## Prior & competing PRs

- **#86654: fix(agent): close the empty tool_calls 400 class at all three chokepoints (#83312, #77921)**. merged to main · fix tier `verified`
  - maintainer direction: category `merged`
  - files: `agent/agent_runtime_helpers.py`, `agent/transports/chat_completions.py`, `tests/agent/transports/test_chat_completions_empty_tool_calls.py`, `tests/run_agent/test_message_sequence_repair.py`
- **#77377: fix(sanitize): drop tool_calls key when dedup removes all calls (fixes empty-array 400 class)**. closed without merge
  - maintainer direction: category `implemented_elsewhere`; implication `superseded`; refs `#86654`

## Fix status

- Merged to main in PR #86654 (cited above). No release data is tracked. Verify downstream.
- Fix last verified (merged) `2026-08-15`.
- Subsystem: `agent`
