# NousResearch/hermes-agent · surrogateescape handling in local file write paths

## Open now

- Nothing open on GitHub.

These items concern a bug where surrogate-escaped bytes cause failures during local environment file writes. The work involves making file writes surrogateescape-safe while rejecting genuinely unencodable surrogates.

## TL;DR

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

## Closed / duplicate issues

- #79178: \[Bug\]: surrogateescape content fails in the real LocalEnvironment write path

## Prior & competing PRs

- **#81964: fix(agent,gateway): lone-surrogate chokepoints \\u2014 sanitize once at model-text exit and outbound assembly**. merged to main · fix tier `verified`
  - maintainer direction: category `merged`; implication `superseded`
  - files: `agent/conversation_loop.py`, `agent/turn_finalizer.py`, `contributors/emails/[redacted:email]`, `gateway/run.py`, `hermes_cli/oneshot.py`, `tests/agent/test_surrogate_chokepoints.py`, `tests/hermes_cli/test_oneshot_surrogate.py`, `tests/tools/test_file_write_surrogate_roundtrip.py`, `tests/tools/test_process_registry_write_stdin_surrogates.py`, `tools/environments/base.py`, `tools/file_operations.py`, `tools/process_registry.py`
- **#79218: fix(tools): preserve surrogateescape bytes in local writes**. closed without merge
  - maintainer direction: category `superseded_by_pr`; implication `superseded`; refs `#79234`
- **#79234: fix: surrogateescape-safe file writes, reject unencodable surrogates (#79178)**. closed without merge
  - maintainer direction: category `uncategorized`; implication `needs_llm`
- **#79240: fix: surrogateescape-safe file writes, reject unencodable surrogates (#79178)**. closed without merge
  - maintainer direction: category `merged_via`; implication `superseded`; refs `#81964`

## Fix status

- Merged to main in PR #81964 (cited above). No release data is tracked. Verify downstream.
- Fix last verified (merged) `2026-08-08`.
