# NousResearch/hermes-agent · repair_message_sequence orphaned tool_calls causing DeepSeek HTTP 400

## Open now

- Nothing open on GitHub.

One bug report describes HTTP 400 "insufficient tool messages following tool_calls" errors on DeepSeek v4 after long tool-call sessions, attributed to repair_message_sequence. Two pull requests reference the same issue (#56980) and propose different approaches: closing orphaned assistant tool_calls versus stripping them.

## TL;DR

- 3 member(s): 0 open issue(s), 1 closed issue(s), 0 open PR(s), 0 merged PR(s), 2 PR(s) closed without merging.
- No fix has been merged to main; one or more PRs were attempted (see below).
- **Recommended:** review the prior/competing PR(s) below. A fix was attempted but not merged; your case may extend or revive that work.

## 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

- #56980: \[Bug\]: repair_message_sequence fails to prevent HTTP 400 "insufficient tool messages following tool_calls" on DeepSeek v4 after long tool-call sessions

## Prior & competing PRs

- **#56990: fix(agent): strip orphan tool_calls in repair_message_sequence (#56980)**. closed without merge · fix tier `suggested`
  - maintainer direction: category `partial_fix`; implication `needs_llm`; refs `#56980`, `#1732`
  - _suggested-tier fix detail withheld; re-request with `?tier=all` to include it._
- **#57013: fix(agent): close orphaned assistant(tool_calls) in repair_message_sequence (#56980)**. closed without merge · fix tier `suggested`
  - maintainer direction: category `uncategorized`; implication `needs_llm`; refs `#56980`, `#57039`
  - _suggested-tier fix detail withheld; re-request with `?tier=all` to include it._

## Fix status

- No merged fix on record.
