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.

docs+tests: clarify app.debug after LDR_LOGURU_DIAGNOSE split (#4384) (#4398)

LearningCircuit7d4ba92f9ced
diff --git a/changelog.d/+app-debug-description-after-loguru-diagnose-split.misc.md b/changelog.d/+app-debug-description-after-loguru-diagnose-split.misc.md
new file mode 100644
index 0000000000..739e6322c7
--- /dev/null
+++ b/changelog.d/+app-debug-description-after-loguru-diagnose-split.misc.md
@@ -0,0 +1 @@
+Clarified the auto-generated `app.debug` / `LDR_APP_DEBUG` description in `default_settings.json` (and therefore `docs/CONFIGURATION.md`) to reflect the split introduced when `LDR_LOGURU_DIAGNOSE` was added: `LDR_APP_DEBUG` now raises log level only and explicitly does NOT enable Loguru's local-variable dumps on its own. Companion to the `LDR_LOGURU_DIAGNOSE` security fix.
diff --git a/docs/CONFIGURATION.md b/docs/CONFIGURATION.md
index bc749bef06..433c45d556 100644
--- a/docs/CONFIGURATION.md
+++ b/docs/CONFIGURATION.md
@@ -64,7 +64,7 @@ They are not available in the Web UI because they are needed to start the applic
| Key | Environment Variable | Default Value | Description | Type |
|-----|----------------------|---------------|-------------|------|
| `app.allow_registrations` | `LDR_APP_ALLOW_REGISTRATIONS` | `true` | Allow new user registrations through the web interface. Configured via LDR_APP_ALLOW_REGISTRATIONS environment variable. Set to 'false' to disable on public-facing deployments. Enabled by default so initial account creation works out of the box. Requires server restart. | APP |
-| `app.debug` | `LDR_APP_DEBUG` | `false` | Produces more informative errors when something goes wrong, but may expose sensitive data. Configured via LDR_APP_DEBUG environment variable. Requires server restart. | APP |
+| `app.debug` | `LDR_APP_DEBUG` | `false` | Raises log verbosity to DEBUG level. Configured via LDR_APP_DEBUG environment variable. Requires server restart. Does NOT enable Loguru's diagnose mode (local-variable dumps in exception tracebacks); set LDR_LOGURU_DIAGNOSE=true in addition if you need that — see docs/env_configuration.md. | APP |
| `app.enable_file_logging` | `LDR_APP_ENABLE_FILE_LOGGING` | `false` | Enable logging to files (WARNING: Log files are unencrypted and may contain sensitive data) | APP |
| `app.enable_notifications` | `LDR_APP_ENABLE_NOTIFICATIONS` | `true` | Enable browser push notifications to alert you when research completes or encounters errors. Requires browser permission to display notifications. | APP |
| `app.enable_web` | `LDR_APP_ENABLE_WEB` | `true` | Enable the web interface. When disabled, the application runs in CLI-only mode. Requires server restart to take effect. | APP |
diff --git a/src/local_deep_research/defaults/default_settings.json b/src/local_deep_research/defaults/default_settings.json
index fbc530d51e..51513be109 100644
--- a/src/local_deep_research/defaults/default_settings.json
+++ b/src/local_deep_research/defaults/default_settings.json
@@ -1,7 +1,7 @@
{
"app.debug": {
"category": "app_interface",
- "description": "Produces more informative errors when something goes wrong, but may expose sensitive data. Configured via LDR_APP_DEBUG environment variable. Requires server restart.",
+ "description": "Raises log verbosity to DEBUG level. Configured via LDR_APP_DEBUG environment variable. Requires server restart. Does NOT enable Loguru's diagnose mode (local-variable dumps in exception tracebacks); set LDR_LOGURU_DIAGNOSE=true in addition if you need that — see docs/env_configuration.md.",
"editable": false,
"max_value": null,
"min_value": null,
diff --git a/tests/settings/golden_master_settings.json b/tests/settings/golden_master_settings.json
index 94d5584698..e0a8b3da08 100644
--- a/tests/settings/golden_master_settings.json
+++ b/tests/settings/golden_master_settings.json
@@ -15,7 +15,7 @@
},
"app.debug": {
"category": "app_interface",
- "description": "Produces more informative errors when something goes wrong, but may expose sensitive data. Configured via LDR_APP_DEBUG environment variable. Requires server restart.",
+ "description": "Raises log verbosity to DEBUG level. Configured via LDR_APP_DEBUG environment variable. Requires server restart. Does NOT enable Loguru's diagnose mode (local-variable dumps in exception tracebacks); set LDR_LOGURU_DIAGNOSE=true in addition if you need that — see docs/env_configuration.md.",
"editable": false,
"max_value": null,
"min_value": null,
diff --git a/tests/utilities/test_log_utils_extended.py b/tests/utilities/test_log_utils_extended.py
index 9ae9bdef17..74c659840f 100644
--- a/tests/utilities/test_log_utils_extended.py
+++ b/tests/utilities/test_log_utils_extended.py
@@ -548,7 +548,7 @@ class TestConfigLoggerExtended:
# Should add 4 sinks including file
assert mock_logger.add.call_count == 4
- def test_debug_mode_sets_diagnose_true(self):
+ def test_diagnose_true_requires_both_debug_and_optin(self):
"""diagnose=True requires BOTH debug=True AND LDR_LOGURU_DIAGNOSE opt-in."""
from local_deep_research.utilities.log_utils import config_logger
import local_deep_research.utilities.log_utils as module
@@ -564,6 +564,39 @@ class TestConfigLoggerExtended:
for add_call in mock_logger.add.call_args_list:
assert add_call[1].get("diagnose") is True
+ def test_diagnose_propagates_to_file_sink(self):
+ """File sink must receive the same diagnose flag as the other sinks.
+
+ Regression guard: with LDR_ENABLE_FILE_LOGGING=true the file sink is the
+ 4th logger.add() call. If that branch ever loses the diagnose argument,
+ the file (the most persistent and credential-risky sink) would silently
+ leak frame locals despite the opt-in being off.
+ """
+ from local_deep_research.utilities.log_utils import config_logger
+ import local_deep_research.utilities.log_utils as module
+
+ with patch.dict(
+ os.environ,
+ {"LDR_ENABLE_FILE_LOGGING": "true", "LDR_LOGURU_DIAGNOSE": ""},
+ ):
+ with patch.object(module, "logger") as mock_logger:
+ config_logger("test_app", debug=True)
+
+ assert mock_logger.add.call_count == 4
+ for add_call in mock_logger.add.call_args_list:
+ assert add_call[1].get("diagnose") is False
+
+ with patch.dict(
+ os.environ,
+ {"LDR_ENABLE_FILE_LOGGING": "true", "LDR_LOGURU_DIAGNOSE": "true"},
+ ):
+ with patch.object(module, "logger") as mock_logger:
+ config_logger("test_app", debug=True)
+
+ assert mock_logger.add.call_count == 4
+ for add_call in mock_logger.add.call_args_list:
+ assert add_call[1].get("diagnose") is True
+
def test_diagnose_off_when_debug_without_optin(self):
"""debug=True alone must NOT enable diagnose (localvar leak, issue #4185).