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(progress): cross-reference _REPORT_PHASES emitters (#4481)

LearningCircuitd5ccbddbc5f6
diff --git a/src/local_deep_research/web/services/research_service.py b/src/local_deep_research/web/services/research_service.py
index 0dc8eedcde..7e322875a7 100644
--- a/src/local_deep_research/web/services/research_service.py
+++ b/src/local_deep_research/web/services/research_service.py
@@ -48,6 +48,9 @@ _global_research_semaphore = threading.Semaphore(_MAX_GLOBAL_CONCURRENT)
_DETAILED_SEARCH_PROGRESS_CAP = 8 # Search/output phases capped here
_DETAILED_REPORT_PROGRESS_START = 10 # Report generation starts here
_DETAILED_REPORT_PROGRESS_END = 100 # Report generation ends here
+# Phases that belong to the report-generation stage. "report_generation" is
+# emitted in this file; the other four are emitted by report_generator.py. If
+# you add or rename a phase, update both this set and the emitter.
_REPORT_PHASES = frozenset(
{
"report_generation",
@@ -58,18 +61,6 @@ _REPORT_PHASES = frozenset(
}
)
-# Socket.IO emission throttling: minimum interval between progress emissions per research
-_EMIT_THROTTLE_SECONDS = 0.2 # 200ms
-_EMIT_TTL_SECONDS = 3600 # 1 hour — evict stale entries from orphaned research
-
-# Cap on the partial-content buffer kept server-side so chat-mode termination
-# can persist whatever was already streamed. Bounded to keep memory predictable
-# under pathologically long answers (typical answers are a few KB).
-_MAX_PARTIAL_BUFFER_BYTES = 256 * 1024 # 256 KB
-_emit_cleanup_counter = 0
-_last_emit_times: dict[str, float] = {}
-_last_emit_lock = threading.Lock()
-
# Phases that produce user-visible step messages in chat mode.
# "complete" is excluded — it fires AFTER the response message is written,
# which would create a step with a higher sequence_number than the response.
@@ -89,6 +80,18 @@ _STEP_PHASES = frozenset(
}
)
+# Socket.IO emission throttling: minimum interval between progress emissions per research
+_EMIT_THROTTLE_SECONDS = 0.2 # 200ms
+_EMIT_TTL_SECONDS = 3600 # 1 hour — evict stale entries from orphaned research
+
+# Cap on the partial-content buffer kept server-side so chat-mode termination
+# can persist whatever was already streamed. Bounded to keep memory predictable
+# under pathologically long answers (typical answers are a few KB).
+_MAX_PARTIAL_BUFFER_BYTES = 256 * 1024 # 256 KB
+_emit_cleanup_counter = 0
+_last_emit_times: dict[str, float] = {}
+_last_emit_lock = threading.Lock()
+
def _chat_step_decision(
phase: str | None,