# NousResearch/hermes-agent · Remove empty tool_calls key after deduplication

## Open now

- Nothing open on GitHub.

A bug where sanitize_api_messages leaves an empty tool_calls array after deduplication, breaking tool-calling sessions for certain models like Qwen. Fixes involve dropping the tool_calls key entirely when all entries are deduplicated.

## TL;DR

- 5 member(s): 0 open issue(s), 1 closed issue(s), 0 open PR(s), 1 merged PR(s), 3 PR(s) closed without merging.
- A fix was merged to main in PR #90330. Verify it addresses your case.
- **Recommended:** read PR #90330 (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.40`: 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

- #70126: \[Bug\]: sanitize_api_messages dedup writes tool_calls: \[\], breaking Qwen-series tool-calling sessions on v0.18.2+

## Prior & competing PRs

- **#90330: fix: reasoning effort 'ultra' no longer 400s on non-Anthropic wires (#89503 class, salvage #89509)**. merged to main · fix tier `verified`
  - maintainer direction: category `merged`; implication `superseded`
  - files: `agent/auxiliary_client.py`, `agent/transports/chat_completions.py`, `agent/transports/codex.py`, `plugins/model-providers/copilot/__init__.py`, `plugins/model-providers/custom/__init__.py`, `tests/agent/test_reasoning_effort_wire_translation.py`, `tests/agent/transports/test_reasoning_effort_sibling_sites.py`
- **#70176: fix(agent): drop tool_calls key when all tool_calls are deduplicated (#70126)**. closed without merge
  - maintainer direction: category `duplicate_of`; implication `duplicate`; refs `#64345`
- **#70181: fix(agent): drop tool_calls key when all tool_calls are deduplicated (#70126)**. closed without merge
  - maintainer direction: category `silent_close`; implication `active`
- **#70182: fix(transports+agent): GLM reasoning_effort ultra + drop empty tool_calls key (#70058, #70126)**. closed without merge
  - maintainer direction: category `superseded_by_pr`; implication `superseded`; refs `#90330`, `#90330`

## Fix status

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