# NousResearch/hermes-agent · Terminal fence markers leaking into file content

## Open now

- Nothing open on GitHub.

A bug where heredoc or oneshot terminal execution causes internal fence/wrapper markers (HERMES_FENCE) to bleed into file content, silently corrupting files. Multiple fix attempts address this from both the terminal and file-read sides.

## TL;DR

- 5 member(s): 0 open issue(s), 2 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 #19426. Verify it addresses your case.
- **Recommended:** read PR #19426 (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: `partially_resolved` · deciding PR(s): `pr-19426`. This is distinct from the fix status above. Weigh it yourself.

## How this cluster was grouped

- Link evidence (`STRUCTURAL_PARTIAL`): some members are connected by structural evidence (shared changed files, or a closing/superseded reference); the rest are joined by an automated relevance judgement over their text.
- Members outside that structural core may belong to a different underlying problem.
- Pairwise link density `0.34`: 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

- #3587: \[Bug\]: terminal tool corrupts files when using heredoc syntax - shell wrapper artifacts bleed into file content
- #5400: \[Bug\]: HERMES_FENCE markers leak into file content via ShellFileOperations — corrupts source files silently

## Prior & competing PRs

- **#19426: fix(file): strip leaked terminal fences from reads**. merged to main · fix tier `verified`
  - maintainer direction: category `merged`; implication `superseded`
  - files: `tests/tools/test_file_operations.py`, `tools/file_operations.py`
- **#3613: fix(terminal): prevent fence wrapper from bleeding into heredoc content**. closed without merge
  - maintainer direction: category `uncategorized`; implication `needs_llm`
- **#19266: fix(file): strip leaked terminal fences from reads**. closed without merge
  - maintainer direction: category `merged_via`; implication `superseded`; refs `#19426`

## Fix status

- Merged to main in PR #19426 (cited above). No release data is tracked. Verify downstream.
- Fix last verified (merged) `2026-05-03`.
- Subsystem: `environments`
