~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.
Python academiaanthropicarxivbravedeep-researchencryptionhome-automationhomeserverlocallocal-deep-researchlocal-llmmistralollamaopenaipubmedresearchresearch-toolretrieval-augmented-generationsearxngself-hosted
fix(search): restore TinyFish ruff-format gate + redact query from request-error logs (#4057 follow-up) (#4806)
LearningCircuit0a6c4dded4e6
diff --git a/changelog.d/4806.bugfix.md b/changelog.d/4806.bugfix.mdnew file mode 100644index 0000000000..3a89040a88--- /dev/null+++ b/changelog.d/4806.bugfix.md@@ -0,0 +1 @@+**TinyFish search engine no longer logs your search query on request errors.** When a TinyFish Search/Fetch call failed, the request exception (which embeds the query in the URL) was written to the error log; failures now record only a static message plus the HTTP status. Also restores `ruff format` on the TinyFish test files so the pre-commit gate passes.diff --git a/src/local_deep_research/web_search_engines/engines/search_engine_tinyfish.py b/src/local_deep_research/web_search_engines/engines/search_engine_tinyfish.pyindex affadcfefa..0c2e9cca5c 100644--- a/src/local_deep_research/web_search_engines/engines/search_engine_tinyfish.py+++ b/src/local_deep_research/web_search_engines/engines/search_engine_tinyfish.py@@ -167,7 +167,16 @@ class TinyFishSearchEngine(BaseSearchEngine):except RateLimitError:raiseexcept requests.exceptions.RequestException as e:- logger.exception("Error getting TinyFish search results")+ # The search query rides in the request URL (params=query=...), so+ # the requests exception string/traceback would leak it into logs.+ # Log only a static message plus the HTTP status — never the+ # URL-bearing error. (_scrub_error does not strip a plain query=.)+ status_code = getattr(+ getattr(e, "response", None), "status_code", None+ )+ logger.warning(+ f"Error getting TinyFish search results (status={status_code})"+ )self._raise_request_exception_if_rate_limited(e)return []except Exception:@@ -239,7 +248,14 @@ class TinyFishSearchEngine(BaseSearchEngine):except RateLimitError:raiseexcept requests.exceptions.RequestException as e:- logger.exception("Error fetching TinyFish page content")+ # Mirror _get_previews: avoid logging the URL-bearing exception+ # string; record a static message plus the HTTP status only.+ status_code = getattr(+ getattr(e, "response", None), "status_code", None+ )+ logger.warning(+ f"Error fetching TinyFish page content (status={status_code})"+ )self._raise_request_exception_if_rate_limited(e)except Exception:logger.exception("Unexpected error fetching TinyFish page content")diff --git a/tests/web_search_engines/engines/test_search_engine_tinyfish.py b/tests/web_search_engines/engines/test_search_engine_tinyfish.pyindex 7242a5dfa3..27e0f36b30 100644--- a/tests/web_search_engines/engines/test_search_engine_tinyfish.py+++ b/tests/web_search_engines/engines/test_search_engine_tinyfish.py@@ -194,6 +194,44 @@ class TestTinyFishGetPreviews:assert engine._get_previews("test query") == []+ def test_get_previews_request_exception_does_not_log_query(self):+ """On a request error the user's query must not reach the logs.++ The query rides in the request URL (params=query=...), so a requests+ exception string embeds it; the old logger.exception leaked it. We now+ log a static message + status only, and never logger.exception here.+ """+ import requests++ from local_deep_research.web_search_engines.engines.search_engine_tinyfish import (+ TinyFishSearchEngine,+ )++ secret_query = "super-secret-user-query"+ error = requests.exceptions.RequestException(+ "404 Client Error for url: "+ f"https://api.search.tinyfish.ai/?query={secret_query}"+ )++ with (+ patch(+ "local_deep_research.web_search_engines.engines.search_engine_tinyfish.safe_get",+ side_effect=error,+ ),+ patch(+ "local_deep_research.web_search_engines.engines.search_engine_tinyfish.logger"+ ) as mock_logger,+ ):+ engine = TinyFishSearchEngine(api_key="test-key")+ assert engine._get_previews(secret_query) == []++ logged = " ".join(+ str(arg) for call in mock_logger.mock_calls for arg in call.args+ )+ assert secret_query not in logged+ mock_logger.exception.assert_not_called()+ assert mock_logger.warning.call_count >= 1+def test_get_previews_request_exception_with_rate_limit_response(self):import requests