# NousResearch/hermes-agent · Agent max-iteration failure breaks message role alternation

## Open now

- Nothing open on GitHub.

These issues and PRs address a bug where max-iteration summary failures leave orphaned synthetic user messages, violating expected role alternation in the message history. The work explores various fixes around how assistant responses are appended or omitted when the max-iterations handler fails.

## TL;DR

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

- #56056: _handle_max_iterations failure leaves orphaned synthetic user message violating role alternation

## Prior & competing PRs

- **#56057: fix: append assistant response on _handle_max_iterations failure**. closed without merge · fix tier `suggested`
  - maintainer direction: category `uncategorized`; implication `needs_llm`; refs `59e7e9d00788435d6d6a3dbd0530e7aa259d7ff4`
  - _suggested-tier fix detail withheld; re-request with `?tier=all` to include it._
- **#56397: fix(agent): append assistant reply when max-iterations summary fails**. closed without merge · fix tier `suggested`
  - maintainer direction: category `superseded_by_pr`; implication `superseded`; refs `#56057`, `#56056`
  - _suggested-tier fix detail withheld; re-request with `?tier=all` to include it._
- **#56064: fix(agent): preserve alternation on max-iteration summary failure**. closed without merge
  - maintainer direction: category `duplicate_of`; implication `duplicate`; refs `#56057`, `#56056`
- **#56071: fix(agent): append error response to messages on max-iteration summary failure (#56056)**. closed without merge
  - maintainer direction: category `duplicate_of`; implication `duplicate`; refs `#56057`, `#56056`, `#56064`
- **#56857: fix(agent): close max-iteration summary failures**. closed without merge
  - maintainer direction: category `duplicate_of`; implication `duplicate`; refs `#56057`, `#56056`, `#56064`, `#56071`

## Fix status

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