# NousResearch/hermes-agent · PermissionError handling and file dedup cache fixes

## Open now

- 1 issue, 3 PRs open on GitHub.
- #56380: read_file dedup & staleness tracking stat the host filesystem, not the terminal environment
- PR #6321: fix(prompt): catch PermissionError in context file discovery
- PR #8767: fix(prompt): tolerate inaccessible context parent paths
- PR #56383: fix(tools): don't apply host-mtime dedup/staleness on remote backends

Multiple bugs and fixes around PermissionError when discovering context files in inaccessible directories, and read_file dedup/staleness logic incorrectly using host filesystem stats or returning stale results after writes.

## TL;DR

- 14 member(s): 1 open issue(s), 3 closed issue(s), 3 open PR(s), 0 merged PR(s), 7 PR(s) closed without merging.
- No fix has been merged to main; one or more PRs were attempted (see below).
- **Recommended:** review the prior/competing PR(s) below. A fix was attempted but not merged; your case may extend or revive that work.

## 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.12`: 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

- #56380: read_file dedup & staleness tracking stat the host filesystem, not the terminal environment

## Closed / duplicate issues

- #6214: \[Bug\]: \`build_context_files_prompt()\` raises PermissionError when TERMINAL_CWD points to an inaccessible directory (eg Daytona)
- #8751: Bug: PermissionError when walking parent directories for .git root
- #13144: \[Bug\]: read_file dedup cache not invalidated by write_file on same path — returns stale "not found" after successful write

## Prior & competing PRs

- **#6247: fix(prompt): ignore inaccessible context files**. closed without merge · fix tier `suggested`
  - maintainer direction: category `superseded_by_pr`; implication `superseded`
  - _suggested-tier fix detail withheld; re-request with `?tier=all` to include it._
- **#6355: fix(prompt_builder): handle PermissionError during context file discovery**. closed without merge · fix tier `suggested`
  - maintainer direction: category `superseded_by_pr`; implication `superseded`; refs `#17100`
  - _suggested-tier fix detail withheld; re-request with `?tier=all` to include it._
- **#6321: fix(prompt): catch PermissionError in context file discovery**. open
  - maintainer direction: category `duplicate_of`; implication `duplicate`; refs `#17100`, `#6214`
  - files: `agent/prompt_builder.py`
- **#8767: fix(prompt): tolerate inaccessible context parent paths**. open
  - maintainer direction: category `duplicate_of`; implication `duplicate`; refs `#8801`, `#8751`
  - files: `agent/prompt_builder.py`, `tests/agent/test_prompt_builder.py`
- **#8801: fix: catch PermissionError when walking parent dirs for context files**. closed without merge
  - maintainer direction: category `silent_close`; implication `active`
- **#13207: fix(tools): invalidate read_file dedup cache on write_file and patch**. closed without merge
  - maintainer direction: category `merged_via`; implication `superseded`; refs `a32b325d0`
- **#17100: fix(prompt_builder): handle PermissionError during context file discovery**. closed without merge
  - maintainer direction: category `merged_via`; implication `superseded`
- **#25360: fix(prompt-builder): ignore inaccessible cwd during context discovery**. closed without merge
  - maintainer direction: category `superseded_by_pr`; implication `superseded`; refs `#17100`, `#6355`, `#6214`
- **#56383: fix(tools): don't apply host-mtime dedup/staleness on remote backends**. open
  - maintainer direction: category `implemented_elsewhere`; implication `superseded`
  - files: `tests/tools/test_file_tools.py`, `tools/file_state.py`, `tools/file_tools.py`
- **#87606: fix(tools): search truncation flags, remote-backend host stats, registry eviction**. closed without merge
  - maintainer direction: category `uncategorized`; implication `needs_llm`

## Fix status

- No merged fix on record.
- Subsystem: `agent`
