Skip to content

Personal AI, On Personal Devices

Python

test(tools): cover eager deep-research registration

Elliot Sluskybcdbf13d02ae
diff --git a/tests/tools/test_tool_registration.py b/tests/tools/test_tool_registration.py
index 1369678b..b045fd6d 100644
--- a/tests/tools/test_tool_registration.py
+++ b/tests/tools/test_tool_registration.py
@@ -3,6 +3,7 @@
from __future__ import annotations
import importlib
+import subprocess
import sys
from openjarvis.core.registry import ToolRegistry
@@ -68,6 +69,10 @@ EXPECTED_TOOLS = {
"kg_add_relation",
"kg_query",
"kg_neighbors",
+ # knowledge_sql.py
+ "knowledge_sql",
+ # scan_chunks.py
+ "scan_chunks",
}
@@ -100,3 +105,25 @@ def test_all_builtin_tools_registered():
assert not missing, (
f"Tools not registered (missing import in __init__.py?): {sorted(missing)}"
)
+
+
+def test_package_import_registers_deep_research_tools():
+ """Registration must not depend on another module being imported first."""
+ result = subprocess.run(
+ [
+ sys.executable,
+ "-c",
+ (
+ "import openjarvis.tools; "
+ "from openjarvis.core.registry import ToolRegistry; "
+ "expected = {'knowledge_sql', 'scan_chunks'}; "
+ "missing = expected - set(ToolRegistry.keys()); "
+ "assert not missing, f'Missing tools: {sorted(missing)}'"
+ ),
+ ],
+ capture_output=True,
+ text=True,
+ check=False,
+ )
+
+ assert result.returncode == 0, result.stderr