# NousResearch/hermes-agent · Fuzzy match strategy bugs and patch tool fixes

## Open now

- 4 issues, 4 PRs open on GitHub.
- #14497: \[Bug\]: Redundancy in fuzzy match: indentation_flexible (strategy 4) is a strict subset of line_trimmed (strategy 2)
- #14781: \[Bug\]: fuzzy_match.py strategy ordering makes indentation_flexible dead code
- #18426: patch tool can create duplicate content loops when used repeatedly
- #54572: patch tool (replace mode) can edit the wrong region when old_string is not an exact match
- PR #14522: fix: reorder fuzzy match strategies so indentation_flexible is not dead code
- PR #14777: fix(tools): reorder fuzzy match strategies so indentation_flexible is no longer dead code
- PR #54575: fix(patch): reject wrong-region matches in the fuzzy edit fallback
- PR #56570: fix(tools): patch idempotency guard prevents duplicate-content loops on re-edit (#18426)

These issues and PRs address two related areas: dead/unreachable code in fuzzy_match.py due to incorrect strategy ordering, and patch tool bugs including wrong-region edits and duplicate-content loops from repeated application.

## TL;DR

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

- #14497: \[Bug\]: Redundancy in fuzzy match: indentation_flexible (strategy 4) is a strict subset of line_trimmed (strategy 2)
- #14781: \[Bug\]: fuzzy_match.py strategy ordering makes indentation_flexible dead code
- #18426: patch tool can create duplicate content loops when used repeatedly
- #54572: patch tool (replace mode) can edit the wrong region when old_string is not an exact match

## Prior & competing PRs

- **#137288: fix(tools): patch matching fixes from NVIDIA batch (#128006, #128020, #128138)**. merged to main · fix tier `verified`
  - maintainer direction: category `merged`; implication `superseded`
  - files: `tests/tools/test_escape_drift_autocorrect.py`, `tests/tools/test_file_tools_live.py`, `tests/tools/test_fuzzy_match.py`, `tools/escape_drift_autocorrect.py`, `tools/file_operations.py`, `tools/fuzzy_match.py`, `tools/patch_parser.py`, `tools/skill_manager_tool.py`
- **#14522: fix: reorder fuzzy match strategies so indentation_flexible is not dead code**. open
  - maintainer direction: category `uncategorized`; implication `needs_llm`; refs `#14497`
  - files: `tests/tools/test_fuzzy_match.py`, `tools/fuzzy_match.py`
- **#14777: fix(tools): reorder fuzzy match strategies so indentation_flexible is no longer dead code**. open
  - maintainer direction: category `duplicate_of`; implication `duplicate`; refs `#14522`, `#14497`
  - files: `tests/tools/test_fuzzy_match.py`, `tools/fuzzy_match.py`
- **#15011: fix(tools): reorder fuzzy_match strategies so indentation_flexible is reachable**. closed without merge
  - maintainer direction: category `duplicate_of`; implication `duplicate`; refs `#14522`
- **#54575: fix(patch): reject wrong-region matches in the fuzzy edit fallback**. open
  - maintainer direction: category `merged_via`; implication `superseded`
  - files: `contributors/emails/[redacted:email]`, `tests/tools/test_file_tools_live.py`, `tests/tools/test_fuzzy_match.py`, `tools/fuzzy_match.py`
- **#56570: fix(tools): patch idempotency guard prevents duplicate-content loops on re-edit (#18426)**. open
  - maintainer direction: category `uncategorized`; implication `needs_llm`
  - files: `tests/tools/test_fuzzy_match.py`, `tests/tools/test_fuzzy_match_scoping.py`, `tools/fuzzy_match.py`
- **#84278: fix(tools): guard replayed JSON value patches**. closed without merge
  - maintainer direction: category `stale_abandoned`; implication `active`
- **#128138: fix(tools): patch writefile verification warning**. closed without merge
  - maintainer direction: category `merged_via`; implication `superseded`; refs `#137288`

## Fix status

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