Empty tool_calls array causing HTTP 400 errors

NousResearch/hermes-agent · cluster 64335 · agent

Data as of

Nothing open on GitHub. Fix merged in #86654. Check it covers your case.

The short answer

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

Multiple fixes targeting a bug where message sanitization produces empty tool_calls arrays that trigger HTTP 400 errors from APIs like DeepSeek and OpenAI. Approaches include dropping the key entirely after deduplication and scoping deduplication logic to the current turn.

Open issues0

No open issues.

Open PRs0

No open pull requests.

Fixes on record

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

  • #86654 fix(agent): close the empty tool_calls 400 class at all three chokepoints (#83312, #77921)

    merged to main

    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

  • #88324 fix(agent): keep tool results when a server reuses one tool_call_id (#70724)

    merged to main

    files: agent/agent_runtime_helpers.py, tests/run_agent/test_message_sequence_repair.py

4 PRs closed without merging

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

  • #64345 fix(sanitize): drop tool_calls key when dedup removes all calls · merged via another change → #86654, #77944, #72591
  • #72619 fix: strip empty tool_calls before API calls to avoid HTTP 400 · other
  • #77377 fix(sanitize): drop tool_calls key when dedup removes all calls (fixes empty-array 400 class) · done elsewhere → #86654
  • #79221 fix(agent): scope tool_call_id dedup to current turn, not whole session · done elsewhere → df68cc1, #88324, #70734, #58327
Closed issues · 1
  • Closed#64335Bug: sanitize_api_messages dedup pass writes tool_calls: [] — HTTP 400 on DeepSeek/OpenAI
How this cluster was grouped
  • Link evidence (structural links throughout): every member is connected by structural evidence: shared changed files, or a closing/superseded reference.
  • Pairwise link density 0.29: 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
agent
Merged PRs
#86654, #88324
Closed issues
1
Attempts
4 PRs closed without merging
Fix link checked
17 Aug 2026

For your agent

The same facts, typed.