From 3e12596dbf9638be5b144272cf06137e0d1b744d Mon Sep 17 00:00:00 2001 From: gilesb Date: Thu, 8 Jan 2026 02:02:47 +0000 Subject: [PATCH] Fix cache lookup to work across processes cache_manager.py: - get_by_content_hash() now tries direct cache.get(content_hash) since uploads use content_hash as node_id - This works even if cache index hasn't been reloaded Co-Authored-By: Claude Opus 4.5 --- cache_manager.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cache_manager.py b/cache_manager.py index 51b8f8a..da94050 100644 --- a/cache_manager.py +++ b/cache_manager.py @@ -250,6 +250,14 @@ class L1CacheManager: if path and path.exists(): return path + # For uploads, node_id == content_hash, so try direct lookup + # This works even if cache index hasn't been reloaded + path = self.cache.get(content_hash) + if path and path.exists(): + self._content_index[content_hash] = content_hash + self._save_content_index() + return path + # Scan cache entries (fallback for new structure) entry = self.cache.find_by_content_hash(content_hash) if entry and entry.output_path.exists():