Skip to content

~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.

fix: Prevent fallback LLM from interfering with mocked tests in CI

LearningCircuit8dc0f055fe5b
diff --git a/src/local_deep_research/config/llm_config.py b/src/local_deep_research/config/llm_config.py
index 667ed325cf..f3ffdf93f4 100644
--- a/src/local_deep_research/config/llm_config.py
+++ b/src/local_deep_research/config/llm_config.py
@@ -307,7 +307,10 @@ def get_llm(
)
# Check if we're in testing mode and should use fallback (but only when no API keys are configured)
- if os.environ.get("LDR_USE_FALLBACK_LLM", ""):
+ # Skip fallback check if we're in test mode with mocks
+ if os.environ.get("LDR_USE_FALLBACK_LLM", "") and not os.environ.get(
+ "LDR_TESTING_WITH_MOCKS", ""
+ ):
# Only use fallback if the provider has no valid configuration
provider_has_config = False
diff --git a/tests/conftest.py b/tests/conftest.py
index 3297511eef..ce01a08868 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -49,6 +49,10 @@ def pytest_configure(config):
"requires_llm: mark test as requiring a real LLM (not fallback)",
)
+ # Set environment variable to indicate we're in test mode with mocks
+ # This prevents the fallback LLM logic from interfering with mocked tests
+ os.environ["LDR_TESTING_WITH_MOCKS"] = "true"
+
@pytest.fixture(autouse=True)
def skip_if_using_fallback_llm(request):