fix: use absolute path for passages_file to prevent FileNotFoundError

When embedding server is launched as a subprocess, it may run in a different
working directory. Using absolute paths ensures the server can always find
the metadata file regardless of where it's launched from.
This commit is contained in:
Andy Lee committed 2025-07-25 01:23:47 -07:00
1 parent e64b599276
commit 48c5e12ac1
1 file changed
+2 -1
@@ -112,8 +112,9 @@ class BaseSearcher(LeannBackendSearcherInterface, ABC):
passages_source_file = ( passages_source_file = (
self.index_dir / f"{self.index_path.name}.meta.json" self.index_dir / f"{self.index_path.name}.meta.json"
) )
# Convert to absolute path to ensure server can find it
zmq_port = self._ensure_server_running( zmq_port = self._ensure_server_running(
str(passages_source_file), zmq_port str(passages_source_file.resolve()), zmq_port
) )
return self._compute_embedding_via_server([query], zmq_port)[ return self._compute_embedding_via_server([query], zmq_port)[
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.