From e4ef50a0dadfbb509365d5f5217022ae9d3605b8 Mon Sep 17 00:00:00 2001 From: AJV20 <24819659+AJV20@users.noreply.github.com> Date: Thu, 28 May 2026 09:26:09 -0400 Subject: [PATCH] test: cover provider-neutral notes sources --- CHANGELOG.md | 2 +- tests/test_webui_notes_sources.py | 22 ++++++++++++++-------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d1a971be..9c964d0b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ ### Fixed -- The third-party notes drawer's “Recently used by AI” Joplin list now follows the WebUI-specific `HERMES_WEBUI_PREFILL_MESSAGES_SCRIPT` / `webui_prefill_messages_script` hook when configured, including argv-style hooks such as `[python3, /path/to/recall.py]` and command strings such as `python3 /path/to/recall.py`, before falling back to the legacy generic `prefill_messages_script`. +- The third-party notes drawer’s “Recently used by AI” list now follows the provider-neutral WebUI-specific `HERMES_WEBUI_PREFILL_MESSAGES_SCRIPT` / `webui_prefill_messages_script` hook when configured, including argv-style hooks such as `[python3, /path/to/recall.py]` and command strings such as `python3 /path/to/recall.py`, before falling back to the legacy generic `prefill_messages_script`. Configured third-party notes sources such as Joplin, Obsidian, Notion, and llm-wiki remain visible even before runtime tool inventory hydrates. ## [v0.51.152] — 2026-05-28 — Release DX (stage-batch34 — single-PR optional gateway-backed browser chat) diff --git a/tests/test_webui_notes_sources.py b/tests/test_webui_notes_sources.py index 2a50273c..ee3878cc 100644 --- a/tests/test_webui_notes_sources.py +++ b/tests/test_webui_notes_sources.py @@ -41,23 +41,29 @@ def test_notes_sources_redacts_tool_descriptions_and_omits_plain_file_tools(): assert "[REDACTED]" in source["tools"][0]["description"] -def test_notes_sources_shows_configured_note_servers_without_tool_inventory(): +def test_notes_sources_shows_configured_third_party_note_servers_without_tool_inventory(): from api.routes import _notes_sources_from_mcp_inventory servers = { "joplin": {"name": "joplin", "enabled": True, "active": False, "status": "configured"}, + "obsidian": {"name": "obsidian", "enabled": True, "active": False, "status": "configured"}, + "notion": {"name": "notion", "enabled": True, "active": False, "status": "configured"}, + "llm-wiki": {"name": "llm-wiki", "enabled": True, "active": False, "status": "configured"}, "filesystem": {"name": "filesystem", "enabled": True, "active": True, "status": "healthy"}, } sources = _notes_sources_from_mcp_inventory(servers, []) - assert [source["name"] for source in sources] == ["joplin"] - assert sources[0]["label"] == "Joplin" - assert sources[0]["tool_count"] == 3 - assert [tool["name"] for tool in sources[0]["tools"]] == ["search_notes", "list_notes", "get_note"] - assert all(tool.get("inferred") is True for tool in sources[0]["tools"]) - assert sources[0]["tool_source"] == "configured_hint" - assert sources[0]["status"] == "configured" + assert [source["name"] for source in sources] == ["joplin", "llm-wiki", "notion", "obsidian"] + by_name = {source["name"]: source for source in sources} + assert by_name["joplin"]["label"] == "Joplin" + assert [tool["name"] for tool in by_name["joplin"]["tools"]] == ["search_notes", "list_notes", "get_note"] + assert [tool["name"] for tool in by_name["obsidian"]["tools"]] == ["search_notes", "read_note"] + assert [tool["name"] for tool in by_name["notion"]["tools"]] == ["search_pages", "get_page"] + assert [tool["name"] for tool in by_name["llm-wiki"]["tools"]] == ["query_knowledge_base", "read_page"] + assert all(source["tool_source"] == "configured_hint" for source in sources) + assert all(tool.get("inferred") is True for source in sources for tool in source["tools"]) + assert all(source["status"] == "configured" for source in sources) def test_external_notes_sources_drawer_is_default_off(monkeypatch):