# NousResearch/hermes-agent · Non-UTF-8 memory file encoding crash and silent failure

## Open now

- Nothing open on GitHub.

These issues and fixes concern crashes or silent memory loss when MEMORY.md or USER.md contain non-UTF-8 bytes, BOMs, or legacy encodings. Proposed fixes involve graceful degradation, error logging, and tolerant file reading instead of strict UTF-8 decoding.

## TL;DR

- 10 member(s): 0 open issue(s), 4 closed issue(s), 0 open PR(s), 1 merged PR(s), 5 PR(s) closed without merging.
- A fix was merged to main in PR #71078. Verify it addresses your case.
- **Recommended:** read PR #71078 (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: `unresolved`. 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.20`: 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

- #10879: \[Bug\]: Non-UTF-8 MEMORY.md raises uncaught UnicodeDecodeError — agent starts with empty memory
- #49508: memory_tool.py can crash on non-UTF-8 files during strict UTF-8 read
- #53833: \[Bug\]: memory tool crashes with UnicodeDecodeError on legacy non-UTF-8 bytes in USER.md/MEMORY.md
- #57754: Encoding corruption in MEMORY.md/USER.md silently disables memory, with no log

## Prior & competing PRs

- **#71078: fix(windows): retire the bare read_text/write_text class — salvage 11 contributor PRs + sweep + linter**. merged to main · fix tier `verified`
  - maintainer direction: category `merged`; implication `superseded`
  - files: `agent/auxiliary_client.py`, `agent/copilot_acp_client.py`, `agent/credential_sources.py`, `agent/nous_rate_guard.py`, `agent/shell_hooks.py`, `cli.py`, `contributors/emails/[redacted:email]`, `contributors/emails/[redacted:email]`, `contributors/emails/[redacted:email]`, `hermes_cli/auth.py`, `hermes_cli/banner.py`, `hermes_cli/container_boot.py`, `hermes_cli/doctor.py`, `hermes_cli/gateway.py`, `hermes_cli/main.py`, `hermes_cli/plugins.py`, `hermes_cli/profiles.py`, `hermes_cli/service_manager.py`, `hermes_cli/uninstall.py`, `hermes_constants.py` (+58 more)
- **#10888: fix(memory): handle BOM and non-UTF-8 bytes in memory files**. closed without merge
  - maintainer direction: category `partial_fix`; implication `needs_llm`
- **#49516: fix(memory): handle non-UTF-8 files gracefully instead of crashing**. closed without merge
  - maintainer direction: category `implemented_elsewhere`; implication `superseded`; refs `#26045`, `#71078`
- **#49552: Fix UnicodeDecodeError when reading non-UTF-8 files (fix #49508)**. closed without merge
  - maintainer direction: category `duplicate_of`; implication `duplicate`; refs `#49516`, `#49508`, `#49516`, `#49516`
- **#54044: fix(memory): tolerate non-UTF-8 bytes in USER.md/MEMORY.md reads**. closed without merge
  - maintainer direction: category `implemented_elsewhere`; implication `superseded`; refs `#26045`, `#71078`
- **#57755: fix(memory): log and degrade gracefully on invalid UTF-8 in memory files**. closed without merge
  - maintainer direction: category `uncategorized`; implication `needs_llm`

## Fix status

- Merged to main in PR #71078 (cited above). No release data is tracked. Verify downstream.
- Fix last verified (merged) `2026-07-25`.
- Subsystem: `agent`
