fix: prune dead web_search tool — ddgs never installed (#87)
Remove DuckDuckGoTools import, all web_search registrations across 4 toolkit factories, catalog entry, safety classification, prompt references, and session regex. Total: -41 lines of dead code. consult_grok is functional (grok_enabled=True, API key set) and opt-in, so it stays — but Timmy never calls it autonomously, which is correct sovereign behavior (no cloud calls unless user permits). Closes #87
This commit is contained in:
@@ -69,7 +69,7 @@ class TestGetImpactLevel:
|
||||
def test_low_impact(self):
|
||||
from integrations.chat_bridge.vendors.discord import _get_impact_level
|
||||
|
||||
assert _get_impact_level("web_search") == "low"
|
||||
assert _get_impact_level("calculator") == "low"
|
||||
assert _get_impact_level("unknown") == "low"
|
||||
|
||||
|
||||
@@ -104,10 +104,10 @@ class TestToolSafety:
|
||||
|
||||
assert requires_confirmation("calculator") is False
|
||||
|
||||
def test_web_search_is_safe(self):
|
||||
def test_memory_search_is_safe(self):
|
||||
from timmy.tool_safety import requires_confirmation
|
||||
|
||||
assert requires_confirmation("web_search") is False
|
||||
assert requires_confirmation("memory_search") is False
|
||||
|
||||
def test_unknown_tool_requires_confirmation(self):
|
||||
from timmy.tool_safety import requires_confirmation
|
||||
|
||||
@@ -29,7 +29,7 @@ def clear_usage():
|
||||
|
||||
class TestToolTracking:
|
||||
def test_track_creates_agent_entry(self):
|
||||
_track_tool_usage("agent-1", "web_search", success=True)
|
||||
_track_tool_usage("agent-1", "calculator", success=True)
|
||||
assert "agent-1" in _TOOL_USAGE
|
||||
assert len(_TOOL_USAGE["agent-1"]) == 1
|
||||
|
||||
@@ -132,7 +132,6 @@ class TestToolCatalog:
|
||||
def test_catalog_contains_base_tools(self):
|
||||
catalog = get_all_available_tools()
|
||||
base_tools = {
|
||||
"web_search",
|
||||
"shell",
|
||||
"python",
|
||||
"read_file",
|
||||
@@ -141,6 +140,8 @@ class TestToolCatalog:
|
||||
}
|
||||
for tool_id in base_tools:
|
||||
assert tool_id in catalog, f"Missing base tool: {tool_id}"
|
||||
# web_search removed — dead code, ddgs never installed (#87)
|
||||
assert "web_search" not in catalog
|
||||
|
||||
def test_catalog_tool_structure(self):
|
||||
catalog = get_all_available_tools()
|
||||
@@ -153,7 +154,6 @@ class TestToolCatalog:
|
||||
def test_catalog_orchestrator_has_all_base_tools(self):
|
||||
catalog = get_all_available_tools()
|
||||
base_tools = {
|
||||
"web_search",
|
||||
"shell",
|
||||
"python",
|
||||
"read_file",
|
||||
@@ -167,7 +167,6 @@ class TestToolCatalog:
|
||||
|
||||
def test_catalog_echo_research_tools(self):
|
||||
catalog = get_all_available_tools()
|
||||
assert "echo" in catalog["web_search"]["available_in"]
|
||||
assert "echo" in catalog["read_file"]["available_in"]
|
||||
# Echo should NOT have shell
|
||||
assert "echo" not in catalog["shell"]["available_in"]
|
||||
|
||||
@@ -27,7 +27,7 @@ class TestRequiresConfirmation:
|
||||
assert requires_confirmation(tool) is True
|
||||
|
||||
def test_safe_tools(self):
|
||||
for tool in ("web_search", "calculator", "read_file", "list_files"):
|
||||
for tool in ("calculator", "read_file", "list_files"):
|
||||
assert requires_confirmation(tool) is False
|
||||
|
||||
def test_unknown_defaults_to_dangerous(self):
|
||||
@@ -118,7 +118,7 @@ class TestGetImpactLevel:
|
||||
assert get_impact_level("aider") == "medium"
|
||||
|
||||
def test_low(self):
|
||||
assert get_impact_level("web_search") == "low"
|
||||
assert get_impact_level("calculator") == "low"
|
||||
assert get_impact_level("unknown") == "low"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user