# NousResearch/hermes-agent · Binary file detection logic fixes and corrections

## Open now

- Nothing open on GitHub.

These issues and pull requests address incorrect binary file detection in file-reading and search tools, specifically around flawed heuristics involving U+FFFD replacement characters and NUL bytes that caused valid UTF-8 files (including CJK content) to be misidentified as binary.

## 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 #81961. Verify it addresses your case.
- **Recommended:** read PR #81961 (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

- #80308: \[Bug\]: read_file incorrectly flags valid UTF-8 CJK files as binary, and search_files is completely broken (returns 0 for all queries)

## Prior & competing PRs

- **#81961: fix(file-ops): stop flagging boundary-cut UTF-8 as binary across read_file/patch/search_files**. merged to main · fix tier `verified`
  - maintainer direction: category `merged`; implication `superseded`
  - files: `contributors/emails/[redacted:email]`, `tests/tools/test_file_operations.py`, `tests/tools/test_read_file_utf8_binary_regression.py`, `tools/file_operations.py`
- **#76934: fix(tools): keep invalid UTF-8 boundaries binary**. closed without merge
  - maintainer direction: category `superseded_by_pr`; implication `superseded`; refs `#81961`, `#76924`, `#80440`
- **#80349: fix: verify NUL bytes before flagging U+FFFD samples as binary (#80308)**. closed without merge
  - maintainer direction: category `duplicate_of`; implication `duplicate`; refs `#76925`
- **#80749: fix(tools): use NUL-byte check for binary detection instead of U+FFFD (#80308)**. closed without merge
  - maintainer direction: category `duplicate_of`; implication `duplicate`; refs `#76925`

## Fix status

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