# NousResearch/hermes-agent · Fixes for conversation history starting with assistant turn

## Open now

- Nothing open on GitHub.

Multiple fixes addressing cases where context compression or compaction leaves conversation histories beginning with an assistant or model message, causing API 400 errors across Anthropic and Gemini adapters. Patches include guarding, stripping, or prepending user turns to restore valid message ordering.

## TL;DR

- 4 member(s): 0 open issue(s), 1 closed issue(s), 0 open PR(s), 1 merged PR(s), 2 PR(s) closed without merging.
- A fix was merged to main in PR #69340. Verify it addresses your case.
- **Recommended:** read PR #69340 (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: `resolved` · deciding PR(s): `pr-69340`. 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.50`: 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

- #52160: bug(adapter): HTTP 400 after double context compression — first message is assistant, not user

## Prior & competing PRs

- **#69340: fix(anthropic): guard leading-assistant transcripts after double compaction**. merged to main · fix tier `verified`
  - maintainer direction: category `merged`
  - files: `agent/anthropic_adapter.py`, `tests/agent/test_anthropic_adapter.py`
- **#52167: fix(compressor): pin summary role to user when only system prompt is protected (#52160)**. closed without merge
  - maintainer direction: category `implemented_elsewhere`; implication `superseded`; refs `8f4d195d5`, `#56197`
- **#52276: fix(anthropic): prepend user turn when compaction leaves a leading assistant message**. closed without merge
  - maintainer direction: category `merged_via`; implication `superseded`; refs `b6a2b701c`, `#69340`

## Fix status

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