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(research): suppress citation milestone on iteration failure (#7848)

creed1764b8b01b5c
diff --git a/changelog.d/5884.bugfix.md b/changelog.d/5884.bugfix.md
new file mode 100644
index 0000000000..684ff4c451
--- /dev/null
+++ b/changelog.d/5884.bugfix.md
@@ -0,0 +1 @@
+Do not report an iteration-limit research failure as skipped citation synthesis in progress updates.
diff --git a/src/local_deep_research/advanced_search_system/strategies/langgraph_agent_strategy.py b/src/local_deep_research/advanced_search_system/strategies/langgraph_agent_strategy.py
index 88ff383d3a..7855f386ff 100644
--- a/src/local_deep_research/advanced_search_system/strategies/langgraph_agent_strategy.py
+++ b/src/local_deep_research/advanced_search_system/strategies/langgraph_agent_strategy.py
@@ -3803,7 +3803,7 @@ class LangGraphAgentStrategy(BaseSearchStrategy):
)
# Emit synthesis milestone if it is not an agent failure
- if final_answer != NO_RESULTS_MESSAGE:
+ if final_answer not in (NO_RESULTS_MESSAGE, NO_SYNTHESIS_MESSAGE):
if not all_search_results and self.all_links_of_system:
self._update_progress(
f"Skipping citation synthesis (reusing {accumulated_sources} accumulated sources)",
diff --git a/tests/strategies/test_langgraph_agent_strategy.py b/tests/strategies/test_langgraph_agent_strategy.py
index aff7eb04c3..14f7e603ea 100644
--- a/tests/strategies/test_langgraph_agent_strategy.py
+++ b/tests/strategies/test_langgraph_agent_strategy.py
@@ -6708,6 +6708,33 @@ class TestFinalizeCitationLogging:
]
assert len(synthesis_updates) == 0
+ def test_milestone_skipped_for_no_synthesis_sentinel_with_accumulated_sources(
+ self,
+ ):
+ """An iteration-limit failure must not look like a citation skip."""
+ from local_deep_research.advanced_search_system.strategies.langgraph_agent_strategy import (
+ NO_SYNTHESIS_MESSAGE,
+ )
+
+ handler = MagicMock()
+ strategy = self._make_strategy(
+ all_links=[self._link(1, "https://a.example/x")],
+ citation_handler=handler,
+ )
+ progress_updates = []
+ strategy.set_progress_callback(
+ lambda msg, pct, meta: progress_updates.append((msg, pct, meta))
+ )
+
+ result = strategy._finalize("q", NO_SYNTHESIS_MESSAGE, 1, 0, [])
+
+ handler.analyze_followup.assert_not_called()
+ assert result["current_knowledge"] == NO_SYNTHESIS_MESSAGE
+ assert not any(
+ meta.get("phase") == "synthesis"
+ for _msg, _pct, meta in progress_updates
+ )
+
def test_milestone_describes_accumulated_sources_when_new_empty(self):
"""Empty per-call collector but accumulated sources present -> show accumulated sources."""
links = [self._link(1, "https://a.example/x")]