# NousResearch/hermes-agent · Code fence closing rule fixes in message truncation

## Open now

- 1 issue, 2 PRs open on GitHub.
- #55292: truncate_message treats code lines with trailing fence text as closing fences
- PR #55294: fix(gateway): respect trailing text on closing code fences
- PR #55328: fix(gateway): only treat all-whitespace trailing content as closing fence

These issues and pull requests address a bug in a truncate_message function where trailing non-whitespace text after closing code fence markers was incorrectly treated as a closing fence. The fixes align the behavior with CommonMark rules, requiring only whitespace after the backticks to close a fence.

## TL;DR

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

- #55292: truncate_message treats code lines with trailing fence text as closing fences

## Prior & competing PRs

- **#55299: fix(gateway): require whitespace-only trailing content for closing fence in truncate_message**. closed without merge · fix tier `suggested`
  - maintainer direction: category `superseded_by_pr`; implication `superseded`; refs `#55294`, `#55292`
  - _suggested-tier fix detail withheld; re-request with `?tier=all` to include it._
- **#55311: fix(gateway): treat trailing non-whitespace after \`\`\` as code content, not fence close**. closed without merge · fix tier `suggested`
  - maintainer direction: category `implemented_elsewhere`; implication `superseded`; refs `#55294`
  - _suggested-tier fix detail withheld; re-request with `?tier=all` to include it._
- **#55404: fix: respect CommonMark closing fence rules in message truncation (#55292)**. closed without merge · fix tier `suggested`
  - maintainer direction: category `superseded_by_pr`; implication `superseded`
  - _suggested-tier fix detail withheld; re-request with `?tier=all` to include it._
- **#55294: fix(gateway): respect trailing text on closing code fences**. open
  - maintainer direction: category `uncategorized`; implication `needs_llm`
  - files: `gateway/platforms/base.py`, `tests/gateway/test_platform_base.py`
- **#55328: fix(gateway): only treat all-whitespace trailing content as closing fence**. open
  - maintainer direction: category `duplicate_of`; implication `duplicate`; refs `#55294`, `#55292`, `#55299`, `#55311`
  - files: `gateway/platforms/base.py`
- **#58077: fix(gateway): keep fence text inside code blocks**. closed without merge
  - maintainer direction: category `duplicate_of`; implication `duplicate`; refs `#55294`

## Fix status

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