You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
save_semantic_cache crashes with IsADirectoryError when a node's source_file points at a directory #448
During Step 3 Part C merge, save_semantic_cache aborted with:
File ".../graphify/cache.py", line 31, in file_hash
raw = p.read_bytes()
...
IsADirectoryError: [Errno 21] Is a directory: 'analysis-engine/data/quote_validation/sp_images'
The subagent that produced the offending chunk had written a node with source_file = 'analysis-engine/data/quote_validation/sp_images' (a directory, not a file). file_hash then tried to read_bytes() it.
Impact
Semantic cache save failed → on re-run, all 410 files would be re-extracted rather than hitting cache. For large corpora this doubles the API cost of any update.
Proposed fix (one-liner in cache.py::file_hash)
deffile_hash(p: Path, root: Path) ->str:
ifnotp.is_file(): # new guardreturn''# or raise a catchable warningraw=p.read_bytes()
...
Alternatively, have save_cached skip paths that fail is_file() with a warning.
Secondary consideration
The upstream reason is that a semantic-extraction subagent sometimes returns a directory string in source_file — prompt clarity could also be tightened. But defence-in-depth at the cache layer is the robust fix.
Repro
Any corpus where a semantic subagent labels a group of images collectively with the containing directory as source_file. Triggered reliably on a corpus with multiple directories of example images.
Activity
fix #455 #448 IsADirectoryError in file_hash and save_semantic_cache, f…
safishamsi commentedon Apr 21, 2026
Fixed in v0.4.24:
save_cachednow skips directory paths instead of raisingIsADirectoryError.fix #455 #448 IsADirectoryError in file_hash and save_semantic_cache, f…
fix Graphify-Labs#455 Graphify-Labs#448 IsADirectoryError in file_has…