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.

refactor: remove dead code from disabled file location endpoints (#1898)

LearningCircuitabbd3a607afb
diff --git a/src/local_deep_research/research_library/routes/library_routes.py b/src/local_deep_research/research_library/routes/library_routes.py
index f7680f33c4..3a05d57bad 100644
--- a/src/local_deep_research/research_library/routes/library_routes.py
+++ b/src/local_deep_research/research_library/routes/library_routes.py
@@ -576,9 +576,11 @@ def serve_text_api(document_id):
@library_bp.route("/api/open-folder", methods=["POST"])
@login_required
def open_folder():
- """Open folder containing a document."""
- # Security: This endpoint is disabled for server deployments
- # It only makes sense for desktop usage where the server and client are on the same machine
+ """Open folder containing a document.
+
+ Security: This endpoint is disabled for server deployments.
+ It only makes sense for desktop usage where the server and client are on the same machine.
+ """
return jsonify(
{
"status": "error",
diff --git a/src/local_deep_research/web/routes/research_routes.py b/src/local_deep_research/web/routes/research_routes.py
index 600537f456..2914f3ecb4 100644
--- a/src/local_deep_research/web/routes/research_routes.py
+++ b/src/local_deep_research/web/routes/research_routes.py
@@ -942,9 +942,11 @@ def clear_history():
@research_bp.route("/open_file_location", methods=["POST"])
@login_required
def open_file_location():
- """Open a file location in the system file explorer"""
- # Security: This endpoint is disabled for server deployments
- # It only makes sense for desktop usage where the server and client are on the same machine
+ """Open a file location in the system file explorer.
+
+ Security: This endpoint is disabled for server deployments.
+ It only makes sense for desktop usage where the server and client are on the same machine.
+ """
return jsonify(
{
"status": "error",
diff --git a/src/local_deep_research/web/routes/settings_routes.py b/src/local_deep_research/web/routes/settings_routes.py
index c7a502463b..73ea43a188 100644
--- a/src/local_deep_research/web/routes/settings_routes.py
+++ b/src/local_deep_research/web/routes/settings_routes.py
@@ -1927,9 +1927,11 @@ def search_engines_config_page():
@settings_bp.route("/open_file_location", methods=["POST"])
@login_required
def open_file_location():
- """Open the location of a configuration file"""
- # Security: This endpoint is disabled for server deployments
- # It only makes sense for desktop usage where the server and client are on the same machine
+ """Open the location of a configuration file.
+
+ Security: This endpoint is disabled for server deployments.
+ It only makes sense for desktop usage where the server and client are on the same machine.
+ """
return jsonify(
{
"status": "error",
diff --git a/tests/settings/test_hidden_internal_settings.py b/tests/settings/test_hidden_internal_settings.py
new file mode 100644
index 0000000000..875904a3b7
--- /dev/null
+++ b/tests/settings/test_hidden_internal_settings.py
@@ -0,0 +1,55 @@
+import json
+from pathlib import Path
+
+SETTINGS_PATH = Path("src/local_deep_research/defaults/default_settings.json")
+
+
+def _load_settings():
+ with open(SETTINGS_PATH) as f:
+ return json.load(f)
+
+
+def test_class_name_settings_not_editable():
+ """All class_name settings should be hidden and non-editable."""
+ settings = _load_settings()
+
+ class_name_keys = [k for k in settings if k.endswith(".class_name")]
+ assert class_name_keys, "Expected at least one class_name setting"
+
+ for key in class_name_keys:
+ value = settings[key]
+ assert value.get("editable") is False, f"{key} should not be editable"
+ assert value.get("visible") is False, f"{key} should not be visible"
+
+
+def test_module_path_settings_not_editable():
+ """All module_path settings should be hidden and non-editable."""
+ settings = _load_settings()
+
+ module_path_keys = [k for k in settings if k.endswith(".module_path")]
+ assert module_path_keys, "Expected at least one module_path setting"
+
+ for key in module_path_keys:
+ value = settings[key]
+ assert value.get("editable") is False, f"{key} should not be editable"
+ assert value.get("visible") is False, f"{key} should not be visible"
+
+
+def test_user_facing_settings_remain_editable():
+ """Regular user-facing settings should still be editable."""
+ settings = _load_settings()
+
+ user_facing_suffixes = (".enabled", ".api_key", ".max_results")
+
+ found = False
+ for key, value in settings.items():
+ if any(key.endswith(suffix) for suffix in user_facing_suffixes):
+ if isinstance(value, dict) and "editable" in value:
+ assert value["editable"] is not False, (
+ f"{key} is a user-facing setting but is marked non-editable"
+ )
+ found = True
+
+ assert found, (
+ "Expected at least one user-facing editable setting to validate"
+ )