# NousResearch/hermes-agent · Sanitize context idempotency for overlapping fence tags

## Open now

- 1 issue, 2 PRs open on GitHub.
- #108964: \[Bug\]: sanitize_context() is single-pass, so overlapping memory-context tags reassemble into a live fence that closes the recall block early
- PR #108965: fix(memory): sanitize recalled context to a fixed point so overlapping fence tags cannot reassemble
- PR #109086: fix(agent): make sanitize_context idempotent on overlapping tags (#108964)

These items concern a bug where single-pass sanitization of memory/context tags allows overlapping tags to reassemble into active fence markers. The work involves making sanitize_context run to a fixed point to prevent this reassembly.

## TL;DR

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

- #108964: \[Bug\]: sanitize_context() is single-pass, so overlapping memory-context tags reassemble into a live fence that closes the recall block early

## Prior & competing PRs

- **#108965: fix(memory): sanitize recalled context to a fixed point so overlapping fence tags cannot reassemble**. open
  - maintainer direction: category `silent_close`; implication `active`
  - files: `agent/memory_manager.py`, `tests/agent/test_memory_provider.py`
- **#109086: fix(agent): make sanitize_context idempotent on overlapping tags (#108964)**. open
  - maintainer direction: category `duplicate_of`; implication `duplicate`; refs `#108964`, `#108965`, `#108965`
  - files: `agent/memory_manager.py`, `tests/agent/test_memory_provider.py`

## Fix status

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