~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.
Python academiaanthropicarxivbravedeep-researchencryptionhome-automationhomeserverlocallocal-deep-researchlocal-llmmistralollamaopenaipubmedresearchresearch-toolretrieval-augmented-generationsearxngself-hosted
fix: complete path-hardening follow-ups from PRs #2646, #2648 (#2672)
LearningCircuit2eee80315706
diff --git a/src/local_deep_research/research_library/services/download_service.py b/src/local_deep_research/research_library/services/download_service.pyindex fc121d13de..97a2b489b1 100644--- a/src/local_deep_research/research_library/services/download_service.py+++ b/src/local_deep_research/research_library/services/download_service.py@@ -222,7 +222,7 @@ class DownloadService:absolute_path = get_absolute_path_from_settings(tracker.file_path)- if absolute_path and absolute_path.exists():+ if absolute_path and absolute_path.is_file():return True, str(absolute_path)elif absolute_path:# File was deleted, mark as not downloadeddiff --git a/src/local_deep_research/settings/env_settings.py b/src/local_deep_research/settings/env_settings.pyindex 2bbf3de152..79fdd24a98 100644--- a/src/local_deep_research/settings/env_settings.py+++ b/src/local_deep_research/settings/env_settings.py@@ -209,7 +209,7 @@ class PathSetting(StringSetting):# Note: os.path.expandvars is kept here as there's no pathlib equivalent# noqa: PLR0402 - Suppress pathlib check for this linepath_str = os.path.expandvars(str(path))- path = Path(path_str)+ path = Path(path_str).resolve()if self.create_if_missing and not path.exists():try:diff --git a/tests/research_library/services/test_download_service.py b/tests/research_library/services/test_download_service.pyindex 46bca7b620..7c10788b0c 100644--- a/tests/research_library/services/test_download_service.py+++ b/tests/research_library/services/test_download_service.py@@ -303,7 +303,7 @@ class TestDownloadServiceIsAlreadyDownloaded:# Mock path existsmock_path = Mock()- mock_path.exists.return_value = True+ mock_path.is_file.return_value = Truemocker.patch("local_deep_research.research_library.services.download_service.get_absolute_path_from_settings",return_value=mock_path,diff --git a/tests/research_library/services/test_library_service_crud_deep.py b/tests/research_library/services/test_library_service_crud_deep.pyindex 3ab32f4209..4aa29f94b2 100644--- a/tests/research_library/services/test_library_service_crud_deep.py+++ b/tests/research_library/services/test_library_service_crud_deep.py@@ -12,6 +12,11 @@ Covers:from contextlib import contextmanagerfrom unittest.mock import Mock, MagicMock, patch+from local_deep_research.constants import (+ FILE_PATH_METADATA_ONLY,+ FILE_PATH_TEXT_ONLY,+)+# ============== Helper ==============@@ -367,7 +372,9 @@ class TestGetDocumentByIdHappyPaths:def test_file_path_metadata_only_has_pdf_false(self, mocker):"""file_path='metadata_only' means has_pdf is False."""- service, _, _ = self._setup_found_doc(mocker, file_path="metadata_only")+ service, _, _ = self._setup_found_doc(+ mocker, file_path=FILE_PATH_METADATA_ONLY+ )result = service.get_document_by_id("doc-123")assert result["has_pdf"] is False@@ -375,7 +382,7 @@ class TestGetDocumentByIdHappyPaths:def test_file_path_text_only_has_pdf_false(self, mocker):"""file_path='text_only_not_stored' means has_pdf is False."""service, _, _ = self._setup_found_doc(- mocker, file_path="text_only_not_stored"+ mocker, file_path=FILE_PATH_TEXT_ONLY)result = service.get_document_by_id("doc-123")@@ -400,7 +407,7 @@ class TestGetDocumentByIdHappyPaths:def test_has_pdf_via_database_storage_mode(self, mocker):"""storage_mode='database' + no file_path checks _has_blob_in_db."""service, mock_doc, mock_session = self._setup_found_doc(- mocker, file_path="metadata_only", storage_mode="database"+ mocker, file_path=FILE_PATH_METADATA_ONLY, storage_mode="database")# Mock _has_blob_in_db to return Truemocker.patch.object(service, "_has_blob_in_db", return_value=True)diff --git a/tests/settings/test_env_settings_extended.py b/tests/settings/test_env_settings_extended.pyindex 389578e0df..bd1c56c677 100644--- a/tests/settings/test_env_settings_extended.py+++ b/tests/settings/test_env_settings_extended.py@@ -201,7 +201,7 @@ class TestPathSettingValidation:assert "test_dir" in resultdef test_path_setting_expands_env_vars(self):- """Test that $HOME/path is expanded."""+ """Test that $HOME/path is expanded to the correct absolute path."""setting = PathSetting(key="test.env_path", description="Test setting", default=None)@@ -210,10 +210,8 @@ class TestPathSettingValidation:result = setting.get_value()- # Should not contain $HOME anymore- assert "$HOME" not in result- # Should contain actual home path- assert "test_env_dir" in result+ expected = str(Path(os.environ["HOME"]) / "test_env_dir")+ assert result == expecteddef test_path_setting_create_if_missing(self, tmp_path):"""Test that directory is created when create_if_missing=True."""