# NousResearch/hermes-agent · Strip ANSI escapes before control-char removal in session titles

## Open now

- 1 issue, 2 PRs open on GitHub.
- #40103: \[Bug\]: sanitize_title removes the ESC anchor before the sequence is stripped — escape body survives in session titles
- PR #40105: fix(sessions): strip ANSI escapes in sanitize_title before control-char removal
- PR #106956: fix(titles): strip ANSI escapes and bare OSC residue from session titles

These issues and PRs address a bug where ANSI escape sequences leak into session titles because the ESC character is removed before the full sequence is stripped. The fix involves reordering sanitize_title logic to run ANSI stripping first.

## TL;DR

- 5 member(s): 1 open issue(s), 0 closed issue(s), 2 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.40`: 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

- #40103: \[Bug\]: sanitize_title removes the ESC anchor before the sequence is stripped — escape body survives in session titles

## Prior & competing PRs

- **#40220: fix(agent): strip full ANSI escape sequences from session titles (#40103)**. closed without merge · fix tier `suggested`
  - maintainer direction: category `uncategorized`; implication `needs_llm`
- **#40105: fix(sessions): strip ANSI escapes in sanitize_title before control-char removal**. open
  - maintainer direction: category `uncategorized`; implication `needs_llm`
  - files: `hermes_state.py`, `tests/test_sanitize_title_ansi.py`
- **#40150: fix(sanitize_title): run strip_ansi before control-char removal to prevent ANSI body leaking into session titles**. closed without merge
  - maintainer direction: category `duplicate_of`; implication `duplicate`; refs `#40105`
- **#106956: fix(titles): strip ANSI escapes and bare OSC residue from session titles**. open
  - maintainer direction: category `uncategorized`; implication `needs_llm`; refs `#40105`, `#40103`
  - files: `hermes_state_titles.py`, `tests/test_sanitize_title_ansi.py`

## Fix status

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