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(settings): offer configured search engines (#6915)

LearningCircuit3c277e862071
diff --git a/changelog.d/+available-search-picker.bugfix.md b/changelog.d/+available-search-picker.bugfix.md
new file mode 100644
index 0000000000..c706f17de3
--- /dev/null
+++ b/changelog.d/+available-search-picker.bugfix.md
@@ -0,0 +1 @@
+Remove the unavailable DuckDuckGo and Local All entries from the default search picker, and offer Wikipedia when search-engine discovery is unavailable. Existing custom settings are preserved; select an available engine if a previously saved choice cannot be constructed.
diff --git a/docs/features.md b/docs/features.md
index 950b793313..8f0216c6b6 100644
--- a/docs/features.md
+++ b/docs/features.md
@@ -94,7 +94,7 @@ Simultaneously query multiple search engines for comprehensive results.
**Supported Engines:**
- Academic: arXiv, PubMed, Semantic Scholar
-- General: Wikipedia, SearXNG, DuckDuckGo
+- General: Wikipedia, SearXNG, Brave
- Technical: GitHub, Elasticsearch
- Custom: Local documents, LangChain retrievers
diff --git a/src/local_deep_research/defaults/default_settings.json b/src/local_deep_research/defaults/default_settings.json
index ff0444ce5e..6716a0a1a6 100644
--- a/src/local_deep_research/defaults/default_settings.json
+++ b/src/local_deep_research/defaults/default_settings.json
@@ -1645,10 +1645,6 @@
"label": "Google Programmable Search Engine",
"value": "google_pse"
},
- {
- "label": "DuckDuckGo",
- "value": "duckduckgo"
- },
{
"label": "Brave",
"value": "brave"
@@ -1660,10 +1656,6 @@
{
"label": "Wayback",
"value": "wayback"
- },
- {
- "label": "Local All",
- "value": "local_all"
}
],
"step": null,
diff --git a/src/local_deep_research/web/static/js/components/settings.js b/src/local_deep_research/web/static/js/components/settings.js
index ebc07b0ac4..417b85f860 100644
--- a/src/local_deep_research/web/static/js/components/settings.js
+++ b/src/local_deep_research/web/static/js/components/settings.js
@@ -5274,7 +5274,7 @@
optionsSource = typeof searchEngineOptions !== 'undefined' && searchEngineOptions.length > 0 ?
searchEngineOptions : [
{ value: 'google_pse', label: 'Google Programmable Search' },
- { value: 'duckduckgo', label: 'DuckDuckGo' },
+ { value: 'wikipedia', label: 'Wikipedia' },
{ value: 'searxng', label: 'SearXNG' }
];
}
diff --git a/tests/settings/golden_master_settings.json b/tests/settings/golden_master_settings.json
index a0cf553b9f..0410e96334 100644
--- a/tests/settings/golden_master_settings.json
+++ b/tests/settings/golden_master_settings.json
@@ -9625,10 +9625,6 @@
"label": "Google Programmable Search Engine",
"value": "google_pse"
},
- {
- "label": "DuckDuckGo",
- "value": "duckduckgo"
- },
{
"label": "Brave",
"value": "brave"
@@ -9640,10 +9636,6 @@
{
"label": "Wayback",
"value": "wayback"
- },
- {
- "label": "Local All",
- "value": "local_all"
}
],
"step": null,
diff --git a/tests/test_advertised_but_dead_sweep.py b/tests/test_advertised_but_dead_sweep.py
index f3f2f5a745..e44a8d0c59 100644
--- a/tests/test_advertised_but_dead_sweep.py
+++ b/tests/test_advertised_but_dead_sweep.py
@@ -905,8 +905,7 @@ def test_every_documented_setting_key_exists_in_the_catalogue():
# ``/settings/api/available-search-engines`` (which is built from
# ``search_config()`` and therefore only lists constructible engines) — but
# when that call fails, components/settings.js falls back to a hardcoded
-# list that offers ``duckduckgo`` by name. So both the stored options and
-# the client-side safety net hand the user an unbuildable id.
+# list. Both sources must only offer engine ids the factory can resolve.
#
# An engine is constructible only if the settings catalogue defines
# ``search.engine.web.<name>.*`` keys for it: ``search_engines_config`` builds
@@ -989,48 +988,84 @@ def test_search_engine_inventories_are_populated():
assert landmark in options
- strict=True,
- reason=(
- "KNOWN DEFECT, pre-existing. The visible search.tool picker "
- "offers 'duckduckgo' and 'local_all'. Neither has a "
- "search.engine.web.<name> settings block, so search_config() "
- "never decorates them from ENGINE_REGISTRY and "
- "get_search_engine() takes its fail-closed branch: "
- "ValueError('Unknown search engine') on every run. Selecting "
- "either breaks research outright. "
- ),
-)
def test_every_search_engine_dropdown_option_can_be_constructed():
- """USER-FACING: two options in the Search Engine select are unbuildable.
-
- Any client that builds the picker from the settings API's ``options``
- list — and components/settings.js's own offline fallback, which names
- ``duckduckgo`` explicitly — can hand the server a value that makes
- ``get_search_engine`` raise ``ValueError: Unknown search engine '<name>'``
- on every research run.
-
- * ``duckduckgo`` — the label is "DuckDuckGo"; ``duckduckgo-search`` is a
- declared runtime dependency; ``search_engine_factory`` even has a
- ``search_tool in ["duckduckgo", ...]`` parameter branch for it; and
- docs/features.md lists DuckDuckGo among the supported general engines
- with a whole troubleshooting section. But the implementation is
- registered under the id ``ddg``, and NEITHER ``ddg`` nor ``duckduckgo``
- has a ``search.engine.web.*`` settings block, so neither can ever be
- built.
- * ``local_all`` — label "Local All"; the string appears nowhere in the
- codebase outside this options list.
- """
+ """Both the stored options and discovery fallback name configured engines."""
configurable = configurable_engine_names()
- unbuildable = [
- value
- for value in search_tool_option_values()
- if value not in configurable
- ]
- assert unbuildable == [], (
- "search.tool offers engine ids the factory cannot resolve "
- f"(it raises ValueError('Unknown search engine ...')): {unbuildable}"
+ registry = engine_registry_names()
+ fallback_block = re.search(
+ r"optionsSource = typeof searchEngineOptions.*?searchEngineOptions : \[(.*?)\];",
+ _read(WEB / "static/js/components/settings.js"),
+ re.DOTALL,
)
+ assert fallback_block is not None, "search.tool fallback block not found"
+ fallback_entries = re.findall(
+ r"""\bvalue\s*:\s*(['"])(.*?)\1""", fallback_block.group(1)
+ )
+ fallback = [value for _, value in fallback_entries]
+ assert len(fallback) == len(
+ re.findall(r"\bvalue\s*:", fallback_block.group(1))
+ ), "every discovery fallback ID must be parsed"
+ assert len(fallback) >= 2, "search fallback must offer usable choices"
+ for source, options in (
+ ("settings catalogue", search_tool_option_values()),
+ ("discovery fallback", fallback),
+ ):
+ unbuildable = [
+ value
+ for value in options
+ if value not in configurable or value not in registry
+ ]
+ assert unbuildable == [], (
+ f"{source} offers engine ids the factory cannot resolve: "
+ f"{unbuildable}"
+ )
+
+
+def _replace_fallback_provider_for_guard(monkeypatch, literal):
+ original_read = _read
+
+ def read_with_fallback(path):
+ source = original_read(path)
+ if path == WEB / "static/js/components/settings.js":
+ source, count = re.subn(
+ r"value: 'wikipedia'", f"value: {literal}", source
+ )
+ assert count >= 1, "Wikipedia fallback control not found"
+ return source
+
+ monkeypatch.setitem(globals(), "_read", read_with_fallback)
+
+
[email protected]("quote", ["'", '"'])
+def test_fallback_guard_rejects_unknown_ids_in_either_quote_style(
+ monkeypatch, quote
+):
+ _replace_fallback_provider_for_guard(
+ monkeypatch, f"{quote}review_nonexistent_engine{quote}"
+ )
+
+ with pytest.raises(
+ AssertionError, match="discovery fallback offers engine ids"
+ ):
+ test_every_search_engine_dropdown_option_can_be_constructed()
+
+
[email protected]("quote", ["'", '"'])
+def test_fallback_guard_accepts_configured_ids_in_either_quote_style(
+ monkeypatch, quote
+):
+ _replace_fallback_provider_for_guard(
+ monkeypatch, f"{quote}wikipedia{quote}"
+ )
+
+ test_every_search_engine_dropdown_option_can_be_constructed()
+
+
+def test_fallback_guard_rejects_unreadable_provider_id(monkeypatch):
+ _replace_fallback_provider_for_guard(monkeypatch, "not_a_literal")
+
+ with pytest.raises(AssertionError, match="every discovery fallback ID"):
+ test_every_search_engine_dropdown_option_can_be_constructed()
@pytest.mark.xfail(