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.

chore: remove debug logging from E2E test troubleshooting

LearningCircuitffb819d87008
diff --git a/src/local_deep_research/api/research_functions.py b/src/local_deep_research/api/research_functions.py
index 4d6e00db86..a333ff89fd 100644
--- a/src/local_deep_research/api/research_functions.py
+++ b/src/local_deep_research/api/research_functions.py
@@ -108,29 +108,7 @@ def _init_search_system(
"search.tool", settings_snapshot=settings_snapshot
)
- # Debug with print to stderr
- import sys
-
- print(
- f"[LDR-DEBUG] search_tool={search_tool}, type={type(search_tool)}",
- file=sys.stderr,
- )
- print(
- f"[LDR-DEBUG] settings_snapshot present={settings_snapshot is not None}",
- file=sys.stderr,
- )
- print(f"[LDR-DEBUG] programmatic_mode={programmatic_mode}", file=sys.stderr)
- if settings_snapshot and "search.tool" in settings_snapshot:
- print(
- f"[LDR-DEBUG] search.tool in snapshot={settings_snapshot['search.tool']}",
- file=sys.stderr,
- )
-
if search_tool:
- print(
- f"[LDR-DEBUG] Calling get_search with search_tool={search_tool}",
- file=sys.stderr,
- )
search_engine = get_search(
search_tool,
llm_instance=llm,
@@ -138,19 +116,10 @@ def _init_search_system(
settings_snapshot=settings_snapshot,
programmatic_mode=programmatic_mode,
)
- print(
- f"[LDR-DEBUG] get_search returned: {type(search_engine) if search_engine else 'None'}",
- file=sys.stderr,
- )
if search_engine is None:
logger.warning(
f"Could not create search engine '{search_tool}', using default."
)
- else:
- print(
- f"[LDR-DEBUG] search_tool is falsy! search_tool={repr(search_tool)}",
- file=sys.stderr,
- )
# Create search system with custom parameters
logger.info("Search strategy: {}", search_strategy)
diff --git a/src/local_deep_research/config/search_config.py b/src/local_deep_research/config/search_config.py
index 7faad01fb8..cb436c0ab5 100644
--- a/src/local_deep_research/config/search_config.py
+++ b/src/local_deep_research/config/search_config.py
@@ -134,22 +134,6 @@ def get_search(
)
logger.info(f"Full params dict: {params}")
- # Debug
- import sys
-
- print(
- "[LDR-DEBUG search_config] About to call factory_get_search",
- file=sys.stderr,
- )
- print(
- f"[LDR-DEBUG search_config] tool={tool}, params keys={list(params.keys())}",
- file=sys.stderr,
- )
- print(
- f"[LDR-DEBUG search_config] settings_snapshot present={settings_snapshot is not None}",
- file=sys.stderr,
- )
-
# Create search engine
search_engine = factory_get_search(
settings_snapshot=settings_snapshot,
@@ -157,12 +141,6 @@ def get_search(
**params,
)
- # Debug result
- print(
- f"[LDR-DEBUG search_config] factory_get_search returned: {type(search_engine) if search_engine else 'None'}",
- file=sys.stderr,
- )
-
# Log the created engine type
if search_engine:
logger.info(
diff --git a/src/local_deep_research/web_search_engines/search_engine_factory.py b/src/local_deep_research/web_search_engines/search_engine_factory.py
index c13fceed12..aa2185c5b5 100644
--- a/src/local_deep_research/web_search_engines/search_engine_factory.py
+++ b/src/local_deep_research/web_search_engines/search_engine_factory.py
@@ -153,38 +153,15 @@ def create_search_engine(
kwargs["max_results"] = max_results
# Check for API key requirements
- import sys
-
requires_api_key = engine_config.get("requires_api_key", False)
- print(
- f"[LDR-DEBUG factory] engine_config.requires_api_key={requires_api_key}",
- file=sys.stderr,
- )
if requires_api_key:
# Check the settings snapshot for the API key
api_key = None
api_key_path = f"search.engine.web.{engine_name}.api_key"
- print(
- f"[LDR-DEBUG factory] Looking for API key at path: {api_key_path}",
- file=sys.stderr,
- )
if settings_snapshot:
- # Debug: print all keys in settings_snapshot that contain "api_key"
- api_key_keys = [
- k for k in settings_snapshot.keys() if "api_key" in k.lower()
- ]
- print(
- f"[LDR-DEBUG factory] API key related keys in settings_snapshot: {api_key_keys}",
- file=sys.stderr,
- )
-
api_key_setting = settings_snapshot.get(api_key_path)
- print(
- f"[LDR-DEBUG factory] api_key_setting from snapshot: {api_key_setting} (type: {type(api_key_setting)})",
- file=sys.stderr,
- )
if api_key_setting:
api_key = (
@@ -192,27 +169,15 @@ def create_search_engine(
if isinstance(api_key_setting, dict)
else api_key_setting
)
- print(
- f"[LDR-DEBUG factory] Extracted api_key: {api_key[:10] if api_key else 'None'}...",
- file=sys.stderr,
- )
# Still try to get from engine config if not found
if not api_key:
api_key = engine_config.get("api_key")
- print(
- f"[LDR-DEBUG factory] api_key from engine_config: {api_key[:10] if api_key else 'None'}...",
- file=sys.stderr,
- )
if not api_key:
logger.info(
f"Required API key for {engine_name} not found in settings."
)
- print(
- "[LDR-DEBUG factory] RETURNING None - no API key found",
- file=sys.stderr,
- )
return None
# Pass the API key in kwargs for engines that need it
@@ -615,29 +580,6 @@ def get_search(
params["time_period"] = time_period
# Create and return the search engine
- import sys
-
- print(
- "[LDR-DEBUG factory] About to call create_search_engine",
- file=sys.stderr,
- )
- print(
- f"[LDR-DEBUG factory] search_tool={search_tool}, type={type(search_tool)}",
- file=sys.stderr,
- )
- print(
- f"[LDR-DEBUG factory] params keys={list(params.keys())}",
- file=sys.stderr,
- )
- print(
- f"[LDR-DEBUG factory] settings_snapshot present={settings_snapshot is not None}",
- file=sys.stderr,
- )
- print(
- f"[LDR-DEBUG factory] programmatic_mode={programmatic_mode}",
- file=sys.stderr,
- )
-
logger.info(
f"Creating search engine for tool: {search_tool} (type: {type(search_tool)}) with params: {params.keys()}"
)
@@ -653,11 +595,6 @@ def get_search(
**params,
)
- print(
- f"[LDR-DEBUG factory] create_search_engine returned: {type(engine) if engine else 'None'}",
- file=sys.stderr,
- )
-
# Add debugging to check if engine is None
if engine is None:
logger.error(
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 e299a5c987..e74606640f 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
@@ -116,25 +116,6 @@ def search_config(
username=username,
)
- # Debug: Check what's in config_data for serper
- import sys
-
- if "serper" in config_data:
- serper_config = config_data.get("serper", {})
- print(
- f"[LDR-DEBUG config] serper config keys: {list(serper_config.keys())}",
- file=sys.stderr,
- )
- print(
- f"[LDR-DEBUG config] serper.requires_api_key={serper_config.get('requires_api_key')}",
- file=sys.stderr,
- )
- else:
- print(
- f"[LDR-DEBUG config] serper not in config_data, keys={list(config_data.keys())[:10]}",
- file=sys.stderr,
- )
-
search_engines = _extract_per_engine_config(config_data)
search_engines["auto"] = _get_setting(
"search.engine.auto",