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.

test(web/routes): fix stale test_report_success after #4371 sources change (#4375)

LearningCircuit360506162e1d
diff --git a/tests/web/routes/test_research_routes_extra_coverage.py b/tests/web/routes/test_research_routes_extra_coverage.py
index f56fd82367..33f0aac9f9 100644
--- a/tests/web/routes/test_research_routes_extra_coverage.py
+++ b/tests/web/routes/test_research_routes_extra_coverage.py
@@ -182,7 +182,12 @@ class TestGetResearchLogs:
class TestGetResearchReport:
def test_report_success(self, client):
"""Returns assembled report content + metadata + backwards-compat fields."""
- meta = {"all_links_of_system": ["http://a.com"], "findings": ["f1"]}
+ # Post-#4371 (#3665): /api/report reads `sources` from the
+ # research_resources table via get_research_source_links_batch (shape
+ # {"url", "title"}), not the dead research_meta["all_links_of_system"]
+ # key the chat-mode-v2 save path stopped writing. `findings` still
+ # comes from research_meta.
+ meta = {"findings": ["f1"]}
research = _make_research(
research_meta=meta, title="My Report", report_path="/tmp/r.md"
)
@@ -197,6 +202,10 @@ class TestGetResearchReport:
f"{ASSEMBLY_MOD}.assemble_full_report",
return_value="# Report content",
),
+ patch(
+ f"{ASSEMBLY_MOD}.get_research_source_links_batch",
+ return_value={"res-1": [{"url": "http://a.com", "title": "A"}]},
+ ),
):
resp = client.get("/api/report/res-1")
@@ -204,7 +213,7 @@ class TestGetResearchReport:
data = resp.get_json()
assert data["content"] == "# Report content"
assert data["summary"] == "# Report content"
- assert data["sources"] == ["http://a.com"]
+ assert data["sources"] == [{"url": "http://a.com", "title": "A"}]
assert data["findings"] == ["f1"]
assert data["metadata"]["title"] == "My Report"
assert data["metadata"]["query"] == "test query"