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: set search context in scheduler so rate limiting works (#3289)

LearningCircuit1a0d46e69c1a
diff --git a/src/local_deep_research/scheduler/background.py b/src/local_deep_research/scheduler/background.py
index 455cf461c4..2017993350 100644
--- a/src/local_deep_research/scheduler/background.py
+++ b/src/local_deep_research/scheduler/background.py
@@ -827,6 +827,21 @@ class BackgroundJobScheduler:
f"[DOC_SCHEDULER] Processing research {research.id} for user {username}"
)
+ # Set search context so rate limiting works in both
+ # download_pdfs and extract_text paths
+ from ...utilities.thread_context import (
+ set_search_context,
+ )
+
+ set_search_context(
+ {
+ "research_id": str(research.id),
+ "username": username,
+ "user_password": password,
+ "research_phase": "document_scheduler",
+ }
+ )
+
# Call actual processing APIs
if settings.download_pdfs:
logger.info(