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(citation): restore str() in _extract_key_facts to fix mypy no-any-return (#4330)

LearningCircuit25bd553712ba
diff --git a/changelog.d/+fix-extract-key-facts-return-type.bugfix.md b/changelog.d/+fix-extract-key-facts-return-type.bugfix.md
new file mode 100644
index 0000000000..5ea9f8104e
--- /dev/null
+++ b/changelog.d/+fix-extract-key-facts-return-type.bugfix.md
@@ -0,0 +1 @@
+Restore `str()` coercion in the precision citation handler's key-fact extraction so it always returns a string (fixes a mypy `no-any-return` failure introduced in #3884).
diff --git a/src/local_deep_research/citation_handlers/precision_extraction_handler.py b/src/local_deep_research/citation_handlers/precision_extraction_handler.py
index c125d6c833..52c1f46211 100644
--- a/src/local_deep_research/citation_handlers/precision_extraction_handler.py
+++ b/src/local_deep_research/citation_handlers/precision_extraction_handler.py
@@ -600,7 +600,7 @@ List the most important facts (names, numbers, dates) found:"""
facts = response.content
else:
facts = response
- return facts[:500]
+ return str(facts)[:500]
except Exception:
# Fallback to truncated previous knowledge if LLM extraction fails
return previous_knowledge[:500]