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: complete defensive null guards missed by PR #2113 (#2216)

LearningCircuit76b8f435c8e6
diff --git a/src/local_deep_research/llm/providers/implementations/anthropic.py b/src/local_deep_research/llm/providers/implementations/anthropic.py
index c7618d2ca0..632b10dd85 100644
--- a/src/local_deep_research/llm/providers/implementations/anthropic.py
+++ b/src/local_deep_research/llm/providers/implementations/anthropic.py
@@ -108,7 +108,7 @@ class AnthropicProvider(OpenAICompatibleProvider):
default=None,
settings_snapshot=settings_snapshot,
)
- return bool(api_key)
+ return bool(api_key and str(api_key).strip())
except Exception:
return False
diff --git a/src/local_deep_research/llm/providers/implementations/openai.py b/src/local_deep_research/llm/providers/implementations/openai.py
index 94d18829a2..1f1266e875 100644
--- a/src/local_deep_research/llm/providers/implementations/openai.py
+++ b/src/local_deep_research/llm/providers/implementations/openai.py
@@ -164,7 +164,7 @@ class OpenAIProvider(OpenAICompatibleProvider):
default=None,
settings_snapshot=settings_snapshot,
)
- return bool(api_key)
+ return bool(api_key and str(api_key).strip())
except Exception:
return False
diff --git a/src/local_deep_research/web_search_engines/search_engines_config.py b/src/local_deep_research/web_search_engines/search_engines_config.py
index 3ddc3a81dd..560f3070a8 100644
--- a/src/local_deep_research/web_search_engines/search_engines_config.py
+++ b/src/local_deep_research/web_search_engines/search_engines_config.py
@@ -165,12 +165,15 @@ def search_config(
search_engines["meta"] = search_engines["auto"]
# Register local document collections
- local_collections_data = _get_setting(
- "search.engine.local",
- {},
- db_session=db_session,
- settings_snapshot=settings_snapshot,
- username=username,
+ local_collections_data = (
+ _get_setting(
+ "search.engine.local",
+ {},
+ db_session=db_session,
+ settings_snapshot=settings_snapshot,
+ username=username,
+ )
+ or {}
)
local_collections_data = _extract_per_engine_config(local_collections_data)
@@ -353,12 +356,15 @@ def local_search_engines(
Returns:
A list of the enabled local search engines.
"""
- local_collections_data = _get_setting(
- "search.engine.local",
- {},
- db_session=db_session,
- settings_snapshot=settings_snapshot,
- username=username,
+ local_collections_data = (
+ _get_setting(
+ "search.engine.local",
+ {},
+ db_session=db_session,
+ settings_snapshot=settings_snapshot,
+ username=username,
+ )
+ or {}
)
local_collections_data = _extract_per_engine_config(local_collections_data)