diff --git a/cache_manager.py b/cache_manager.py index b29900e..d67de47 100644 --- a/cache_manager.py +++ b/cache_manager.py @@ -457,6 +457,15 @@ class L1CacheManager: logger.info(f"get_by_cid: Found via index: {path}") return path + # artdag Cache doesn't know about entry - check filesystem directly + # Files are stored at {cache_dir}/nodes/{node_id}/output.* + nodes_dir = self.cache_dir / "nodes" / node_id + if nodes_dir.exists(): + for f in nodes_dir.iterdir(): + if f.name.startswith("output."): + logger.info(f"get_by_cid: Found on filesystem: {f}") + return f + # For uploads, node_id == cid, so try direct lookup # This works even if cache index hasn't been reloaded path = self.cache.get(cid) @@ -465,6 +474,15 @@ class L1CacheManager: self._set_content_index(cid, cid) return path + # Check filesystem directly for cid as node_id + nodes_dir = self.cache_dir / "nodes" / cid + if nodes_dir.exists(): + for f in nodes_dir.iterdir(): + if f.name.startswith("output."): + logger.info(f"get_by_cid: Found on filesystem (direct): {f}") + self._set_content_index(cid, cid) + return f + # Scan cache entries (fallback for new structure) entry = self.cache.find_by_cid(cid) logger.info(f"get_by_cid: find_by_cid({cid[:16]}...) returned entry={entry}")