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
2025-07-25 01:23:47 -07:00
parent e64b599276
commit 48c5e12ac1

View File

@@ -112,8 +112,9 @@ class BaseSearcher(LeannBackendSearcherInterface, ABC):
passages_source_file = (
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(
str(passages_source_file), zmq_port
str(passages_source_file.resolve()), zmq_port
)
return self._compute_embedding_via_server([query], zmq_port)[