# NousResearch/hermes-agent · Mistral tool-to-user role adjacency fix

## Open now

- 1 issue, 1 PR open on GitHub.
- #20154: Mistral models fail with 'Unexpected role user after role tool' in multi-turn tool conversations
- PR #84944: fix(agent): bridge tool->user role adjacency for Mistral endpoints

These items address a Mistral-specific error that occurs when a user role immediately follows a tool role in multi-turn conversations. The proposed fix inserts a bridging assistant message between tool and user turns to satisfy Mistral's role ordering requirements.

## TL;DR

- 3 member(s): 1 open issue(s), 0 closed issue(s), 1 open PR(s), 0 merged PR(s), 1 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.

## Open related issues

- #20154: Mistral models fail with 'Unexpected role user after role tool' in multi-turn tool conversations

## Prior & competing PRs

- **#84944: fix(agent): bridge tool->user role adjacency for Mistral endpoints**. open
  - maintainer direction: category `implemented_elsewhere`; implication `superseded`; refs `9a47214ad`, `071d27d1c`
  - files: `agent/agent_runtime_helpers.py`, `agent/chat_completion_helpers.py`, `agent/conversation_loop.py`, `agent/message_sanitization.py`, `agent/moa_loop.py`, `run_agent.py`, `tests/agent/test_moa_aggregator_tool_role_policy.py`, `tests/run_agent/test_mistral_tool_user_bridge.py`
- **#99155: fix(agent): insert empty assistant bridge between tool->user turns for Mistral models**. closed without merge
  - maintainer direction: category `duplicate_of`; implication `duplicate`; refs `#84944`

## Fix status

- No merged fix on record.
- Subsystem: `agent`
